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.
[05:01 pm]
NudeRaider -- Vrael
Vrael shouted: because you perfectly guessed SEN's root password and we cant have that displayed all over the shoutbox
given Moose's post I don't think he had to guess. ^^
[04:53 pm]
NudeRaider -- lil-Inferno
lil-Inferno shouted: Nude why'd you delete my shout
why not? :awesome:
[04:26 pm]
Vrael -- because you perfectly guessed SEN's root password and we cant have that displayed all over the shoutbox
[03:58 pm]
lil-Inferno -- sadjfjkasdhfijsadhmfcjhsdajkvfmjadslkfhjsdkahf
[03:58 pm]
lil-Inferno -- Nude why'd you delete my shout
[03:35 pm]
NudeRaider -- never trust a statistic you haven't forged yourself
[04:37 am]
Ultraviolet -- 80% of statistics are made up on the spot
[08:05 pm]
Symmetry -- 50% of strings in starcraft are references
[2026-6-07. : 1:59 am]
RIVE -- Lots of fun little nods to different works of others in the cheats too.
[2026-6-06. : 5:17 pm]
Oh_Man -- so i was today years old wen i learned rebel yell starcraft mission is named after a billy idol song. makes me wonder wat other missions are named after songs
Please log in to shout.


Members Online: lil-Inferno, NudeRaider