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.
[12:56 am]
Symmetry -- It is not! the working title atm is "Road to SENCON 2026"
[12:31 am]
l)ark_ssj9kevin -- reindeer breeding 3???
[2026-8-02. : 10:43 pm]
Symmetry -- No, I have another map in the works that does tho
[2026-8-02. : 9:55 pm]
l)ark_ssj9kevin -- are there EUDs now?
[2026-8-02. : 5:14 am]
Ultraviolet -- 🔥
[2026-8-01. : 9:26 pm]
Symmetry -- https://staredit.net/topic/18894/ Reindeer Breeding 2 should be fixed now! Find some friends and get your revenge!
[2026-7-31. : 4:32 pm]
lil-Inferno -- "I think they doubled these limits. (not dimensions)" -NudeRaider
[2026-7-30. : 7:12 am]
NudeRaider -- cwinowich
cwinowich shouted: guys does anyone know, what is the max unit limit on extended now ?
don't quote me on it, but I think they doubled these limits. (not dimensions)
[2026-7-30. : 7:10 am]
NudeRaider -- Ultraviolet
Ultraviolet shouted: these guys may as well be pissing in the wind
sounds liberating
[2026-7-30. : 4:43 am]
cwinowich -- i cant quite remember, and cant find it anywhere, 2400 or something? idk
Please log in to shout.


Members Online: Moose, Symmetry