Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/17/26 17:02
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 26,918 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rht, MaliceTheMaker, Haitao_Ren, JimSimons, julienp
19249 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
pass a parameter to an action? #146924
08/09/07 13:55
08/09/07 13:55
Joined: Jun 2007
Posts: 28
D
Doriel Offline OP
Newbie
Doriel  Offline OP
Newbie
D

Joined: Jun 2007
Posts: 28
Hello,

Is there any way to pass a parameter to an action? I have several items (models) that all have practically the exact same action to perform except that different data is retrieved depending on where the model is located. (next to room1 - do this, next to room 2 - do that, etc. I know I can just put all of that code in the action itself but then I would have to somehow detect which room it is next to, which I also don't know how to do.

Any ideas / suggestions / tutorials?

Much appreciated.

Doriel

Re: pass a parameter to an action? [Re: Doriel] #146925
08/09/07 14:37
08/09/07 14:37
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
You can do this with entity skills. If you assign your actions in WED, you can set skill values in the properties dialog of the entity. If you create your entity in scripts, do something like this:
Code:

you = ent_create("model.mdl", myPositionVector, myAction);
you.skill1 = 5;
you.skill2 = 10;



Then in your action, you can access the skills like this (no matter how they where set):
Code:

action myAction()
{
if(my.skill1 == 5)
{
// execute code for room 5:
...
}
}



Re: pass a parameter to an action? [Re: Excessus] #146926
08/09/07 15:43
08/09/07 15:43
Joined: Jun 2007
Posts: 28
D
Doriel Offline OP
Newbie
Doriel  Offline OP
Newbie
D

Joined: Jun 2007
Posts: 28
Ahh yes. Simple enough too Thank you!


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1