Jump to content
Sign in to follow this  
Milkman

Paradrop script

Recommended Posts

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?confused.gif 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??

sad.gif

Share this post


Link to post
Share on other sites

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'wink.gif 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

okay so i should have:

[Mygrp,heli1] exec "groupeject.sqs"; "unassignVehicle_x" foreach units mygrp

confused.gif

mygrp being the group

heli1 being the vehicle

Share this post


Link to post
Share on other sites

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 sad.gif

Share this post


Link to post
Share on other sites

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

; 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 smile.gif

;

; 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

</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 wink.gif there was a script like this before.

Share this post


Link to post
Share on other sites

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 wink.gif

Share this post


Link to post
Share on other sites

oh, sorry ralph, yes it did work just fine. Thanks alot dude!! smile.gif

Share this post


Link to post
Share on other sites

</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!! smile.gif<span id='postcolor'>

no problem. glad to help smile.gif

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  

×