Jump to content
Sign in to follow this  
jwllorens

Trigger MP locality?

Recommended Posts

When creating triggers through createTrigger command, there is a parameter to create the trigger locally or globally.

 

I have a few questions about this.

 

1: Is a "globally" created trigger using createTrigger simply broadcast over the network so that all machines create a trigger with the same parameters?

 

2: Is a global trigger is therefore several different triggers that are each created with the same starting parameters but otherwise "local" to their own machine and not synced?

 

3: If I run a script on one machine setting the statements or other aspects of this trigger, including the position of the trigger, will these updates to the trigger be broadcast to other machines and update the instances of that trigger on their machine?

 

4: Can a local trigger still tell if non-local units are inside of it?

 

5: Will the code in the condition, activation, and deactivation fields of a global trigger be executed on every machine if the trigger is activated only on one machine? (assuming the activation condition was somehow different for that one machine due to a local global variable or something).

 

6:  What is the point of a global trigger?  If the statements are only run locally, why not save every machine the hassle of checking the condition every 0.5sec and just define the trigger locally on the server.  Then, in the statements, just use remoteExec to execute a predefined function on all machines if needed.    

Share this post


Link to post
Share on other sites

I too am interested in getting clarity of how locality works for certain functions.  I'm so confused as to the "map" of what gets controlled where when everyone in MP including the server is playing to the same sheet of music (the .pbo for the mission).

Share this post


Link to post
Share on other sites

I too am interested in getting clarity of how locality works for certain functions.  I'm so confused as to the "map" of what gets controlled where when everyone in MP including the server is playing to the same sheet of music (the .pbo for the mission).

 

Some funtions have propagation like skiptime, if you set locally it will vanish and return to default but if you execute on server everyone will suffer the changes. Playmusic execution is locally so players can be on different stages of same music.

Share this post


Link to post
Share on other sites

Some funtions have propagation like skiptime, if you set locally it will vanish and return to default but if you execute on server everyone will suffer the changes. Playmusic execution is locally so players can be on different stages of same music.

Thats just it though.  I'm very uncertain of what gets executed on the server and what doesn't; even more unsure of how to force something to run on the server.  Like the OP, it seems like certain functions have a shared effect.  The wiki might say "aG", "eG", "sE" etc, but I for one don't understand how one can control or direct those aspects.

Share this post


Link to post
Share on other sites

1: NO
2: YES
3: Only position will be synced

4: YES
5: NO, only radio trigger is global this way

4: So that when you want to delete it you can just delete 1 object. Also remoteExec is brand new, triggers are ancient.

Share this post


Link to post
Share on other sites

I found this while browsing the biki,

"(...)

  • Triggers created in editor exist on all machines (a trigger is created per machine, local to it), and they run on all machines (conditions checked, onActivation/onDeActivation executed when condition is true etc)
    • Because the trigger is created on each machine, changing the trigger properties (statements, onActivation, etc. etc) has only local effects.
      • Unconfirmed: Is the effect of moving or deleting triggers global or local. One would believe local.

"

from: https://community.bistudio.com/wiki/6thSense.eu:EG#Locality

 

While it does not answer all your questions directly, we can assume that creating a trigger with createTrigger would simply create a local copy on all connected clients.

If you apply local commands to that trigger (without proper replication) you'd probably alter that instance of trigger on that local instance of the game and it would be different from the triggers in other connected players' instances of the mission.

That's as much as I can assume from the info provided.

As for the activation/deactivation locality conditions you'd probably need to check that out with some tests.

Also available to help determine locality, in this and any tests are the 'local' and the 'owner' commands to determine if the object is local and who is the owner.

 

Hope this bit helps you a little.

Share this post


Link to post
Share on other sites

So if a trigger is created in the editor, as well as units inside that trigger (already tripping the trigger) that are set to hidden and AI disabled.  Does that affect how a connected player might unhide and enable them globally on a dedicated server?  They are "there from the start" any synced across all players including JIP assuming they haven't been unhidden and enabled yet, right?

Not to hijack, but the core issue here seems to be very closely related to an issue I posed here.  

Share this post


Link to post
Share on other sites

Not to hijack, but the core issue here seems to be very closely related to an issue I posed here.  

 

What issue? There is no issue. Triggers in A3 work as designed right now.

Share this post


Link to post
Share on other sites

What issue? There is no issue. Triggers in A3 work as designed right now.

It seemed that how triggers work in a MP environment might be why I was having problems, but I see now that it's just my lack of understanding.

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
Sign in to follow this  

×