Home   Help Search Login Register  

Author Topic: Chopper detecting smoke...  (Read 913 times)

0 Members and 1 Guest are viewing this topic.

xCIA_BlackThorn

  • Guest
Chopper detecting smoke...
« on: 19 May 2005, 21:51:14 »
Now I know this has been answerd before, but I just cant seem to find it.

Yes, I would like my chopper to patrol an area 'looking' and waiting for me to throw the smoke so he can land.

Any ideas..?

Thanks.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Chopper detecting smoke...
« Reply #1 on: 19 May 2005, 23:10:50 »
Add an eventHandler "fired" to the player.
Plenty of reviewed ArmA missions for you to play

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Chopper detecting smoke...
« Reply #2 on: 19 May 2005, 23:11:44 »
an event handler is what you need, along with a trigger over the area you want the chopper to 'see' your smoke in...

first the eventhandler -

put this in the init line of the loon you want to be throwing the smoke:

Code: [Select]
this AddEventHandler ["fired",{_this exec "onfiring.sqs"}]

then open up notepad and copy/paste the following:

Code: [Select]
;detect if smoke is thrown

?not in_area:exit

_how = _this select 2
_what = _this select 4

?_how=="throw" and _what=="smokeshell":goto "helicopter"

exit


#helicopter

hint "Chopper's on its way"

;additional code here...

exit


save that as "onfiring.sqs" - thanks to Gizmo and SFG for their input ;)

you'll notice the 'in_area' at the top. that's a global variable, which we need for the trigger.

create the trigger, big enough to cover the area which your chopper will be searching. make it trigger on west present (or alternatively group it to the loon to be throwing the smoke), and in the 'on activation' field, paste the following:

Code: [Select]
in_area = true
in the 'on deactivation' field, paste this:

Code: [Select]
in_area = false
now you have an evac area sensitive to smoke shells.

missionette attached.
« Last Edit: 19 May 2005, 23:12:58 by bedges »

xCIA_BlackThorn

  • Guest
Re:Chopper detecting smoke...
« Reply #3 on: 20 May 2005, 02:03:01 »
Wow, Thanks for the fast respawn. And it works well. Thanks Guys.