Jump to content
Grester

Trigger only fires to Trigger Owner, other options don't work

Recommended Posts

As the title says, if you set a unit as owner of a trigger and set the trigger to fire for example to any group member, it will only fire to the OWNER. Doesn't matter what option you choose (leader, all group members, any group members) it will only fire to the owner. This affects both single player and multiplayer. Although the .SQM appears to be correctly coded, in practice it does not work as intended.

 

I'm trying to make a mission with a trigger that only fires to a single group and it's nearly impossible to make it work. The alternative is using "unit1 in thisList" but even this alternative isn't flawless because if the "unit1" doesn't exist, the function doesn't return either TRUE or FALSE resulting in the condition to be incomplete and not work at all.

The workaround I found is using endless IFs (numberOfUnitsInGroup ^2) to check wether or not - first of all - wether or not that unit exists "!isNill "unit1" and if it exists it THEN adds the function of "unit1 in thisList". Because you have to check for every unit and every possible combination of wether or not the pawn was created in the mission, it makes a simple operation of setting trigger owner and setting to any group member, unbelievably complex to solve.

Another alternative that I haven't tried is using a switch that perhaps could facilitate the madness of using tree IFs.

 

The only way to make the Trigger Owner method to work correctly ONCE in eden is if you make this method in 2D editor and export to 3D editor. It will work ONCE when you run the mission but once you return back to editor it appears the .SQM is rewritten and stops working.

 

This is an unbelievable bug that did not exist in the old 2D editor and should be fixed with high priority.

Share this post


Link to post
Share on other sites

It seems a real bug. I confirm.

You can write equivalent conditions in a standard trigger. Say your leader is BLUFOR, so BLUFOR present, name the group (in any of unit init field: my_group = group this), then:

- for any unit of the group, write in cond field of the trigger:

 

this && ({group _x == my_group} count thislist) >0

 

- for the whole group:

 

this && ({group _x == my_group} count thislist) == count units my_group

 

After start, even if the unit with custom init field is killed, the group my_group is persistent.

  • Like 2

Share this post


Link to post
Share on other sites

It seems a real bug. I confirm.

You can write equivalent conditions in a standard trigger. Say your leader is BLUFOR, so BLUFOR present, name the group (in any of unit init field: my_group = group this), then:

- for any unit of the group, write in cond field of the trigger:

 

this && ({group _x == my_group} count thislist) >0

 

- for the whole group:

 

this && ({group _x == my_group} count thislist) == count units my_group

 

After start, even if the unit with custom init field is killed, the group my_group is persistent.

I can't thank you enough! Works perfectly, is flawless and simple. Thanks again.

Share this post


Link to post
Share on other sites

Actualy it isn't flawless and it suffers the same problem as the others for when the variables don't exist but I've created a simple workaround for that.

if (!isNil "groupName") then { ({group _x == groupName} count thislist) == count units groupName } else {true};

Share this post


Link to post
Share on other sites

 

Actualy it isn't flawless and it suffers the same problem as the others for when the variables don't exist but I've created a simple workaround for that.

if (!isNil "groupName") then { ({group _x == groupName} count thislist) == count units groupName } else {true};

Hey,

Im struggling with the exact same thing, the trigger owner is bugged, could you elaborate a bit on how you executed this in the editor? I'm trying to have the trigger go off when all of the remaining people of the squad enters the trigger area to finish the mission, but not sure how to go about it with the code mentioned. 

*EDIT* 

Think ive managed to get it working, but would still like your input to validate that what im doing is correct, if that would be possible. Thanks :)

Share this post


Link to post
Share on other sites

Im struggling with the exact same thing, the trigger owner is bugged, could you elaborate a bit on how you executed this in the editor? I'm trying to have the trigger go off when all of the remaining people of the squad enters the trigger area to finish the mission, but not sure how to go about it with the code mentioned. 

Think ive managed to get it working, but would still like your input to validate that what im doing is correct, if that would be possible. Thanks :)

