Jump to content
jonipetteri

Trigger activation based on speed

Recommended Posts

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
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)

  • Thanks 1

Share this post


Link to post
Share on other sites
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

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.

  • Thanks 1

Share this post


Link to post
Share on other sites
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
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
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

 

  • Thanks 1

Share this post


Link to post
Share on other sites
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

Ok another attemp, some () around the code:

 

(thislist findIf { vectorMagnitude (velocity _x) > 50 && ((position _x) select 2) < 5 }) > -1

 

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
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
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.

  • Like 1

Share this post


Link to post
Share on other sites

Another script tested in trigger condition field and working:

 

(ThisList findIf { (speed _x) > 50 && ((position _x) select 2) < 5 }) >= 0

 

  • Like 1

Share this post


Link to post
Share on other sites

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
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.

 

  • Like 1

Share this post


Link to post
Share on other sites
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×