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.



Rs_yes-im4real - Clan Aura - jjf28.net84.net

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:00 am]
KrayZee -- Leap of Faith Day 2020
[08:03 pm]
Moose -- Doc Halsey probs in Halo books well before Reach came out
[03:57 pm]
lil-Inferno -- probs just coincidence tbh
[2020-2-27. : 5:45 am]
Kolokol -- Okay, are both of these games referencing something else here? If so, what are they both referencing?
[2020-2-27. : 5:45 am]
Kolokol -- So I am looking at the custom campaign "Legacy of the Confederation". One of the missions has references such as "Doctor Halsey" and "Noble", but the campaign was made almost 10 years before Halo Reach.
[2020-2-27. : 2:55 am]
Dem0n -- ya
[2020-2-27. : 2:45 am]
Wing Zero -- Ah damn it Demon
[2020-2-27. : 2:03 am]
KrayZee -- Yeah, we just need 3 more. We can get a complete F if it's 4.
[2020-2-26. : 10:06 pm]
jjf28 -- i'll take that advice into cooperation
[2020-2-26. : 7:43 pm]
KrayZee -- Okay, but we need other people to cooperate and not ruin it
Please log in to shout.


Members Online: alannahdchristian