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.
[03:01 pm]
Oh_Man -- https://www.youtube.com/watch?v=JgODe0xG2Cw finished it last week lol
[01:37 pm]
Vrael -- jesus christ that was 2005?
[09:19 am]
Linekat -- cool
[01:56 am]
Oh_Man -- cool bit of history, spellsword creator talking about the history of EUD ^
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[2024-4-19. : 10:41 am]
v9bettel -- Nice
[2024-4-19. : 1:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
Please log in to shout.


Members Online: Vrael, Revenant, C(a)HeK