Jump to content
Sign in to follow this  
igneous01

making a trigger global without scripting it?

Recommended Posts

this is more of a question than an answer, i cant really test on a server right now with other people.

Think of this:

lets say you create a trigger, and maybe it spawns a single unit on activation (west present)

now if this is run in mp, obviously everyone that activates the trigger will spawn a unit

but what if the condition was changed to:

this && isServer

what might happen?

Would the trigger only activate if west units local to the server are present?

Would the trigger only activate for the player that is hosting the server?

would the trigger never activate if it was a dedicated server?

or possibly, it activates for any west unit in the area, but only activates once (for the server)?

just a thought that crossed my mind, so if someone has tested this, let me know what the results are.

share any findings you may know

Share this post


Link to post
Share on other sites

in theory yes, trigger would only activate if (condition and it was the server trigger(AI is always on server side if not in player group)) but my guess is as good as yours, i think isServer should work in condition, if not you can place it in onact:

if (isServer) then {spawn your unit here};

---------- Post added at 01:46 ---------- Previous post was at 01:42 ----------

you could maybe try this for condition instead to workaround player groups AI:

this AND ({_x != player} count thisList) != 0

Now it will activate no matter wich AI unit that enters, even if they are in a player group.

it will still only check for west units as long as west present is made.

Share this post


Link to post
Share on other sites

the whole thing behind triggers is confusing, if you script it, you can specify who it will be created to, but if its something like west present, if its not local to that machine, it may not fire off at all (or atleast to my understanding of it) because the server doesnt know that another player is west?

will do some experimentation when i get the chance

---------- Post added at 23:49 ---------- Previous post was at 23:48 ----------

nice one demonized, i never thought of that as a workaround, now i dont need to spend 20 mins scripting a trigger \o/

Share this post


Link to post
Share on other sites

just a sidenote on triggers, if you place one trigger in editor its not a global trigger, but a local triggere wich is copied to all clients from server, meaning trigger is always local.

Maybe thats more confusing...

At least thats how i have understood it from previous findings here on the forum, i may be totally wrong ofc, but this is supported by the fact that there is no createGlobal trigger command.

If im putting my foot in my mouth someone please correct me.

Share this post


Link to post
Share on other sites

just did some tests:

all i used in condition box is this && isServer

I had 1 test where me and a buddy were on the same team, he ran into a detected by opfor trigger, and the trigger fired off (hinting for me saying activated, and i heard the alarm siren)

however, he did not hear the siren, meaning it only fired for me as the server

then i did two tests, where we both were in separate groups, and a trigger that would spawn a vehicle when west was present. He ran into it, it spawned for him, when i ran into it, it did not spawn afterwards - works fine here

than i did a test where we both had ai, and had the ai from his group move into the trigger, result: same thing, spawned the bmp, then afterwards when i went in, it did not spawn a bmp. It WORKS!!!

so here is my conclusion to this: The trigger is created locally across all clients and the server. However, the condition checks for west regardless of it being server side or not. So after that condition is fulfilled, the trigger will then check for the trigger that is Server side, and activate that trigger. I am completely stunned that it worked with both player controlled ai, players in same and in different groups. it Works and fires off only once. If its set to repeated it also will only fire when their is no more west inside, and west jump back in again.

Interesting stuff

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  

×