Heaney 11 Posted September 16, 2010 Hello I am quite new to Arma 2. I have Combined Operations and BAF. I have a WW2 mod with those D-Day landing craft and I set the waypoint with transport unload in the shallow water, but the people inside don't get out. Presumably he didn't create the getting out system in his mod, but it's an amazing mod so idk. I just want to know, how can I FORCE the AI out of it with scripting on the waypoint. Share this post Link to post Share on other sites
kylania 546 Posted September 16, 2010 aiUnit action["Eject", vehicle aiUnit]; Share this post Link to post Share on other sites
TRexian 0 Posted September 16, 2010 I have a WW2 mod with those D-Day landing craft .... Hrrrmh? :) I'm sorry I don't have a direct answer to your question, but... uh.... where did you get such a mod? :) To at least make an effort to provide an answer, though... did you try making another waypoint beyond the landing zone? They may automatically get out and go to the next wp. Also, look for waypoint "GETOUT." Share this post Link to post Share on other sites
Woodpeckersam 18 Posted September 16, 2010 (edited) Make sure leaders of each group has a name let's say... Group 1 Leader Name: "ld1" Group 2 Leader Name: "ld2" Group 3 Leader Name: "ld3" Then use this code in your script or trigger... {unassignvehicle _x} foreach units group ld1 + group ld2 + group ld3; I think that's the right code. I'm not at my pc ATM so i can't check. Or try this... {unassignvehicle _x} foreach units group (ld1 + ld2 + ld3); Use these codes per group in 1 d day boat thingy... If you only have 1 group in a boat then simply change the code to this.... {unassignvehicle _x} foreach units ld1; ---------- Post added at 08:56 PM ---------- Previous post was at 08:24 PM ---------- Hrrrmh? :)I'm sorry I don't have a direct answer to your question, but... uh.... where did you get such a mod? :) To at least make an effort to provide an answer, though... did you try making another waypoint beyond the landing zone? They may automatically get out and go to the next wp. Also, look for waypoint "GETOUT." I think he means this mod? http://forums.bistudio.com/showthread.php?t=91847 Edited September 16, 2010 by WoodyUK Share this post Link to post Share on other sites
Heaney 11 Posted September 18, 2010 Hrrrmh? :) http://www.ruggedelegantliving.com/a/images/d-day.landing.craft.jpg Like that I'm sorry I don't have a direct answer to your question, but... uh.... where did you get such a mod? :) Oh the mod is this. To at least make an effort to provide an answer, though... did you try making another waypoint beyond the landing zone? They may automatically get out and go to the next wp. Also, look for waypoint "GETOUT." Yes I tried using waypoints in all sorts of ways. ---------- Post added at 05:54 PM ---------- Previous post was at 05:36 PM ---------- Make sure leaders of each group has a name let's say... Group 1 Leader Name: "ld1" Group 2 Leader Name: "ld2" Group 3 Leader Name: "ld3" Then use this code in your script or trigger... {unassignvehicle _x} foreach units group ld1 + group ld2 + group ld3; I think that's the right code. I'm not at my pc ATM so i can't check. Or try this... {unassignvehicle _x} foreach units group (ld1 + ld2 + ld3); Use these codes per group in 1 d day boat thingy... If you only have 1 group in a boat then simply change the code to this.... {unassignvehicle _x} foreach units ld1; Hmm I tried this and now they just go round in circles in the water... can I send you the editor file? Share this post Link to post Share on other sites
twirly 11 Posted September 21, 2010 (edited) Hi....try this....this will eject multiple squads from any vehicle. You can also change the speed at which they get ejeted. Create a script called "veh_eject.sqf" and call it like this from your triggers Init like this:- nul=[[ld1,ld2,ld3],veh] execVM "veh_eject.sqf"; Where :- [ld1,ld2,ld3] ...are your squads and veh is your boat "veh_eject.sqf" private ["_grp","_grps","_veh","_dude", "_i", "_j"]; _grps = _this select 0; _veh = _this select 1; for [{_i=0},{_i<count _grps},{_i=_i+1}] do { _grp = _grps select _i; for [{_j=0},{_j<count units _grp},{_j=_j+1}] do { _dude = units _grp select _j; UnAssignVehicle _dude; _dude action ["EJECT", _veh]; sleep 1 + (random 0.5) }; } Edited September 21, 2010 by twirly Share this post Link to post Share on other sites
kylania 546 Posted September 21, 2010 (edited) Why are you using all those messy looking for loops instead of just using units group? You could replace all of that with one line of code. :) {{unassignVehicle _x; _x action["eject", vehicle _x]; sleep 0.5} forEach units _x} forEach _this; Edited September 21, 2010 by kylania Share this post Link to post Share on other sites
twirly 11 Posted September 21, 2010 Why are you using all those messy looking for loops instead of just using units group? You could replace all of that with one line of code. :) {{unassignVehicle _x; _x action["eject", vehicle _x]; sleep 0.5} forEach units _x} forEach _this; "foreach" will make my machine stutter and croak if used on large arrays....so I always the loops with a sleep in it......then I don't have the problem. I never use foreach unless it's just a tiny array. In fact I only use my own functions if I can. Share this post Link to post Share on other sites
kylania 546 Posted September 21, 2010 Time for a new machine than. Max cargo in a vehicle is 28 units so if your machine is locking up while running through 30 some objects that's a problem. :) Share this post Link to post Share on other sites
twirly 11 Posted September 22, 2010 Time for a new machine than. Max cargo in a vehicle is 28 units so if your machine is locking up while running through 30 some objects that's a problem. :) The machine is fine...I have 3 computers here over 3.0 Ghtz! Two quads and a Dual core. The funny thing is the dual core runs the game best! My prefernce is to use my coding and not BIS's.....it's just a personal preference that's all. I learn more this way. Haven't tried....but can you add a sleep to a foreach?...so that you can eject one troop every 2 seconds if you wanted too? That would be a good reason to use a loop.....which a "foreach" is anyway!. In fact I'll bet the foreach uses the exact same loop. It's just coded into a function called "foreach"!! Share this post Link to post Share on other sites
AZCoder 676 Posted September 22, 2010 The "foreach" is a very useful command that lets you dispense with arrays and operate against one object at a time. Personally I prefer it when dealing with a collection of objects, but I will use loops in other instances. You should of course use whatever you like best :) Kylania's example does have a sleep 0.5 inside the "foreach", so you could change that to 2 if you wanted a longer delay. Share this post Link to post Share on other sites
twirly 11 Posted September 22, 2010 Kylania's example does have a sleep 0.5 inside the "foreach", so you could change that to 2 if you wanted a longer delay. Thanks AZ & kylania. Guess I did not see the sleep in there. My bad. I guess I will use it ...as it is a one liner and nice. Share this post Link to post Share on other sites