Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: consultation about players - action relationship
consultation about players - action relationship
Feb 1 2019, 6:12 pm
By: 123dominico  

Feb 1 2019, 6:12 pm 123dominico Post #1



these are my forces

and my trigger action


step that in the players tab mark force 4, and the actions were being executed doubly (create 2 units instead of one).
then testing, switch from force 4 to player 8 and fix error.but I do not understand why this happens.
someone could explain me? please



None.

Feb 1 2019, 6:56 pm Pr0nogo Post #2



Triggers fire for every player they are owned by. A trigger owned by force 4 in your case will fire twice because there are two players in force 4. It would fire six times if you set it to force 1.




Feb 1 2019, 8:27 pm jjf28 Post #3

Cartography Artisan

Just a basic rundown on how triggers work, every two seconds (or less depending on whether hyper triggers/wait actions/EUD nonsense is involved) the game freezes (for an imperceptibly shot amount of the time for most computers/maps) and executes triggers...

To execute the triggers the game will go through players 1-8 one at a time, for each player it will set current player appropriately then go through the entire list of triggers top-to-bottom... For each trigger the game will check:

Is this trigger owned by currentPlayer? If so, check the conditions, if the conditions pass, run the actions.
Is this trigger owned by the force currentPlayer is in? If so, check the conditions, if the conditions pass, run the actions.
Is this trigger owned by all players? If so, check the conditions, if the conditions pass, run the actions.
(If it was owned by currentPlayer, currentPlayer's force, and the conditions still pass after the first run through, it would run three times in a row)

Then it will proceed to the next trigger in the list.

When all triggers are done for currentPlayer, current player gets incremented, and you go back to the top of the trigger list again.

Once player 8 finishes his last trigger the game unfreezes




I display the amount of times a trigger will run each trigger cycle in CHKD:


Post has been edited 2 time(s), last time on Feb 1 2019, 8:49 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Feb 2 2019, 3:11 am NudeRaider Post #4

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from jjf28
for each player it will set current player appropriately then go through the entire list of triggers top-to-bottom... For each trigger the game will check:

Is this trigger owned by currentPlayer? If so, check the conditions, if the conditions pass, run the actions.
Is this trigger owned by the force currentPlayer is in? If so, check the conditions, if the conditions pass, run the actions.
Is this trigger owned by all players? If so, check the conditions, if the conditions pass, run the actions.
(If it was owned by currentPlayer, currentPlayer's force, and the conditions still pass after the first run through, it would run three times in a row)

I like to explain it by saying that sc generates copies for each player in a force or All Players when set as trigger owner. And Current Player is always set to the player that currently runs their trigger set.
So during runtime, triggers are never owned by a force, but by Player 1, Player 2, etc.
Similarly when you check a DC for a force what sc does is ask each player how much DCs they have and adds them all together.




Feb 3 2019, 12:33 am 123dominico Post #5



Thanks for all comments



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
[2024-4-20. : 7:56 pm]
Oh_Man -- lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
Please log in to shout.


Members Online: Roy