Home   Help Search Login Register  

Author Topic: Ejecting out of chopper when helo reaches a certain altitude  (Read 522 times)

0 Members and 2 Guests are viewing this topic.

Hit_Sqd_Zulu

  • Guest
Hi there.

Im new to this scripting snippets and stuff. What im looking for is a trigger that will not let my troops eject until they are 2 meters from the ground. Any help would be greatly appreciated.
                                                                           
                                                                                      Thx

MadDogX

  • Guest
Re:Ejecting out of chopper when helo reaches a certain altitude
« Reply #1 on: 03 Mar 2003, 12:50:47 »
CODE:

#LoopMark

_height = getPos heliName select 2
? (_height > 2): goto "LoopMark"

unitName action ["eject", heliName]

END CODE

Hit_Sqd_Zulu

  • Guest
Re:Ejecting out of chopper when helo reaches a certain altitude
« Reply #2 on: 03 Mar 2003, 17:58:23 »
Thx Maddog.

I should have been clearer. Im looking for a condition to activate the trigger
when the chopper is at or below 2 meters it makes the trigger active ...I have the trigger eject all set up. I just need the condition plz ...thx for the help.  Sorry I didnt make my self clearer before ...Im new

                                                                                                   Thx

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Ejecting out of chopper when helo reaches a certain altitude
« Reply #3 on: 04 Mar 2003, 08:31:34 »
Hi Hit_sqd_Zulu,
nice to see a new face :)

Try this script I made in a map for you to put into the editor and play with.

All men onboard chopper (regardless AI or human) jump out at around 2 - 3 m in height. The chopper doesnt land just hovers there untill all dudes are out.

Its activated in a waypoint. Very simple to install into a map.

It requires no triggers. No markers etc. ;D

Chopper then flies away and lands. I take it thats what u were after?

If u want human players to not be able to eject of their own accord at a higher altitude  then thats another story ;)

Actually Im glad u asked this cause I may now take some of this setvelocity code and try to make a better rappel script too ;D

Quote
   _grp = _this select 0
   _helo = _this select 1
   _man = leader _grp
   _aunits = units _grp
   _I = 0
   _J = count _aunits

#land
   _helo flyinheight 4
   commandstop _helo
#chopland

   _height = getpos _helo select 2
   ? _height < 5: goto "speed_check"
   ~0.1
   goto "chopland"

#speed_check
_xvel = velocity _helo select 0
_yvel = velocity _helo select 1
_zvel = velocity _helo select 2

?_xvel > 2: _helo setvelocity [_xvel - 0.1,_yvel,_zvel]
?_yvel > 2: _helo setvelocity [_xvel,_yvel - 0.1,_zvel]
?_xvel < -2: _helo setvelocity [_xvel + 0.1,_yvel,_zvel]
?_yvel < -2: _helo setvelocity [_xvel,_yvel + 0.1,_zvel]
? _xvel > -2 and _xvel < 2 and _yvel > -2 and _yvel < 2 :goto "start"

~0.01
goto "speed_check"

#Start
   _man = (_aunits select _I)
   _man action ["getout",_helo]
   unAssignVehicle _man
   _I = _I + 1
   ~1
   ?_J>_I : goto"Start"
   ~1
   ?_I==_J : goto"next"
#next
   _helo commandmove (getpos _helo)
   _helo flyinheight 100



exit

Zay out

« Last Edit: 04 Mar 2003, 08:37:39 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Hit_Sqd_Zulu

  • Guest
Re:Ejecting out of chopper when helo reaches a certain altitude
« Reply #4 on: 04 Mar 2003, 17:22:52 »
Thx Zay but i dont want to use a script. I just need to know what to put in the condition fields to make it so that the trigger doesn't become active until the chopper is at 2 meters or less. I have everything else worked out. Im trying to use the least amout of scripts as possible.  ;D

wi77ard

  • Guest
Re:Ejecting out of chopper when helo reaches a certain altitude
« Reply #5 on: 04 Mar 2003, 18:25:15 »
try putting two triggers:

triggger:
condition : ready
activaion: unitName action ["eject", heliName]

trigger2:
condition: _height = getPos heliName select 2
? (_height > 2)
activation: ready =true

that should work, i think

wi77ard

Hit_Sqd_Zulu

  • Guest
Re:Ejecting out of chopper when helo reaches a certain altitude
« Reply #6 on: 04 Mar 2003, 20:05:41 »
I tried your suggestion Wi77ard. It kept giving me errors (unknown operator ) right before the ?. I am trying to learn scripting language ...but im a slow learner ..sorry