Jump to content
Spriterfight

HELP Detecting units from a group in triggerarea

Recommended Posts

So i have this in the trigger condition:

({alive _x} count units test1) == ({_x in thisList} count units test1) 

and this in the units's init

test1 = group this;

The problem is it wont detect if the units from test1 are in trigger area.

Share this post


Link to post
Share on other sites

Nope.Not working

 

if the unit dies in the trigger area it activates the trigger but i dont know why 

Share this post


Link to post
Share on other sites

But if the unit dies in the trigger area it is already in the area so the trigger to fire is expected.

 

Maybe I got confused. What are you trying to do exactly? If you could more details would help. Maybe a simple:

NameOfUnit1 distance nameOfHelpingInvisibleHelipad < NumberOfMeters or NameOfUnit2 distance nameOfHelpingInvisibleHelipad < NumberOfMeters or ...

could work so as not to stall your project.

 

Edit: Or if you mean if he dies in the trigger a latter condition is fired although he is killed maybe this can help:

 

({_x in thisList && alive _x} count units test1)

not tested so it could just show an error. 

  • Like 1

Share this post


Link to post
Share on other sites
Just now, Harzach said:

You have no activation, so thisList is nil.

Do i need something in the activation?

 

Share this post


Link to post
Share on other sites
1 minute ago, Spriterfight said:

Do i need something in the activation?

 

 

Do you want thisList to exist?

  • Like 1

Share this post


Link to post
Share on other sites

If for some reason you don't want to use an activation, change your condition to:

({alive _x} count units test1) == ({_x inArea thisTrigger} count units test1) 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
6 minutes ago, Harzach said:

 

Do you want thisList to exist?

Yes ,but i dont understand why in another mission it works with activation set to none

Share this post


Link to post
Share on other sites
5 minutes ago, Spriterfight said:

Yes ,but i dont understand why in another mission it works with activation set to none

 

It literally defies reality, which suggests that what is happening is not what you think. Share the mission, or a vanilla repro.

  • Like 2

Share this post


Link to post
Share on other sites
15 minutes ago, Harzach said:

 

It literally defies reality, which suggests that what is happening is not what you think. Share the mission, or a vanilla repro.

I will as soon a possible.It is a mp scenario I have 3 unit, the respawn point is in the trigger area.The trigger activates when  all of them are in the trigger area .The trigger is set to none but it works unlike in other scenarios.

Share this post


Link to post
Share on other sites
38 minutes ago, Harzach said:

If for some reason you don't want to use an activation, change your condition to:

({alive _x} count units test1) == ({_x inArea thisTrigger} count units test1)

Put that bad boy in bold!

Thanks, @Harzach

Share this post


Link to post
Share on other sites
10 minutes ago, Spriterfight said:

Okay. I will try it.

53 minutes ago, Harzach said:

If for some reason you don't want to use an activation, change your condition to:


({alive _x} count units test1) == ({_x inArea thisTrigger} count units test1) 

  

it seems to be working.I will post a repo of that mission

 

Share this post


Link to post
Share on other sites
55 minutes ago, Harzach said:

 

It literally defies reality, which suggests that what is happening is not what you think. Share the mission, or a vanilla repro.

here is the repo.Why the trigger activates if all of the units dies outside the trigger area?

it should activate only if the group members are in the trigger area dosent it?

https://drive.google.com/file/d/1BnwduVcfxaYyHI7InG_FT5xrhCwNlhg_/view?usp=sharing

i used this in debug console for test. 

{_x setdamage 1; 
} forEach units t1; 

Share this post


Link to post
Share on other sites

In your repro mission, the trigger does not fire, as thisList is nil.

 

4 hours ago, Spriterfight said:

Why the trigger activates if all of the units dies outside the trigger area?

 

Nil = Nil.

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
On 10/3/2020 at 1:19 PM, Harzach said:

If for some reason you don't want to use an activation, change your condition to:


({alive _x} count units test1) == ({_x inArea thisTrigger} count units test1) 

 

Worked as gold. Thanks.

Share this post


Link to post
Share on other sites
On 10/3/2020 at 6:23 PM, Spriterfight said:

Why the trigger activates if all of the units dies outside the trigger area?

alive units = 0

number units in trigger area = 0

0 == 0 so trigger activates

 

Condition:

_units = units test1;
_alive = { alive _x }count _units;
_alive > 0 && { _alive == { _x inArea thisTrigger }count _units }

Only if there are units alive && num alive == num in trigger

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

×