Home   Help Search Login Register  

Author Topic: Set dammage  (Read 1237 times)

0 Members and 1 Guest are viewing this topic.

Offline Thomas G Vorm

  • Members
  • *
Set dammage
« on: 12 Nov 2007, 21:41:14 »
I'm making a mission where you have to take out enemy AAA in order to call in an airstrike on a base. The problem I'm having is that you really don't have to, the plane will drop it's bombs even while taking damage from AAA.

So, I need a trigger that detects whether or not the plane has any damage, and if it does then set that damage to 1. This way, as soon as the plane gets hit by AAA it goes down. Should be pretty easy, I just don't know what to put in the condition field. Something like - plane1 damage > 0 ?

Any help would be great

Python1

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Set dammage
« Reply #1 on: 12 Nov 2007, 21:43:35 »
Trigger Conditon: ((getdammage plane1) > 0.05)
Trigger Activation: plane1 setdammage 1

You wasn't that far off ;)

If however, you don't want it to blow up straight away, but simply just go down, then maybe change the activation to: plane1 setfuel 0

This will bring it down as the engines will shut off, and if I remember correctly the AI will eject as long as it has time before it is actually shot down.
« Last Edit: 12 Nov 2007, 21:45:33 by JasonO »

Offline Thomas G Vorm

  • Members
  • *
Re: Set dammage
« Reply #2 on: 12 Nov 2007, 22:28:47 »
Great That's exactly what I needed thanks.

Python1

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Set dammage
« Reply #3 on: 12 Nov 2007, 23:42:43 »
Just may also just eject the crew as soon as minimal damage is detected.

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: Set dammage
« Reply #4 on: 13 Nov 2007, 23:01:28 »
easiest solution:

plane addeventhandler ["hit", {this setdamage 1}];

in the init file.
Campaigns are hard, I'll stick with scripting for now!

Offline Thomas G Vorm

  • Members
  • *
Re: Set dammage
« Reply #5 on: 14 Nov 2007, 11:13:37 »
All of these work great, now the player really will have to take out the AAA before calling support, thanks everyone.

Python1