Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Triggers not working for some Players
[SOLVED] Triggers not working for some Players
This topic is locked. You can no longer write replies here.
Aug 6 2011, 12:02 am
By: Jacek  

Aug 6 2011, 12:02 am Jacek Post #1



I have it set so that when Player X owns Y amount of Refineries he gains Z amount of Minerals per turn
I have separate triggers set for each player, but they only seem to work for Player 1 (although I've only tried this with Players 1 & 2)
Any reason why this could happen?



None.

Aug 6 2011, 12:03 am Vrael Post #2



You have an error in your triggers. I don't know if we can help you unless you post your triggers and/or your map.



None.

Aug 6 2011, 12:04 am Jacek Post #3



Quote from Vrael
You have an error in your triggers. I don't know if we can help you unless you post your triggers and/or your map.

whops meant to upload map with the post

its in this one

Attachments:
Arctic Diplo.scx
Hits: 3 Size: 126kb



None.

Aug 6 2011, 12:32 am Aristocrat Post #4



The first thing I noticed was that:

Code
//-----------------------------------------------------------------//

Trigger("Player 2"){
Conditions:
    Command("Current Player", "Terran Refinery", Exactly, 1);
    Countdown Timer(Exactly, 0);

Actions:
    Set Resources("Current Player", Add, 500, ore);
    Display Text Message(Always Display, "\x0061\x007 Oil Refinery\x002+500 Minerals");
    Comment("1 Refinery");
    Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1"){
Conditions:
    Command("Current Player", "Terran Refinery", Exactly, 1);
    Countdown Timer(Exactly, 0);

Actions:
    Set Resources("Current Player", Add, 500, ore);
    Display Text Message(Always Display, "\x0061\x007 Oil Refinery\x002+500 Minerals");
    Comment("1 Refinery");
    Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 3"){
Conditions:
    Command("Current Player", "Terran Refinery", Exactly, 1);
    Countdown Timer(Exactly, 0);

Actions:
    Set Resources("Current Player", Add, 500, ore);
    Display Text Message(Always Display, "\x0061\x007 Oil Refinery\x002+500 Minerals");
    Comment("1 Refinery");
    Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 4"){
Conditions:
    Command("Current Player", "Terran Refinery", Exactly, 1);
    Countdown Timer(Exactly, 0);

Actions:
    Set Resources("Current Player", Add, 500, ore);
    Display Text Message(Always Display, "\x0061\x007 Oil Refinery\x002+500 Minerals");
    Comment("1 Refinery");
    Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 5"){
Conditions:
    Command("Current Player", "Terran Refinery", Exactly, 1);
    Countdown Timer(Exactly, 0);

Actions:
    Set Resources("Current Player", Add, 500, ore);
    Display Text Message(Always Display, "\x0061\x007 Oil Refinery\x002+500 Minerals");
    Comment("1 Refinery");
    Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 6"){
Conditions:
    Command("Current Player", "Terran Refinery", Exactly, 1);
    Countdown Timer(Exactly, 0);

Actions:
    Set Resources("Current Player", Add, 500, ore);
    Display Text Message(Always Display, "\x0061\x007 Oil Refinery\x002+500 Minerals");
    Comment("1 Refinery");
    Preserve Trigger();
}

//-----------------------------------------------------------------//


Could have been replaced with:

Code
//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3","Player 4","Player 5","Player 6"){
Conditions:
    Command("Current Player", "Terran Refinery", Exactly, 1);
    Countdown Timer(Exactly, 0);

Actions:
    Set Resources("Current Player", Add, 500, ore);
    Display Text Message(Always Display, "\x0061\x007 Oil Refinery\x002+500 Minerals");
    Comment("1 Refinery");
    Preserve Trigger();
}

//-----------------------------------------------------------------//


Aside from that I see no actual problems with the trigger itself. Are you sure that players 2-6 actually own refineries when the countdown timer reaches 0?



None.

Aug 6 2011, 12:41 am Roy Post #5

An artist's depiction of an Extended Unit Death

The issue is that you are resetting the timer under "All Players." If you understand how trigger order works, you'd see the problem with this.

Player 1's refinery trigger runs, and then Player 1 also runs the trigger to reset the timer. Since the timer is no longer at 0, players 2-6 do not get their refinery trigger to execute.

Change the owner of the Timer trigger from "All Players" to "Player 8" (assuming player 8 is a computer player).

Post has been edited 1 time(s), last time on Aug 6 2011, 5:13 am by Roy.




Aug 6 2011, 12:48 am Jacek Post #6



Quote from Roy
The issue is that you are resetting the timer under "All Players." If you understand how trigger order works, you'd see the problem with this.

Player 1's refinery trigger runs, and then Player 1 also runs the trigger to reset the timer. Since the timer is no longer at 0, players 2-6 do not get their refinery trigger to execute.

Chang the owner of the Timer trigger from "All Players" to "Player 8" (assuming player 8 is a computer player).

Okay, thanks. This makes a lot of sense now. Hopefully I won't run into any more problems

Quote from Aristocrat
Aside from that I see no actual problems with the trigger itself. Are you sure that players 2-6 actually own refineries when the countdown timer reaches 0?

I originally had them all grouped together like that, but for some reason I thought that might be a problem so I split them apart to see if it would change anything



None.

Aug 6 2011, 12:55 am Vrael Post #7



I highly recommend reading through this article:

http://www.staredit.net/starcraft/Triggers

Very informative on how sc1 triggers work.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2026-9-14. : 3:21 pm]
Oh_Man -- Racoon City Remastered*
[2026-9-14. : 3:21 pm]
Oh_Man -- Join the front line SEN, DEFEND MANKIND. 2030 is just a number! https://scmscx.com/map/2fHHj96p
[2026-9-14. : 3:21 pm]
Oh_Man -- from the maker of the legendary Architect RPG, the peerless Racoon City, the capitvating One Piercing Note, comes another creation minutes in the making
[2026-9-14. : 11:15 am]
Oh_Man -- heh heh thanks for the minerals suckers, now it's time to quit while i'm ahead
[2026-9-14. : 1:01 am]
Oh_Man -- Heroes of the Storm literally died and was revived before we got next SC game. Wb Loveless, u cooking any UMS for us?
[2026-9-13. : 11:35 pm]
LoveLess -- getting diablo 5 and wow 4 before starcraft ghost
[2026-9-13. : 9:22 pm]
RIVE -- To be fair, I used to post custom emotes back when I still used the forums.
[2026-9-13. : 12:54 pm]
l)ark_ssj9kevin -- RIVE
RIVE shouted: 💯
holy shit did you just use an emoji on SEN that feels illegal 🍆
[2026-9-13. : 10:24 am]
Moose -- Heinermann
Heinermann shouted: new era of SC and it's just some shooter they're gonna cancel before 2030
StarCraft 2: Ghost 2, The Reghostening
[2026-9-13. : 3:38 am]
Symmetry -- :wob:
Please log in to shout.


Members Online: Zoan, DarkenedFantasies