Page MenuHomeFeedback Tracker

Triggers owned by a grouped unit in exported missions outside the editor don't work properly
New, NormalPublic

Description

Triggers that have a trigger owner with activation "Whole Group"/"Group Leader"/"Any Group Member" don't work properly outside the editor, i.e. having a unit that's part of a group as a trigger owner works properly in mission preview from the editor, but not in Singleplayer and Multiplayer. In exported missions (.pbo) the owned trigger always acts as "Owner Only" Activation.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Eden Editor
Steps To Reproduce

Create 4 triggers:

First trigger:
Trigger name: Trig1
Activation: Whole Group, Present
On activation:

player sideChat "Trig1 - Whole Group";

Second trigger:
Trigger name: Trig2
Activation: Group Leader, Present
On activation:

player sideChat "Trig2 - Group Leader";

Third trigger:
Trigger name: Trig3
Activation: Any Group Member, Present
On activation:

player sideChat "Trig3 - Any Group Member";

Fourth trigger:
Trigger name: Trig4
Activation: Owner Only, Present
On activation:

player sideChat "Trig4 - Owner only";

Place a group of 3 or more units. Make the 2nd highest ranking unit the player unit (you'll have to kill the group leader and take command of the group). Set the owner of the 4 triggers you created to the group leader. You can name the group leader "a1". Start the mission, kill the group leader, when you take command of the group move into the trigger zones. You should see Trig1, Trig2 and Trig3 being executed even though the trigger owner is dead. Trigger ownership successfully transferred from the dead owner to another group member. Only Trig4 will not work, which is expected behavior. Now create 4 more triggers:

First trigger:

Trigger text: trig1 owner
Activation: Radio Alpha
On activation:

hint (str (triggerAttachedVehicle Trig1));

Second trigger:

Trigger text: trig2 owner
Activation: Radio Bravo
On activation:

hint (str (triggerAttachedVehicle Trig2));

Third trigger:

Trigger text: trig3 owner
Activation: Radio Charlie
On activation:

hint (str (triggerAttachedVehicle Trig3));

Fourth trigger:

Trigger text: trig4 owner
Activation: Radio Delta
On activation:

hint (str (triggerAttachedVehicle Trig4));

You can make these triggers repeatable if you like. Now start the mission again and run the radio commands. All the triggers except Trig4 should display <NULL-object>. Trig4 should display either the variable name of the owner unit or it's callsign if a variable name is not given to the trigger owner.
Export the mission to either Singleplayer or Multiplayer. Start the mission, run the radio triggers - all of them will display the variable name / callsign of the trigger owner. Kill him and then enter the trigger areas: the triggers will not work. If you run the radio commands again you'll see that the ownership hasn't changed. All triggers act as "Owner only" for the exported missions.

Additional Information

It's not mandatory to set the group leader to be the trigger owner. You can make the player the group leader and the trigger owner to be one of your subordinate units. The effect will be the same. As you can see this is game breaking for missions that were designed with AI or playable units for Multiplayer. If the trigger owner gets killed the triggers won't work. The only solution right now is to not use triggers with owners (except for "Owner Only" activation).

I don't know if I should post this here but I would also like to suggest:
When you fix this bug, can we receive the ability to set a group entity in the editor as the owner of a trigger (this should automatically remove the "Owner Only" activation option in a trigger with group entity set as owner and only allow the other 3 options - "Whole Group", "Group Leader", "Any Group Member").

My reasoning is this: If you create a multiplayer mission and you set a playable unit from a group as the trigger owner, if the players in the multiplayer lobby don't pick the slot for that unit and disable it's AI, then the trigger will not spawn / work. For example, a multiplayer co-op mission where you have a whole squad of playable units. The group leader is the trigger owner of the trigger that has to end the mission with "Whole Group" Present activation. If nobody picks the group leader slot and disables it's AI the trigger will not work and the mission will not end. Alternatively, you can program the trigger to automatically detect that it's owner doesn't exist at mission start and look for other units in the owner's group (but NOT for "Owner Only" activation triggers as that would make no sense).
This problem also exists for trigger owner units that have probability of presence <100% or condition of presence that might return false. This idea is inspired by the, now overcomed inability, to initialize group variable name. In the past mission makers had to initialize their group variable name in every playable group member unit's initialization field to avoid cases where a playable unit that has group initialization code was not picked in multiplayer and it's AI disabled. By putting the group variable name in the group entity's name field, this problem is now solved.

Event Timeline

Domcho created this task.Aug 25 2022, 12:16 PM
PiepMGI added a subscriber: PiepMGI.EditedAug 25 2022, 2:06 PM

Tested with "any member of the group" :
All mission.sqm (pboed or not) have an emptyDetector (trigger) set with :
activationByOwner="MEMBER";
and a link (of course) type = "TriggerOwner"; between items referring of the group and the trigger. Fine!

The preview is OK. The trigger activation (triggerActivation command) returns ["MEMBER","PRESENT",true] (as planned in editor). The trigger fires in preview.
but...

When exported and run in SP or MP scenario, this kind of trigger fails (even if the depboed mission.sqm are OK, checked same as recorded in preview)
The trigger activation (triggerActivation command) returns now ["VEHICLE","PRESENT",true]
The trigger never fires.

Domcho edited Additional Information. (Show Details)Aug 25 2022, 9:06 PM