twisted 128 Posted December 15, 2013 Hi. I'm trying to detect units within certain radius whther they are on foot, in a tank, in a car or in a heli. Right now units are only detected if on foot. the code i am using is: _detected = _towncenterpos nearEntities [["Man","LandVehicle","Air"], _activatedist]; where _activedist is just the distance detection happens at (usually 500) what am i misunderstanding? Share this post Link to post Share on other sites
zapat 56 Posted December 15, 2013 I don't quite understand what you are asking, but here is the logic to check a unit's vehicle type if (vehicle _unit == _unit) then { //unit on foot } else { if (vehicle _unit isKindOf "Tank")then { //_unit in tank }; //... }; Share this post Link to post Share on other sites
Falsche9 11 Posted December 16, 2013 (edited) _detected = (getPosATL Player) nearEntities [["Man","LandVehicle","Air"], 500]; diag_log (str (_detected)); return: "[O Alpha 1-1:1,O Alpha 1-2:1,O Alpha 2-1:1,B Alpha 1-1:1 (Falsche9),Agent 0x3ac8c080,Agent 0x3c08a080,Agent 0x3ac78080,O Alpha 1-3:1,Agent 0x3a466080,Agent 0x35278080,Agent 0x3a3e8080,Agent 0x3a4a2080]" I have here: 1x player, 1x soldier, 1x apc, 1x helicopter, 1x car. So the code does detect vehicles and other things - what is Agents? edit: snakes? Edited December 16, 2013 by Falsche9 Share this post Link to post Share on other sites
iceman77 19 Posted December 16, 2013 _detected = _towncenterpos nearEntities [["Man"], _activatedist]; waitUntil {{vehicle _x isKindOf "Air";} forEach _detected}; hint "They're all in an Aircraft."; ---------- Post added at 17:46 ---------- Previous post was at 17:42 ---------- waitUntil {vehicle player isKindOf "air"}; hint "You're in an aircraft"; ---------- Post added at 17:54 ---------- Previous post was at 17:46 ---------- And yeah the agents are animals. You'll need to filter those out with a civilian check. Share this post Link to post Share on other sites
Kerc Kasha 102 Posted December 16, 2013 vehicle player == player is the quickest way unless you're looking for a particular vehicle Share this post Link to post Share on other sites
iceman77 19 Posted December 16, 2013 (edited) I think he wanted to know the type of the vehicle the units were in. The title is a bit misleading, unless I'm reading the OP wrong. Edited December 16, 2013 by Iceman77 Share this post Link to post Share on other sites
dragonsyr 21 Posted December 16, 2013 waitUntil {isTouchingGround theHelo && {isTouchingGround player}}; hint "The helicopter and the player has touched the ground."; //do some things waitUntil {isTouchingGround theHelo || {isTouchingGround player}}; hint "The helicopter or the player has touched the ground."; //do some things waitUntil {isTouchingGround theHelo && {! (player in theHelo)}}; hint "The helicopter has touched the ground and the player isn't in the helo."; //do some things waitUntil {isTouchingGround theHelo && {! (player in theHelo) && {isTouchingGround player}}}; hint "The helicopter has touched the ground, the player isn't in the helo and the player isn't in a parachute."; //do some things waitUntil {(getPosATL theHelo) select 2 < 2 && {! (player in theHelo) && {(getPosATL player) select 2 < 2}}}; hint "The helicopter is near the ground, the player isn't in the helo and the player probably isn't in a parachute."; //do some things Of course you can use 'IF' control structure if you want. this is from one of my threats answer from iceman . maybe this helps.............. Share this post Link to post Share on other sites
zapat 56 Posted December 16, 2013 And yeah the agents are animals. You'll need to filter those out with a civilian check. No need for extra check: "man" includes animals 'CAmanBase" is humans only Share this post Link to post Share on other sites
iceman77 19 Posted December 16, 2013 That's nice to know. Share this post Link to post Share on other sites
zapat 56 Posted December 16, 2013 Yup. Here is the Arma2 tree in an easily digestable form: Arma3 uses the same "logic" (yeah, there is not much logic in there, but there is not a word for Arma-way-of-thinking :) ) : http://community.bistudio.com/wiki/ArmA_2:_CfgVehicles The interesting nodes IMHO are "man" and "building"/"houses": so get familiar with these and THEN open up Arma3's config browser. (My favourite are sea-weeds being buildings) Share this post Link to post Share on other sites