Jump to content
Sign in to follow this  
frosties

Adding INIT field?

Recommended Posts

Hello,

Been trying to add an init field to a unit that i spawn with a script but only get script errors and not the function im looking for.

Can somebody help me to get the INIT field into this script:

_unit1 = Grp1 createUnit ["ibr_drg_man1", [(getMarkerPos "spawn") select 0,(getMarkerPos "spawn") select 1,0], [], 0, "form"];

Where in this can i put in the things i want to be the INIT?

(ive searched the forums, but i havent found anything. Maybe im using the wrong search criterias?)

Share this post


Link to post
Share on other sites
Hello,

Been trying to add an init field to a unit that i spawn with a script but only get script errors and not the function im looking for.

Can somebody help me to get the INIT field into this script:

Where in this can i put in the things i want to be the INIT?

(ive searched the forums, but i havent found anything. Maybe im using the wrong search criterias?)

id recommend doing this with setVehicleInit to help with readability:

_unit1 setVehicleInit "code goes here"

if you have alot of code to put in the init line, its recommended to break this down into a variable :

 _initString = "
lots and lots of code";

then to call the statement, put:

processInitCommands

near the end when all units have spawned - this will call all init lines

Share this post


Link to post
Share on other sites

On a related topic:

Im trying to use this INIT thing with a random patrol script that ive put together.

The vehicle spawns together with the soldiers but when i try to put the driver and gunner in they wont respond...

Code:

_unit7 setVehicleVarName "technical";

_unit8 setVehicleInit "this moveInDriver technical";

_unit9 setVehicleInit "this moveInGunner technical";

EDIT:

Nevermind, i added this:

technical = _unit7;

and it worked !

Edited by Frosties
Solved it myself

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  

×