OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Davies1 on 18 Sep 2005, 13:57:10
-
Im mucking about with some new uk desert units, one has an m203 loaded with flares or smoke shells
can i make a trigger act as an array to detect what is fired, be it a smoke shell from the launcher, or flare and effectively use this synchronised with waypoints for reinforcements, or failing that use it to mark a position for COC artillery to fire at.
I suppose that to use this array to call in a heli rescue it would be in conjucntion with getpos 'player' or etc
:'(
sorry ive been off ofp for a while and its probably somehwere in the editors depot
-
well you would need to use an Event handler more precisely a fired Event handler
theres a tut in the ed depot have a look at it.
then you will need to find out what was fired i think its something like
_muzzletype = _this select 2
? _muzzletype == "M16Grenadelauncher" : goto "event"
Exit
#event
what ever you want here
thats not guaranteed but its something along those lines
hope that helps a bit
-
putting this in the init field of the unit who is firing will tell you what they fired.
this addeventhandler ["fired",{hint format ["Name of shot is: %1,%2", (_this select 2),(_this select 4)]}]
im a little confused about what else you want to do. do you want to make firing a weapon trigger reinforcements or have i read it wrong?
check out the eventhandler tutorial in the editors depot for more details.
-
Just for info;
there's a script called: OnFlare.sqs
This script will be executed automatically if it exists in your mission folder, whenever a flare has been fired.
What the script contains is up to you.
~S~ CD
-
dudes, cheers for the help, i want to detect the flare/smoke etc just to trigger off an event, i can link what you told me with normal editor triggers to create the effect, waypoints, or chopper extractions,