jonipetteri 11 Posted March 25, 2019 Hello guys! Once again, need help. I'm trying to do "IED-trigger" which is activated if BLUFOR is moving faster than X in the trigger radius... How can I set it up? Thank you! Share this post Link to post Share on other sites
sarogahtyp 1105 Posted March 25, 2019 thisList findIf{vectorMagnitude (velocity _x) > 50 && {((position _x) select 2) < 5} } > -1 returns true if one object of thisList: -has more speed as 50 m/s and -has a height above terrain below 5 (not flying) 1 Share this post Link to post Share on other sites
jonipetteri 11 Posted March 25, 2019 21 minutes ago, sarogahtyp said: thisList findIf{vectorMagnitude (velocity _x) > 50 && {((position _x) select 2) < 5} } > -1 Thank you, sir! Few things: 1. Whats that "-1" at the end? 2. What is defining the side? Share this post Link to post Share on other sites
sarogahtyp 1105 Posted March 25, 2019 1. look at return Value description of findIF in wiki. 2. You should define side activation with the trigger itself. no need to do another check in the condition code. 1 Share this post Link to post Share on other sites
jonipetteri 11 Posted March 25, 2019 41 minutes ago, sarogahtyp said: 1. look at return Value description of findIF in wiki. 2. You should define side activation with the trigger itself. no need to do another check in the condition code. Bow. Share this post Link to post Share on other sites
jonipetteri 11 Posted March 30, 2019 On 3/25/2019 at 9:56 AM, sarogahtyp said: thisList findIf{vectorMagnitude (velocity _x) > 50 && {((position _x) select 2) < 5} } > -1 Can't get this work... I'm using this in trigger cond: thisList findIf{vectorMagnitude (velocity _x) > 50 && {((position _x) select 2) < 5} } > -1; And AN Act; ied01 setDamage 100; And yeah, BLUFOR PRESENT What am I missing? Share this post Link to post Share on other sites
gc8 970 Posted March 30, 2019 7 minutes ago, jonipetteri said: thisList findIf{vectorMagnitude (velocity _x) > 50 && {((position _x) select 2) < 5} } > -1; Try this: thisList findIf { vectorMagnitude (velocity _x) > 50 && ((position _x) select 2) < 5 } > -1 you had extra {} in there 1 Share this post Link to post Share on other sites
jonipetteri 11 Posted March 30, 2019 5 minutes ago, gc8 said: thisList findIf { vectorMagnitude (velocity _x) > 50 && ((position _x) select 2) < 5 } > -1 Nope.. Still doesn't. Share this post Link to post Share on other sites
gc8 970 Posted March 30, 2019 Ok another attemp, some () around the code: (thislist findIf { vectorMagnitude (velocity _x) > 50 && ((position _x) select 2) < 5 }) > -1 1 Share this post Link to post Share on other sites
jonipetteri 11 Posted March 30, 2019 21 minutes ago, gc8 said: (thislist findIf { vectorMagnitude (velocity _x) > 50 && ((position _x) select 2) < 5 }) > -1 Nope. Share this post Link to post Share on other sites
gc8 970 Posted March 30, 2019 Just now, jonipetteri said: Nope. I tested the code in console and it worked... how are you testing? Maybe change the 50 to something like 1 to test it. 1 Share this post Link to post Share on other sites
gc8 970 Posted March 30, 2019 Another script tested in trigger condition field and working: (ThisList findIf { (speed _x) > 50 && ((position _x) select 2) < 5 }) >= 0 1 Share this post Link to post Share on other sites
jonipetteri 11 Posted March 30, 2019 Now using this in trigger condition field: (ThisList findIf { (speed _x) > 1 && ((position _x) select 2) < 5 }) >= 0 And nothing happens.. Driving on it and running on it. Share this post Link to post Share on other sites
gc8 970 Posted March 30, 2019 7 minutes ago, jonipetteri said: Driving on it and running on it. Must be some setting in the trigger that's wrong. I created 100m trigger and set the trigger activation to BLUFOR. I think that's it And of course am playing on west so it triggers when I go to the trigger I'd also suggest that you put hint "TEST"; in the activation script to make sure you know when it triggers. 1 Share this post Link to post Share on other sites
jonipetteri 11 Posted March 30, 2019 9 minutes ago, gc8 said: Must be some setting in the trigger that's wrong. I created 100m trigger and set the trigger activation to BLUFOR. I think that's it And of course am playing on west so it triggers when I go to the trigger I'd also suggest that you put hint "TEST"; in the activation script to make sure you know when it triggers. Setup was all fine. Problem was that the trigger was attached to object (random placement). Removed attachTo and boom. So, attachTo is messing that code somehow. Share this post Link to post Share on other sites