Home   Help Search Login Register  

Author Topic: Damaged chopper Helidrop before trigger  (Read 1866 times)

0 Members and 2 Guests are viewing this topic.

Mr.BoDean

  • Guest
Damaged chopper Helidrop before trigger
« on: 14 Jun 2003, 05:15:16 »
I'm using David Berka's Cargo Helidrop script in a mission. I want to add in a trigger where the heli would drop its cargo before its intended drop zone if it becomes heavily damaged, so that the cargo can still be saved.


;Here's the script:

; script by David Berka (David.Berka@nmi.at)

_heli = _this select 0
_car = _this select 1
_chute = _this select 2


#Update

_heliPos = getPos _heli
_heliPosX = _heliPos select 0
_heliPosY = _heliPos select 1
_heliPosZ = _heliPos select 2

_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2

_chute setPos [_chutePosX, _chutePosY, 300]
_car setPos [_heliPosX, _heliPosY, _heliPosZ - 5]
_heading = getDir _heli
_car setDir _heading
~0.01
?(release1 == 1) : goto "Drop"
goto "Update"


#Drop
_chute setDir _heading

~0.01

_carPos = getPos _car
_carPosX = _carPos select 0
_carPosY = _carPos select 1
_carPosZ = _carPos select 2

_chute setPos [_carPosX, _carPosY, _heliPosZ - 18]

#DropUpdate

_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2

_car setPos [_chutePosX, _chutePosY, _chutePosZ - 3]
~0.01
? (_chutePosZ > 3) : goto "DropUpdate"

;(By the way, I altered this line (from 3 to 5) to give more
;clearance to vehicles under heli ):

 _car setPos [_heliPosX, _heliPosY, _heliPosZ - 5]

============================================
The line release1 == 1 is placed
in a vehicle-switched trigger for the normal drop area. So how would I incorporate a getdammage-type script checking for >=30% damage to heli and have it drop its cargo right there?  Would it just be a separate trigger or does it need to be in same or different script?
   Thanks!  ;)
« Last Edit: 14 Jun 2003, 05:16:45 by Mr.BoDean »

Kaliyuga

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #1 on: 14 Jun 2003, 05:20:24 »
well If I'm reading you right... the code used to signal the chopper to drop is: release1 == 1


so you could make a trigger  size 0x0  and put this on its condition field:

nameofheli getdammage > .7

activation: release1 == 1

that should work for you causing the helicopter to drop whenever it's 70% or more damaged.

Mr.BoDean

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #2 on: 14 Jun 2003, 05:42:46 »
well If I'm reading you right... the code used to signal the chopper to drop is: release1 == 1


so you could make a trigger  size 0x0  and put this on its condition field:

nameofheli getdammage > .7

activation: release1 == 1

that should work for you causing the helicopter to drop whenever it's 70% or more damaged.


Great!  SO it wouldn't matter where the trigger was placed, obviously ? And it would be a Switch type with NONE in the "activated by" box, yes?

Thanx for clearing that up!  :D

Kaliyuga

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #3 on: 14 Jun 2003, 05:57:50 »
 yep ..  as soon as the condition is met.. the activation happens anywhere on the map..

you can use a few commands in the condition line for nice effects...

i like to use the distance command as well..

and some peoples I know like to use the getdammage command like you're doing to detect when an ammo truck or fuel station is damaged slightly there is a huge fireworks show.. :o  


Mr.BoDean

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #4 on: 14 Jun 2003, 06:04:00 »
Cool, Kali  . ..but WAIT! I'm getting an "Unknown Operator" error for both the GetDammage and GetDamagecommand. Is that only good for Resistance?  :(  'Cuz I know I've used SetDammage before.   ???   Or is it just a syntax thingy?

Mr.BoDean

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #5 on: 14 Jun 2003, 06:07:48 »
BTW, am I right in thinking that once you install Resistance and create a mission in the editor , even if you only use items from 1.46 , it will still only be playable by people with Resistance?   :-[    ???

Ball Zack

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #6 on: 14 Jun 2003, 06:52:51 »
I think you can modify the begining of the "mission.sqm" file by removing the resistance addon components.  Note the use of the phrase "I think".  Please back up your mission before attempting this.

Kaliyuga

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #7 on: 14 Jun 2003, 19:46:58 »
my bad.. the syntax was wrong...

should be:

getdammage nameofheli > .7

  :P :-\
« Last Edit: 14 Jun 2003, 19:48:07 by Kaliyuga »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Damaged chopper Helidrop before trigger
« Reply #8 on: 14 Jun 2003, 20:23:55 »
didnt he say he want da dammage b more dan .3 ?

Quote
incorporate a getdammage-type script checking for >=30% damage to heli and have it drop its cargo right there

so it shud b

getdammage nameofheli >= .3

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gameer_77

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #9 on: 14 Jun 2003, 20:28:12 »
And it might have to be:

release1= 1

However Res might've changed that or something, it did with 'damage'  :P

Gameer

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Damaged chopper Helidrop before trigger
« Reply #10 on: 14 Jun 2003, 20:31:37 »
no - gameer is right here ;D (im workin on it - but da reinforcments scriptin is takin mor dan i was thinkin  :( also im in da middle of exams - last 2 of em actualy ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gameer_77

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #11 on: 14 Jun 2003, 20:36:52 »
Are you talking to me here, LCD?  ???

If so, it's OK - I'm working on adding atmosphere to Nogova...and the dialog which Kali made a model for. ;) :P

Looks good btw :)

Gameer
« Last Edit: 14 Jun 2003, 20:37:36 by Gameer »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Damaged chopper Helidrop before trigger
« Reply #12 on: 14 Jun 2003, 20:38:30 »
yep was talkin 2 u ;) ;D

wanna c da new dialog btw ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gameer_77

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #13 on: 14 Jun 2003, 20:43:29 »
Lol, you will  ;D

Mr.BoDean

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #14 on: 15 Jun 2003, 07:06:48 »
Hehe . ..Thanx u guys ...I'll try that!   :D

And, yes, Gameer, I did have the
Release1 = 1  in my trigger correctly, just forgot when I was posting this.  ;)

Hey how would you use that distance parameter with the damage one ?  Is it distance from the enemy who targeted it or just enemy or camera or ????
« Last Edit: 15 Jun 2003, 07:15:02 by Mr.BoDean »