Home   Help Search Login Register  

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

0 Members and 1 Guest 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 »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Damaged chopper Helidrop before trigger
« Reply #15 on: 15 Jun 2003, 11:33:32 »
Quote
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 ?

???

wat do u want here ?

use da distance nd da dammage 2 check ?

in da coindition

getdammage nameofheli >= .3 and "_X distance  nameofheli < 100" count enemies > 0

enemies is array of all enemy units
u can change da 100 2 da distance u want ;D

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

Mr.BoDean

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #16 on: 16 Jun 2003, 09:03:35 »
ok, cool  :) , but can you tell me the purpose of having these two parameters as conditions?

i.e.  Are you saying that you'd want to check how many enemies and how far away they are  so that .....what? So that your chopper gets more damage from more  and closer enemies......or that its' being damaged a certain distance away would then dictate it to retreat to a safe LZ or crash near the baddies or?  I mean, HOW would one use these features?  :-\  

Kaliyuga

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #17 on: 16 Jun 2003, 10:03:36 »
 thats my fault for throwing that distance command out there...  

I was just using it as a general example.. not really in relation to your problem specifically ..

It's just a different condition you could use to set off  a trigger if you wanted...

like for instance if you wanted to create a mine that will work against a 5t truck...  you could place a regular mine from the editor.....  name it M

name your 5t truck T

make a trigger looks somethin like this:


condition:   T distance M < .5
activation:  bomb1="HEAT120" camcreate getpos M

so when the truck is less than .5 meters from the mine.. a HEAT shell is created at the mine .. and your 5t truck is cleared for take off.. lol

anyways..  I don't think it's really neccesary for solving your problem but just wanted to clear up the distance thing since I brought it up
:cheers:

Mr.BoDean

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #18 on: 16 Jun 2003, 12:36:09 »
thats my fault for throwing that distance command out there...  

I was just using it as a general example.. not really in relation to your problem specifically ..

It's just a different condition you could use to set off  a trigger if you wanted...

like for instance if you wanted to create a mine that will work against a 5t truck...  you could place a regular mine from the editor.....  name it M

name your 5t truck T

make a trigger looks somethin like this:


condition:   T distance M < .5
activation:  bomb1="HEAT120" camcreate getpos M

so when the truck is less than .5 meters from the mine.. a HEAT shell is created at the mine .. and your 5t truck is cleared for take off.. lol

anyways..  I don't think it's really neccesary for solving your problem but just wanted to clear up the distance thing since I brought it up
:cheers:

Thanks, Kali.  :)  So would your example be primarily for a cutscene or just to ensure some damage in case the driver manages to skirt the actual mine?

Mr.BoDean

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #19 on: 16 Jun 2003, 12:37:46 »
BTW, once again you guys helped me with something that does exactly what I wanted it to do!! Muchas thankus!  :D

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Damaged chopper Helidrop before trigger
« Reply #20 on: 16 Jun 2003, 14:05:34 »
Quote
BTW, once again you guys helped me with something that does exactly what I wanted it to do!! Muchas thankus!

so proby solvy ?  ::) ;D

solve boton is down || dere somwere
                                 V

LCD OUT
« Last Edit: 16 Jun 2003, 14:06:23 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Mr.BoDean

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #21 on: 16 Jun 2003, 14:36:59 »
so proby solvy ?  ::) ;D

solve boton is down || dere somwere
                                 V

LCD OUT

LOL, LCD   :tomato: But when I solve it, it's locked, right? Which means peeps can't add comments, so I like to leave open for a bit. Are you on a solve-it Quota ?  :-X Besides, I still had another question:  ;)

Quote
Thanks, Kali.   :)  So would your example be primarily for a cutscene or just to ensure some damage in case the driver manages to skirt the actual mine?



Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Damaged chopper Helidrop before trigger
« Reply #22 on: 16 Jun 2003, 14:50:13 »
his example wil make da mine work - cuz mines dont work realy on nythin xept da tanks ;)

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

Mr.BoDean

  • Guest
Re:Damaged chopper Helidrop before trigger
« Reply #23 on: 16 Jun 2003, 22:17:52 »
Ok, gotcha , thanks!  :thumbsup:  

And just for you, LCD ...Proby Solvey ...  ;)