Home   Help Search Login Register  

Author Topic: recieving fire  (Read 586 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
recieving fire
« on: 05 Feb 2005, 12:13:23 »
how can i tell if a helicopter is under attack by enemy infantry like after about 10 bullets has hit the chopper a script is called with them saying there under attack i can do the script bit but not the other

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:recieving fire
« Reply #1 on: 05 Feb 2005, 13:04:02 »
i believe your answer lies in the event handler for 'hit'; check the comref for event handlers and see the tutorial boards for how to use them, as i have little experience with this, but i know that's how it's done.

cheers ;)

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:recieving fire
« Reply #2 on: 05 Feb 2005, 13:04:37 »
Add an eventhandler "hit" to the chopper. This function detects when a unit is taking hits from weapons.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline 456820

  • Contributing Member
  • **
Re:recieving fire
« Reply #3 on: 05 Feb 2005, 13:30:54 »
ok thanks looking in the com ref now

Offline 456820

  • Contributing Member
  • **
Re:recieving fire
« Reply #4 on: 05 Feb 2005, 13:53:20 »
right slight problem ive looked up event handlers and it says to use
chopper AddEventHandler ["hit", {[mysquad] exec "paradrop.sqs"}]
that wasnt exactly wat i needed so i changed it to this

heli1 AddEventHandler ["hit", [] exec "3.sqs"}]
in script 3 i placed this
 
"heli1 sidechat "THIS IS NOVEMBER 1 WERE TAKING FIRE."
~6
heli1 setdamage 0.5
~3
[heli1,false,0] exec "tailrotor.sqs"
~2
heli1 sidechat "THIS IS NOVEMBER 1 WERE GOING DOWN MADAY MADAY WERE GOING DOW...."

but what happens is when the mission starts says something like "thiss adevent handler" expected string"
then the script 3 plays when i dont whan it to the chopper is linked to a trigger wich has
vechile detecteb by east
condition - this
activation- left blank

im sure that it should work but it doesnt does anyone know why

Offline 456820

  • Contributing Member
  • **
Re:recieving fire
« Reply #5 on: 05 Feb 2005, 14:27:39 »
right now ive found out that eventhandler hit doesnt worj on choppers so im stuck unless theres a way of detecting if the vechile damage is less than 1 then executes the scipt but would the chopper lose damage if shot once if not how many shots would it take

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:recieving fire
« Reply #6 on: 05 Feb 2005, 14:43:48 »
When you get an error message post it exactly, including the #.     Sounds like you may have a made small error in writing out the code.

You could just use a trigger:

Condition:   getDammage chopper1 > 0.3
On Activaiton:   [] exec "3.sqs"

Syntax not guaranteed.   You'll have to experiment to find the right dammage amount.
Plenty of reviewed ArmA missions for you to play

Offline 456820

  • Contributing Member
  • **
Re:recieving fire
« Reply #7 on: 05 Feb 2005, 15:04:04 »
oh ok thanks i will try that and see if it works