Printable Version of Topic

Click here to view this topic in its original format

Armed Assault Info Forums _ Mission Editing & Scripting _ Helo Pickup

Posted by: Red Star Elite Oct 24 2011, 23:54

Hey guys

Can anyone tell me if there is a command or script that makes a transport helo wait until a selected squad/platoon embark it, then lift off and proceed to the desired drop zone?

Thanks to anyone who can help thumbsup.gif

Posted by: D@V£ Oct 25 2011, 10:02

Helicopters land automatically if a get in command is issued. If you're using waypoints, just synchronize the squads "get in" waypoint with the helicopters "move" waypoint at the pick up zone. You can add this code:

CODE
{_x assignascargo Heli} foreach units group this

to any member of the group (either on init, or at an earlier waypoint) in order to ensure they get in the helicopter, and not a nearby tractor when dealing with AI led groups, if you're dealing with player led group, you might have better luck changing the condition for the helicopters move waypoint to this:
CODE
vehicle player = heli

to ensure the helicopter doesn't fly off before the player can command his team to get in. (obviously where heli is the name you've given your helicopter in the editor!)

If you're going down a more script-y route, try something like this: (nb, you'll need to work out the synchronization yourself - probably easiest to split it into three scripts, the script to get the helicopter to the pick-up point, triggered by the group being there, one to get them picked up, triggered by the helicopter being there, and one to move them on, triggered by the group being aboard the helicopter)
CODE
Heligroup = group HeligroupLeader; //If you've already defined the group as part of another script, you should remove this line and replace all references to heligroup to the correct name for the group

(driver Heli) commandmove (getpos (leader HeligroupLeader));
{_x assignascargo Heli} foreach Heligroup;

//Wait until helicopter is near heligroup

(units heligroup) ordergetin True;

//Wait until Vehicle (leader heligroup) = Heli

(driver Heli) commandmove (getpos LZ);

//Wait until Heli is near LZ

(units heligroup) ordergetin False;

Posted by: Red Star Elite Oct 27 2011, 19:33

Right okay, thanks for that thumbsup.gif

Something else actually... How do you use the attachTo command? So in other words I want to have a soldier who doesn't wear a burgen or backpack, have one. If that's possible?

Posted by: D@V£ Oct 27 2011, 20:26

Attachto isn't very good for that sort of thing, IIRC it only works relative to the soldiers location, so it won't take into account any animations they'd be playing (so if you were to attach it so it's about where a backpack would be, if your solder where to start crawling, the backpack would just be floating in the air). You can attachto a memory point, but I'm not sure if that'll get the desired effect...

But I digress:

CODE
Object attachTo [TObject, Offset, MemPoint]

Or more commonly just:
CODE
Object attachTo [TObject, Offset]


So, something like:
CODE
Box attachto [Pickup, [0,0,0], "flatbed"]

Or:
CODE
Soldier attachto [Cow,[0,0,0.25]]

(Cow Cavalry! Of course, you can't control the cow, but you can't do that if you're riding a cow in real life, so it's realistic!)

If you're curious about the syntax of command, it's better to check on BIKI before posting on the forums, you won't need to wait until someone answers that way! tongue.gif
http://community.bistudio.com/wiki/Category:Scripting_Commands_Arma2

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)