Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,513 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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