Jump to content
Sign in to follow this  
cervantes

setVehicleVarName

Recommended Posts

hi i have a any probleme with one spawn script.

i want add a name on a spawned unit, for this i have write in my spawn script.

_z6="veryslow_Ryan_Zombie7" createUnit [getMarkerPos "spawn3", groupA1];

_z7="veryslow_Ryan_Zombie8" createUnit [getMarkerPos "spawn4", groupA1];

_z8="veryslow_Ryan_Zombie9" createUnit [getMarkerPos "spawn5", groupA1];

_z9="veryslow_Ryan_Zombie10" createUnit [getMarkerPos "spawn6", groupA1];

_name1="z6";

_name2="z7";

_name3="z8";

_name4="z9";

_z6 setVehicleVarName _name1;

_z7 setVehicleVarName _name2;

_z8 setVehicleVarName _name3;

_z9 setVehicleVarName _name4;

_z6 Call Compile Format ["%1=_This ; PublicVariable ""%1""",_name1];

_z7 Call Compile Format ["%1=_This ; PublicVariable ""%1""",_name2];

_z8 Call Compile Format ["%1=_This ; PublicVariable ""%1""",_name3];

_z9 Call Compile Format ["%1=_This ; PublicVariable ""%1""",_name4];

[z6,player] exec "farmland_zombies\rising.sqs"

[z7,player] exec "farmland_zombies\rising.sqs"

[z8,player] exec "farmland_zombies\rising.sqs"

[z9,player] exec "farmland_zombies\rising.sqs"

but a rising script dont working huh.gif

have you one idea for resolve this probleme?

Share this post


Link to post
Share on other sites

Some of this code looks spooky to me - and not because it's about zombies  biggrin_o.gif

As you work with a fixed set of units you could take the easy route and assign their global names within the "createUnit" command:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_z6="veryslow_Ryan_Zombie7" createUnit [getMarkerPos "spawn3", groupA1,"z6 = this"];

[z6,player] exec "farmland_zombies\rising.sqs";

Would this work for you?

Cheers,

VictorFarbau

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×