acsriot 1 Posted December 24, 2013 So I'm making an ALIVE mission , and I'm using the Nimitz Addon so I have all the players and supports spawning on the character. I usually like to add a AI spawn script and I have made this one "B_recon_TL_F" createUnit [getmarkerpos "spawn", group player]; "B_recon_TL_F" createUnit [getmarkerpos "spawn", group player]; "B_recon_TL_F" createUnit [getmarkerpos "spawn", group player]; "B_recon_TL_F" createUnit [getmarkerpos "spawn", group player]; "B_recon_TL_F" createUnit [getmarkerpos "spawn", group player]; "B_recon_TL_F" createUnit [getmarkerpos "spawn", group player]; "B_recon_TL_F" createUnit [getmarkerpos "spawn", group player]; with a corresponding spawn marker and item with a add action , the trouble i'm having is how do I get the AI to spawn at the height of 18 so they don't just fall into the water Share this post Link to post Share on other sites
UltimateBawb 1 Posted December 24, 2013 Try this: for [{_i=0}, {_i < 7}, {_i = _i + 1}] do { // 7 determines amount to spawn _unit = "B_recon_TL_F" createUnit [getMarkerPos "spawn", group player]; _unit setPos [getPos _unit select 0, getPos _unit select 1, 18]; // 18 determines height }; It's a bit more efficient (not that you'll notice any performance increase, it's just good practice not to repeat code) and should do what you want. Share this post Link to post Share on other sites
acsriot 1 Posted December 24, 2013 dosen't seem to work =/ only spawns 1 and still spawns at standard 0 height Share this post Link to post Share on other sites
mikie boy 18 Posted December 24, 2013 use this for height difference - setPosATL as for not spawning stick a 0.5 sleep in to check - or randomise their position when spawing - for [{_i=0}, {_i < 7}, {_i = _i + 1}] do { // 7 determines amount to spawn _unit = "B_recon_TL_F" createUnit [getMarkerPos "spawn", group player]; _unit setPosATL [(getPosATL _unit select 0) + _i, getPosATL _unit select 1, (getPosATL _unit select 2) + 18]; sleep 0.5; }; Share this post Link to post Share on other sites
UltimateBawb 1 Posted December 24, 2013 Oh yeah sorry about that. Mikie wouldn't it be best to use ASL as he's using a ship which is above water? Share this post Link to post Share on other sites