shuko 59 Posted November 22, 2009 I think I had the same problem once, can't remember what I did, but it was probably just sleep 1 or 2 secs before adding wp. Share this post Link to post Share on other sites
manzilla 1 Posted November 22, 2009 That doesn't do it either, if I'm doing it right of course. Share this post Link to post Share on other sites
Heatseeker 0 Posted November 22, 2009 Even this doesn't work: _grp1 = [position spawngroup, side player, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup _wp = _grp1 addWaypoint [position wp1, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; _wp = _grp1 addWaypoint [position wp2, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; _wp = _grp1 addWaypoint [position wp3, 0]; _wp setWaypointType "DISMISS"; _wp setWaypointSpeed "FULL"; Not sure why the group will not move. I have 3 invisible H's named wp1, wp2, and wp3 but the spawned group does not move. Does anyone have any suggestions? Put the missing ; after spawngroup . Share this post Link to post Share on other sites
manzilla 1 Posted November 22, 2009 Put the missing ; after spawngroup . Jesus you gotta be kidding me, thanks bud. Share this post Link to post Share on other sites
shuko 59 Posted November 22, 2009 Do you check arma2.rpt or use -showscripterrors? It pretty much always picks up typos. Share this post Link to post Share on other sites
Heatseeker 0 Posted November 22, 2009 Hmm, this spawnGroup function is neat but it needs random placement, sort of how createVehicle_array works. It would be much better if it spawned the units in a random position in relation to an object or marker. Share this post Link to post Share on other sites
Murklor 10 Posted November 22, 2009 Hmm, this spawnGroup function is neat but it needs random placement, sort of how createVehicle_array works. It would be much better if it spawned the units in a random position in relation to an object or marker. Making a new random position in relation to an object based on random direction and random distance can be done in a single line (and that's the hard way, its easier to simply randomize x and y)... So I dont quite see what's so difficult about doing that. Share this post Link to post Share on other sites
manzilla 1 Posted November 23, 2009 Making a new random position in relation to an object based on random direction and random distance can be done in a single line (and that's the hard way, its easier to simply randomize x and y)... So I dont quite see what's so difficult about doing that. Could you provide an example? I'd really like to know this but my scripting knowledge is nil. Share this post Link to post Share on other sites
Murklor 10 Posted November 23, 2009 Could you provide an example? I'd really like to know this but my scripting knowledge is nil. Over several lines for simplicity, an example: _rOrig = getPos whateverObject; // Base object position _rDir = round (random 360); // random direction _rDist = 100 + (round (random 100)); // random distance (between 100-200 meters) _rPos = [(_rOrig select 0)+(sin _rDir)*_rDist,(_rOrig select 1)+(cos _rDir)*_rDist,0]; // new 2D position I think I got it right. Its less script and more math ;) There's always easier ways, but this is quite flexible. Share this post Link to post Share on other sites
speeder 0 Posted December 19, 2010 (edited) Hi. I want to spawn a T72 with crew, and make it NEVER FIRE, 0 ammo, Locked, and move from helipad named wp1 to wp2 to wp3. I tried something myself, but nothing really happens. I know it says M1A1, but thats just for testing. ?(!isServer): goTo "end"; _side1 = EAST; _side2 = WEST; _grp2 = [position wp1, _side1, "M1A1"] call BIS_fnc_spawnVehicle; ~2 _wp = _grp2 addWaypoint [position wp1, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; _wp = _grp2 addWaypoint [position wp2, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; _wp = _grp2 addWaypoint [position wp10, 0]; _wp setWaypointType "DISMISS"; _wp setWaypointSpeed "FULL"; I'm also trying to clear the AT shooting range, and I'm looking for a script which will delete ALL units, and vehicles except players within a area, including the dead tanks and units. Edited December 19, 2010 by speeder Share this post Link to post Share on other sites
demonized 20 Posted December 19, 2010 (edited) Hi. I want to spawn a T72 with crew, and make it NEVER FIRE, 0 ammo, Locked, and move from helipad named wp1 to wp2 to wp3.I tried something myself, but nothing really happens. I know it says M1A1, but thats just for testing. I'm also trying to clear the AT shooting range, and I'm looking for a script which will delete ALL units, and vehicles except players within a area, including the dead tanks and units. several mistakes: Looks like you are mixing sqs and sqf.. stick with sqf as its much more efficient and reliable. its like the notebook VS the laptop. you call side instead of tank in spawn, should be switched. also created wps are named same so that would be error as well once you get tank spawned. and use getPos object/unitname or getMArkerPos "anymarkername" Use this: execute with: _null = [] execVM "scriptname.sqf" script saved as sqf not sqs: if (isServer) then { _side1 = EAST; _side2 = WEST; _grp2 = [getPos wp1, "M1A1", _side1] call BIS_fnc_spawnVehicle; sleep 2; _wp1 = _grp2 addWaypoint [getPos wp1, 0]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointSpeed "FULL"; _wp2 = _grp2 addWaypoint [getPos wp2, 0]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "FULL"; _wp3 = _grp2 addWaypoint [getPos wp3, 0]; _wp3 setWaypointType "DISMISS"; _wp3 setWaypointSpeed "FULL"; }; Edited December 19, 2010 by Demonized Share this post Link to post Share on other sites
iwantfun 1 Posted February 19, 2013 Airborne = [getmarkerPos "startRU", east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSquad")] call BIS_fnc_spawnGroup; sleep 16; [] execVM "spawnRU.sqf"; THIS WORKS.......WOOO!!!!!!..........BEFORE THEY WOULD SPAWN, THEN KILL EACH OTHER.....THIS IS THE SCRIPT I HAD BEFORE Airborne = [getmarkerPos "startRU",side player, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSquad")] call BIS_fnc_spawnGroup; sleep 16; [] execVM "spawnRU.sqf"; I WAS A CIVILIAN...... Share this post Link to post Share on other sites
iceman77 18 Posted February 19, 2013 BEFORE THEY WOULD SPAWN, THEN KILL EACH OTHER ... I WAS A CIVILIAN ... Sounds like normal civilians to me :D Share this post Link to post Share on other sites
jakkob4682 23 Posted February 19, 2013 haha i made the same mistake trying to create an ambush group in my ied script and was like FRIENDLY FIRE WTF Share this post Link to post Share on other sites