if (!isNil "groupName") then //It first sees if the group variable exists, if not it won't go any further to avoid the no return issue
{ ({group _x == groupName} count thislist) //if the group variable indeed exists it starts by counting how many members of a certain group are within a trigger
 == count units groupName } //and compares to the total of members present at same group
 else {true}; //if the group variable doesn't exists it skips the verification on how many are in trigger and simply returns true

Share this post


Link to post
Share on other sites

..having an issue with the exact same thing.

 

just to double-check:

if (!isNil "CUSTOMNAME") then { ({group _x == CUSTOMNAME} count thislist) == count units CUSTOMNAME } else {true};

OR

if (!isNil "CUSTOMNAME") then { ({group _x == groupName} count thislist) == count units groupName } else {true};

I believe that the first code is right, but I cant get it to work on a dedicated server. tried also to sync and/or group the trigger...

 

 

 

Also I tried following code:

{_x in thisList} count (playableUnits + switchableUnits) == {alive _x} count (playableUnits + switchableUnits)

..but it the trigger just doesnt fire!

 

My goal is the to get the player group (clan on dedicated) to force the mission to end, if everybody is present!

 

Could anyone help please?

Share this post


Link to post
Share on other sites

..after more testing, it´s really an issue only existing in the 3D Editor! Got finally all working, expect the end trigger!

 

Your workaround unfortunately doesnt work for.

if (!isNil "groupName") then { ({group _x == groupName} count thislist) == count units groupName } else {true};

could anyone pls explain how you got it to work?

Share this post


Link to post
Share on other sites

 else {true}; //if the group variable doesn't exists it skips the verification on how many are in trigger and simply returns true

I don't understand why it's useful. It works without that!

Share this post


Link to post
Share on other sites

I don't understand why it's useful. It works without that!

 

pierremgi is right, it works without the last piece of code.

 

in case somebodys runs into same trouble like I did, set the trigger activation to "anyone"!

Share this post


Link to post
Share on other sites

So I'm assuming this is the reason why tasks won't get updated anymore for any groupmember besides the groupleader? What if I use trigger for task progression that don't use an area? I tried to use the suggested loop but it didnt work for me. Or is possible that triggers or tasks in eden are not syncing correctly to groupmembers sometimes until you create a new one and replace the old? I had this kind of issues in the past (in the 2d editor though).

Share this post


Link to post
Share on other sites

I´m not an expert at all in scripting, but try following if you wanna get a trigger fired by the whole group present!

 

1. give your group a name by putting following into the init field of your group leader: TYRDAISHIUNIT=group this;    TYRDAISHIUNIT stands for whatever name you wanna use

 

2. Create a trigger to fire when whole group is present by doing following: DONT group it or sync it to your group like you usually would. Activation: anyone!

 

3. Condition:  

if (!isNil "TYRDAISHIUNIT") then { ({group _x == TYRDAISHIUNIT} count thislist) == count units TYRDAISHIUNIT }

4. Sync Trigger to your setTaskstate-Module

 

 

Hope that helps. It did in my case. But be aware, there seem to be a few more bugs with the Eden Editor, as nice as it is, its not ready yet.

 

Also I can really recommend FHQ Tasktracker, will safe you some sync and group issues with triggers.

Share this post


Link to post
Share on other sites

I tried this for one member present in an area 1by1 attached to a unit (in this case a civilian):

 if (!isNil "groupName") then { ({group _x == groupName} count thislist) > 0 }

I didn't, however, try your advise so far regarding choosing anyone and removing the grouping to the group in question. I will try it when I return. I'm not sure though if this will work for trigger that don't have any kind of 2d area, which is about half of my triggers on any map I created :/ I might just wait for the new task modules that are wip atm.

 

I don't see the benefit of working countless workarounds into my maps because nothing works like it's supposed to be ^^'

After all we all work on creating content that helps keeping the game alive, or do we not? ;)

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

×