OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Wolf on 30 Aug 2002, 03:44:40

Title: Trigger activated when you get so close to someone
Post by: Wolf on 30 Aug 2002, 03:44:40
Ok, Is it possible using a trigger to detect when someone is withing say, 5 meters from anyone from any of the four sides?

Ex, Your waliking along, and someone, say a civilian runs up to you and when hes withing a certain distance, a trigger is activated. If my guys was standing still the whole time, there'd be no problem, but I need both to be mobile.
So is there such a command?
And what would it be.
Thank you.
Title: Re:Trigger activated when you get so close to someone
Post by: ofp..hahha on 30 Aug 2002, 04:40:27
Ok i believe there is a condition that can define this but heres nother way make a text document and paste this into it...

_Trigger = this select 0
_Man = this select 1

#loop1
_Trigger setpos [getpos _Trigger select 0,getpos _Man select 1,0]
_Trigger = true > goto "end"
~0.0001
goto "loop1"
#end
exit

; ok this should work test it out a little i might have forgot sometin.
Title: Re:Trigger activated when you get so close to someone
Post by: ofp..hahha on 30 Aug 2002, 05:27:33
use it like this put in the guys init [trig1,guy1] exec "scriptname.sqs"
Title: Re:Trigger activated when you get so close to someone
Post by: Kaliyuga on 30 Aug 2002, 05:33:52
Hey Wolf.. what you're looking for is simply this:

Condition for your trigger:  unitname distance unitname < 5

then whatever you want on activation
:cheers:
Title: Re:Trigger activated when you get so close to someone
Post by: ofp..hahha on 30 Aug 2002, 05:35:36
Thank you, thats what i couldnt dig out of my head :)
Title: Re:Trigger activated when you get so close to someone
Post by: Wolf on 30 Aug 2002, 05:41:30
lol
Thanks all.
I think the Knowabout command will work the best if its all the same to you.lol.
Thanks all.