Home   Help Search Login Register  

Author Topic: scripting units to parachute  (Read 552 times)

0 Members and 1 Guest are viewing this topic.

GrpCapt

  • Guest
scripting units to parachute
« on: 31 Aug 2003, 17:14:21 »
I have been using the BIB UK Paratroopers addon ,which was great ,but they unfortunately suffer from muzzle flash on version 1.90. I am now using the BAS Delta Rangers addon and was hoping someone could tell me a really easy way of getting them to use parachutes ( the BIB addon were classed as air units and automatically used parachutes when set to flying) if there is an easy way and some one could tell me it I would be gratefull as I cant understand the advice in the scripting area and cant make it work.
                     Thanks for any help.

Drozdov

  • Guest
Re:scripting units to parachute
« Reply #1 on: 31 Aug 2003, 19:51:19 »
Here's the script that I use. Taken from Johan Gustafsson's Scripting guide... I may have changed it a bit but I don't think so. You don't have to understand what it's doing to use it. I don't really...  ;)

Quote
_Egrp = _this select 0
_Object = _this select 1
_freq = _this select 2
_Who = _this select 3

_GrpVektor = Units _Egrp
_numEl = count _GrpVektor
_i = 0

? (_Who == "PLAYER") : Player action["EJECT",_Object]; UnassignVehicle Player; exit

#Update
? (_Who == "AI") && ((_GrpVektor select _i) == Player) : _i = _i + 1
? (_i == _numEl) : exit
(_GrpVektor select _i) action["EJECT",_Object]; UnassignVehicle (_GrpVektor select _i)
_i = _i + 1
~_freq
? (_i < _numEl) : goto "Update"
exit

Paste this into a blank notepad document file, then save it as "eject.sqs". Place it in the drawer of the mission in which you will use it. When running it, type this in a trigger activation field:
[name of group to eject, vehicle to eject from, time space between ejections, who will be ejected] exec "eject.sqs"

I find that the time space between ejections must be at least 1.2 (seconds) to avoid the parachuters crashing into each other. Anything under 1 second will result in half the squad dying before they hit the turf. The last argument (who will be ejected) can be one of three things - "AI", "ALL" or "PLAYER". All means that everyone in the group will be ejected, AI means that everyone but the player will be ejected and player means that only the player will be ejected. It's simple really.

Thanks to Johan for this script, it works a treat  :). Download his Scripting Tutorial, it's easy to understand and really helps you to enhance missions. Scripting is easier than you think.

GrpCapt

  • Guest
Re:scripting units to parachute
« Reply #2 on: 01 Sep 2003, 19:23:04 »
Is there really no easy way i.e moveincargo commands.There are a number of empty parachutes as well as the east/west ones wich already have a unit attached, can thy not be used somehow?

Drozdov

  • Guest
Re:scripting units to parachute
« Reply #3 on: 01 Sep 2003, 20:08:34 »
Ah, I understand now. Thought you wanted them to eject from a helicopter or something. Oh well. I assume you can use the empty parachutes (otherwise, why the hell would they be there?) but really it's up to you to test this out. Try this moveindriver parachutename in a unit's init line. Or moveincargo.

GrpCapt

  • Guest
Re:scripting units to parachute
« Reply #4 on: 01 Sep 2003, 21:31:39 »
Excellent. Thanks Drozdov the moveindriver is the one with an empty chute and both units flying.

Drozdov

  • Guest
Re:scripting units to parachute
« Reply #5 on: 01 Sep 2003, 21:54:51 »
I live to serve *bows*.

:toocool: