Home   Help Search Login Register  

Author Topic: Exec 'tailrotor.sqs' AFTER Being Hit  (Read 421 times)

0 Members and 2 Guests are viewing this topic.

JohnJoeJim

  • Guest
Exec 'tailrotor.sqs' AFTER Being Hit
« on: 13 Apr 2004, 13:56:39 »
I was just wondering how to do this, cos it's a bit unrealistic if the chopper just suddenly spins out of control and smoke and all.I want it to happen after it's been hit by a RPG, AA, or weapon like that.Don't worry, it's not one of them BHD missions;) I treid messing around with scripts.
 
@UnitReady _AimHeli
_Object fire ["Shoot", "AA"]
_numAA = _numAA - 1
? (_numAA > 0) :
[Heli, 4(Random Kills), 6(Max Kills>] exec "effects\tailrotor.sqs"

That's only a script to show you what I want to do, and I'm only new to this :P In Brackets are what the no's are for. Help appreciated  8)

DBR_ONIX

  • Guest
Re:Exec 'tailrotor.sqs' AFTER Being Hit
« Reply #1 on: 13 Apr 2004, 14:15:52 »
Hmm.. I'm not overly sure about this...
What about adding an fired eventhandler to the RPG guys, and a hit eventhandlers to the helo.
But they have to be within, that, 5seconds of each other.
And if they are, it runs the script..

It isn't very good, but it should work
But if the helo is hit with small arms fire in those 5seconds, it will go down... ::)

What about using the camera bullet scripts, the but that follows the bullet, and if it is destroyed at the same rough postion (IE is is blowen up on it), it runs the script..

Or..... If the helos dammage is over 0.5( ? ), it runs the script..
You will have to experiment with the values, but when a RPG hits, it will cause a lot more dammage than a bullet.. And if the helo gets shot up so much it gets over 0.5. The tail rotar will "be hit".. Which isn't too good..

There must be a way of finding out what shell hit a unit....?
Good luck :)
- Ben

m21man

  • Guest
Re:Exec 'tailrotor.sqs' AFTER Being Hit
« Reply #2 on: 13 Apr 2004, 15:22:34 »
Quote
"hit" (men or vehicles) :
_this select 0 : who's hit (can be either a man or a vehicle) ;
_this select 1 : who did (h)it ;
_this select 2 : scalar damage value.

So, if you add the event handler to your Blackhawk:
Code: [Select]
_guy = _this select 1
?(typeof _guy == "basrpgsoldier"): goto "spin"
exit
#spin
« Last Edit: 13 Apr 2004, 15:23:56 by m21man »

JohnJoeJim

  • Guest
Re:Exec 'tailrotor.sqs' AFTER Being Hit
« Reply #3 on: 13 Apr 2004, 22:11:42 »
I'll try em now. I tried to get it to work using : getDammage Heli <= 0.5; [Heli, 4, 6] exec "effects\tailrotor.sqs"
 But it kept either saying unknown operater,, invalid number expression, or Type Any, object expected.
But as I said, I'll try those 2 ways now...