OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: duexmad on 13 Mar 2003, 02:43:08

Title: Trigger to detect...
Post by: duexmad on 13 Mar 2003, 02:43:08
Hello all,

I am trying a make a map where a soldier is parachuted and needs to land at a DZ (Drop Zone).

Now the 'problem' is this;

The Trigger  will go off, if a 'west' unit (i.e. soldier under canopy) hits it while in the air. (even with the F2 mouse drag)

I need a trigger to detect it once the soldier in on the ground and not in the air.

Is that possible???

Thanks in advance.
Title: Re:Trigger to detect...
Post by: Artak on 13 Mar 2003, 08:55:48
hmm..

experiment with the canstand commad and if that doesn't work

_soldier = _this select 0
#height
_height = getpos _soldier select 2
?_height < 2: goto "activate"
~1
goto "height"
#activate
type here a condition to activate the trigger
exit

activate the script by typing [soldiername] exec "scriptname.sqs"
Title: Re:Trigger to detect...
Post by: duexmad on 13 Mar 2003, 17:32:06
Dear Artak,

Thank you!
I will check it out and post the results here ASAP.

Also, at the '#activation'

Could I type this in?

_vehicle == player

(To detect once the player is out of the chopper)

Thanks again!

Title: Re:Trigger to detect...
Post by: dmakatra on 13 Mar 2003, 18:17:26
You donÂ't have to script ;).

http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=6869
Title: Re:Trigger to detect...
Post by: duexmad on 14 Mar 2003, 04:50:47
Tried that , Armstrong  :D
Code: [Select]
? (getPos this select 2 < 40) and (getPos this select 2 > 25):trigger1=true

But, gave me some weird error message (not so 'weird for you guys').

basically it is saying that the '?' is  "Invalid Number in expression"

'|#|? (getPos this select 2 < 40) and (getPos this select 2 > 25):trigger1=true :Error Invalid Number in expression

I have placed that line on the 'Condition' and on the 'On Activation' no luck.
What am I doing wrong? I know it has to be something with the '?' mark (?)

 :-\
Title: Re:Trigger to detect...
Post by: Artak on 14 Mar 2003, 07:38:22
You can't have ? in a trigger.. *cough*

The triggers condition line has a 'build-in' ?-mark in it.
Title: Re:Trigger to detect...
Post by: Chris Death on 14 Mar 2003, 08:06:58
Well, Armstrong suggested that you don't have to script
but the command he gave you does only work in scripts  :)

If you want to use this in a trigger, you need to cut it into
two parts:

condition:
(getPos soldier select 2 < 40) and (getPos soldier select 2 > 25)

onActivation: trigger1=true

~S~ CD
Title: Re:Trigger to detect...
Post by: duexmad on 26 Mar 2003, 23:39:18
Thanks guys got it figured out.

Thanks again
 ::)

Title: Re:Trigger to detect...
Post by: LinCafe on 27 Mar 2003, 11:50:31
just put this In the CONDITION field of the trigger:

This AND (getpos UnitName select 2 < N)

Then the trigger will fire when the unit is present, and "N" meters or less above the ground.

Hope this helps you