Milkman 1 Posted January 3, 2003 i am having a problem with an ejection script that makes everyone in the cargo hold bail out when the aircraft reaches one of its waypoints. It works fine when your the leader of your squad and when you are the only squad but if the AI is incharge of a squad he makes everyone get back in the helicopter when you touch the ground. Somone else asked this question on Ofpec.com and SnYper gave him an answer that i dont understand. SnYper said this: rancor_man67  December 04, 2002, 1300  It works well, but a few seconds after the troops touch the ground, the commander orders them to rebord the chopper? How can i fix this?? snYpir  December 04, 2002, 2106  you need to use the following command at the end of the script: unassignVehicle unitname the best way to do it is as follows: if the name of the group getting out is 'mygroup', use: "unassignVehicle _x" foreach units mygroup at the end of the script I tried what he said but it dosnt help. Can somone help me?? Share this post Link to post Share on other sites
ralphwiggum 6 Posted January 3, 2003 welcome to world of scripting </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"unassignVehicle _x" foreach units mygroup<span id='postcolor'> the term that is important is 'foreach' what this command will do is given some condition, it'll execute it on some array. so codition foreach array here, "unassignvehicle _x" is condition. "units mygroup" is the array of units in the group. so what this command will do is that for everyone in the array(which consists of soldiers in 'mygroup' it'll execute command "unassignvehicle _x" on each of the soldiers. in your case, place the </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"unassignVehicle _x" foreach units mygroup<span id='postcolor'> at the end of the script you got, just before 'exit' at the very end. 'mygroup' should be replaced with whatever the name you use for group. Share this post Link to post Share on other sites
Milkman 1 Posted January 3, 2003 okay so i should have: [Mygrp,heli1] exec "groupeject.sqs"; "unassignVehicle_x" foreach units mygrp mygrp being the group heli1 being the vehicle Share this post Link to post Share on other sites
ralphwiggum 6 Posted January 3, 2003 give it a shot. looks fine to me. Share this post Link to post Share on other sites
Milkman 1 Posted January 3, 2003 negative, the squad commander tells everyone to disembark and as soon as everyone is on the ground he goes "2, board UH60" "3, Board UH60" and so on Share this post Link to post Share on other sites
ralphwiggum 6 Posted January 3, 2003 ok, open the script file with notepad and copy the contents here. let me take a look at it. or look for parachute script here. Share this post Link to post Share on other sites
Milkman 1 Posted January 3, 2003 ; Script Name : groupeject.sqs ; Script Author : Lusty Pooh OFP Editing Center http://ofpediting.com ; Script Description : ; Â Â This script will cause all of the units in a specified group to eject from a ; specified vehicle (helicopter). Before using this make sure that the group is ; already in the vehicle ; ; Script Invokation : ; Â Â To execute this script you use the following format : ; Â Â Â Â [groupid,vehicleid] exec "groupeject.sqs" ; ; Â Â where : ; Â Â Â Â Â groupid : This is the id of the group that you get when you do a group this in one ; Â Â Â Â Â of the group's vehicle Initialization fields. ; Â Â Â Â Â vehiclename is the value of the name field (including quotes) for vehicle you want ; Â Â Â Â Â to have the group eject from ; ; Example : ; Â Â Â [mygroup,heli1] exec "groupeject.sqs" ; Get the script arguments from the _this variable _grp = _this select 0 _vehicle = _this select 1 _aunits = units _grp _i = 0 _j = count _aunits #Here (_aunits select _i) action ["EJECT",_vehicle] _i=_i+1 ~1 ?_j>_i:goto "Here" exit Share this post Link to post Share on other sites
ralphwiggum 6 Posted January 3, 2003 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">; Script Name : groupeject.sqs ; Script Author : Lusty Pooh OFP Editing Center http://ofpediting.com ; Script Description : ; This script will cause all of the units in a specified group to eject from a ; specified vehicle (helicopter). Before using this make sure that the group is ; already in the vehicle ; ; Script Invokation : ; To execute this script you use the following format : ; [groupid,vehicleid] exec "groupeject.sqs" ; ; where : ; groupid : This is the id of the group that you get when you do a group this in one ; of the group's vehicle Initialization fields. ; vehiclename is the value of the name field (including quotes) for vehicle you want ; to have the group eject from ; ; Example : ; [mygroup,heli1] exec "groupeject.sqs" ; Get the script arguments from the _this variable _grp = _this select 0 _vehicle = _this select 1 _aunits = units _grp _i = 0 _j = count _aunits #Here (_aunits select _i) action ["EJECT",_vehicle] unassignvehicle (_aunits select _i) _i=_i+1 ~1 ?_j>_i:goto "Here" exit <span id='postcolor'> use this. if you searched this forum, you wouldn't go through this mess there was a script like this before. Share this post Link to post Share on other sites
ralphwiggum 6 Posted January 3, 2003 could you post if my rendition worked? edit: well it did for me Share this post Link to post Share on other sites
philcommando 0 Posted January 3, 2003 erm...........i put this up before, so here we go again, lol!.... When i first paradrop, i used an old script which made the team jump but after that the team just run after the chopper. Tks to folks here i realized i dont need a script, just add in few lines of code in the soldier's initiation and waypoint/trigger code activation will do the job. I hope u could find the codes, its just :- AI leader named - man AI chopper named - heli1 Waypoint:- cmd = "EJECT"; "_x action [cmd, heli1]" foreach units man; "unassignVehicle _x" foreach units man. Play around with the height, speed of chopper, waypoints so that your jumpers wont collide with one another, but careful of the heli FlyinHeight code, cos sometimes the chopper might just circle around your team and not move to next waypoint. If u want the team upon touching the ground to move to a waypoint, try to place the team at the dropsite during mission editor mode and then set your waypoints. Then when the mission start, with the leader's init: "_x moveincargo heli1" foreach units man; your team will load up elsewhere and land on the dropsite and follow yer code to the waypoint Lets use your script talents and efforts on other projects Share this post Link to post Share on other sites
Milkman 1 Posted January 4, 2003 oh, sorry ralph, yes it did work just fine. Thanks alot dude!! Share this post Link to post Share on other sites
ralphwiggum 6 Posted January 4, 2003 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Sgt. Milkman @ Jan. 04 2003,18:18)</td></tr><tr><td id="QUOTE">oh, sorry ralph, yes it did work just fine. Thanks alot dude!! <span id='postcolor'> no problem. glad to help Share this post Link to post Share on other sites