OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: NightJay0044 on 15 Mar 2009, 19:33:16

Title: Soldier detect soldier
Post by: NightJay0044 on 15 Mar 2009, 19:33:16
Hi how do you get a soldier to detect another solider. Like a trigger of east detects west..

How do I get a specific soldier to detect another specific soldier?

Thanks..
Title: Re: Soldier detect soldier
Post by: JamesF1 on 15 Mar 2009, 21:17:47
You could use the knowsAbout (http://community.bistudio.com/wiki/knowsAbout) command, which is 1 when the unit knows nothing about the target, and greater than that (up to 4), depending on the level of knowledge.  You could just do a simple condition on a trigger:
Code: [Select]
(_unitA knowsAbout _unitB)>1
And then do whatever you want onAct.
Title: Re: Soldier detect soldier
Post by: NightJay0044 on 16 Mar 2009, 02:46:35
But won't that just make the soldier known to the other soldier?

What I want is for when the east soldier sees the west soldier , I mean actually sees him and detects him, then he runs to the town and activates the alarm.

I don't think the knowsabout command will do that?
Title: Re: Soldier detect soldier
Post by: h- on 16 Mar 2009, 08:18:41
Quote
But won't that just make the soldier known to the other soldier?
No, it checks if A's knowsAbout of B is more than 1, which is exactly what you're looking for..

Note that the knowsabout value of 1 is reached when the enemy is quite close (about 50 or so meters with default skill AI). When the knowsAbout value is about 0.1 the soldier will start to fire at the target..