OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: xCIA_BlackThorn 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.
-
Add an eventHandler "fired" to the player.
-
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:
this AddEventHandler ["fired",{_this exec "onfiring.sqs"}]
then open up notepad and copy/paste the following:
;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:
in_area = true
in the 'on deactivation' field, paste this:
in_area = false
now you have an evac area sensitive to smoke shells.
missionette attached.
-
Wow, Thanks for the fast respawn. And it works well. Thanks Guys.