Jump to content
Spookykid

Having trouble with a trigger [SOLVED]

Recommended Posts

Edit I finally got it working thanks guys

 

 so I am in a part of my mission I need to create a enemy attack in waves.

 

for example I have two groups Wave1Group1 Wave1Group2 Wave1Group 3 , Wave2Group1 ect ect.

 

I keep Wave 2 hidden  ON A hide/SHOW node and that is working nice

 

The issue I am having is when I want the to show it's not working I have a new show/hide node and I have a trigger for it and it is not working this is what I have exactly in the trigger.

 

edit: I want wave 2 to appear when wave1 dies.

 

({ alive _x } count units Wave1Group1 == 0)
&&
({ alive _x } count units Wave1Group2 == 0)
&&
({ alive _x } count units Wave1Group3 == 0)

 

what did I do wrong?

Share this post


Link to post
Share on other sites
((units (group Leader1)) select {alive _x}) isEqualTo []

I gave the leader of group1 the name Leader1.

  • Like 2

Share this post


Link to post
Share on other sites
13 minutes ago, Smart Games said:

((units (group Leader1)) select {alive _x}) isEqualTo []

I gave the leader of group2 the name Leader1.

 

https://i.ibb.co/ZKD7YHB/Inked-Unbenannt-LI.jpg

 

thank you

 

So I just wrote it in wrong? If I just swtich out leader1 to Wave1Group1 it will have my desired affect?

Share this post


Link to post
Share on other sites
27 minutes ago, Smart Games said:

((units (group Leader1)) select {alive _x}) isEqualTo []

I gave the leader of group2 the name Leader1.

 

https://i.ibb.co/ZKD7YHB/Inked-Unbenannt-LI.jpg

 

Just a suggestion. Are'nt dead units changing their group?

Then this should be enough:

 

units (group Leader1) isEqualTo []

Share this post


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

 

Just a suggestion. Are'nt dead units changing their group?

Then this should be enough:

 

units (group Leader1) isEqualTo []

I had the same idea but it wasn't working. Probably because dead units remain for some time in their group until they are removed.

Share this post


Link to post
Share on other sites
26 minutes ago, Spookykid said:

So I just wrote it in wrong? If I just swtich out leader1 to Wave1Group1 it will have my desired affect?

 

if Wave1Group1 is a group, then:

((units Wave1Group1) select {alive _x}) isEqualTo []

 

if it's a unit:

((units (group Wave1Group1)) select {alive _x}) isEqualTo []

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Yeah i guess the reason is that the leaders group has changed after he died.

But that means your solution will not work if the leafer dies first.

 

2 minutes ago, Smart Games said:

I had the same idea but it wasn't working. Probably because dead units remain for some time in their group until they are removed.

  • Like 1

Share this post


Link to post
Share on other sites

The leaders group has to be stored on start ...

  • Like 1

Share this post


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

The leaders group has to be stored on start ...

yeah, you're right!

 

Checked it and if you use

10 minutes ago, Smart Games said:

((units Wave1Group1) select {alive _x}) isEqualTo []

 

it's working

 

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
20 minutes ago, sarogahtyp said:

 

Just a suggestion. Are'nt dead units changing their group?

Then this should be enough:

 

units (group Leader1) isEqualTo []

 

 

I have 6 separate groups 

 

3 are always visible going towards their objective.

 

The other 3 are hidden using a hide/show node that gets activated by a trigger on the start of the mission. ( Perhaps that trigger is keeping them hidden?)

 

I want everyone in wave2 to show after all of wave 1 dies.

 

I need to take another look I think the mission start trigger I have is keeping them hidden but I could be wrong I am new to this so I am sure I will learn the hard way.

 

 

I appreciate everyone's help I will be going to bed and when I wake up I'll try a few things mentioned here and take a look at my triggers again and I'll be sure to keep this updated.

 

Despite all my troubles I have actually learned alot by trying to troubleshoot this single problem. 😂

Share this post


Link to post
Share on other sites

Just a condition for that:
flatten ([Wave1Group1,Wave1Group2,Wave1Group3 ] apply {units _x}) findIf {alive _x} == -1

 

 

  • Like 1

Share this post


Link to post
Share on other sites
20 hours ago, Smart Games said:

 

 

12 hours ago, pierremgi said:

Just a condition for that:
flatten ([Wave1Group1,Wave1Group2,Wave1Group3 ] apply {units _x}) findIf {alive _x} == -1 

 

 

 

I am unsure what you mean by flattening out if you could explain that to me I'll never have to ask that again lol

Share this post


Link to post
Share on other sites
35 minutes ago, Spookykid said:

 

 

I am unsure what you mean by flattening out if you could explain that to me I'll never have to ask that again lol

[Wave1Group1,Wave1Group2,Wave1Group3 ]  is your array of 1st wave groups (3 groups)

apply {units _x} allows to transform each group into their units but you obtain an array of arrays like [[grp1U1,grp1U2,...],[grp2U1,grp2U2,...],[grp3U1,grp3U2,...]]

flatten transforms this array of arrays into a simple array with all the units of the 3 groups: [grp1U1,grp1U2,...,grp2U1,grp2U2,...,grp3U1,grp3U2,...]
findIf is performance friendly because it skips to result as soon as it finds a wrong case (so, in this case an alive unit). == -1 means no alive found.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
27 minutes ago, pierremgi said:

[Wave1Group1,Wave1Group2,Wave1Group3 ]  is your array of 1st wave groups (3 groups)

apply {units _x} allows to transform each group into their units but you obtain an array of arrays like [[grp1U1,grp1U2,...],[grp2U1,grp2U2,...],[grp3U1,grp3U2,...]]

flatten transforms this array of arrays into a simple array with all the units of the 3 groups: [grp1U1,grp1U2,...,grp2U1,grp2U2,...,grp3U1,grp3U2,...]
findIf is performance friendly because it skips to result as soon as it finds a wrong case (so, in this case an alive unit). == -1 means no alive found.

 

Thank you that makes  sense.

 

I still can't get anything anyone has suggest to work I must be missing something else, some of the conditions the game will start up with no errors just not with the desired effect and some will make an error before closing the trigger attributes.

Share this post


Link to post
Share on other sites
9 hours ago, Spookykid said:

Thank you that makes  sense.

 

I still can't get anything anyone has suggest to work I must be missing something else, some of the conditions the game will start up with no errors just not with the desired effect and some will make an error before closing the trigger attributes.

There are several problems:

- first one, clarify what you want to do. Making visible some groups after a first wave dies is (very) simple. Making repetitive waves is different. SP / MP (server)... context.

- Second, we can't correct on act field just discussing about condition one.

- third, copying/ pasting can fail and throw errors with invisible character added. This kind of error is unfortunately common on this forum.

So, if you need some more help, just describe the "something else".

  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, pierremgi said:

There are several problems:

- first one, clarify what you want to do. Making visible some groups after a first wave dies is (very) simple. Making repetitive waves is different. SP / MP (server)... context.

- Second, we can't correct on act field just discussing about condition one.

- third, copying/ pasting can fail and throw errors with invisible character added. This kind of error is unfortunately common on this forum.

So, if you need some more help, just describe the "something else".

 

Thanks the issue was I had no idea what something else was, I just re did all my triggers modules and   it worked out, sorry I am pretty new at this but I actually learned quite a bit and now understand more of what I am actually writing .

 

I really do appreciate you, I have the wiki always open now as a reference even though some things are hard to understand I am starting to understand alot more than I did before.

 

  • Like 1

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

×