OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Davies1 on 18 Sep 2005, 13:57:10

Title: Sorry about this guys
Post 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
Title: Re:Sorry about this guys
Post by: 456820 on 18 Sep 2005, 14:28:57
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
Title: Re:Sorry about this guys
Post by: bored_onion on 18 Sep 2005, 14:59:36
putting this in the init field of the unit who is firing will tell you what they fired.

Code: [Select]
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.
Title: Re:Sorry about this guys
Post by: Chris Death on 18 Sep 2005, 15:31:42
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
Title: Re:Sorry about this guys
Post by: Davies1 on 20 Sep 2005, 18:41:02
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,