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.
[03:18 am]
Symmetry -- Make maps for the memes :hurr:
[08:19 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: damn, if that doesn't scream UV, I don't know what does. https://staredit.net/382067/
hah yeah in the past that might've been up my alley. haven't really been mapping lately, been too busy with everything else. and kinda lost interest too tbh. just not enough people left on SC to feel worth investing the time personally.
[08:03 pm]
lil-Inferno -- u
[07:38 am]
NudeRaider -- damn, if that doesn't scream UV, I don't know what does. https://staredit.net/382067/
[2026-10-30. : 6:55 am]
UndeadStar -- :wob:
[2026-10-30. : 2:28 am]
Symmetry -- :wob:
[2026-10-29. : 9:17 pm]
RIVE -- :wob:
[2026-10-29. : 7:03 pm]
CoCo( -- OK, click here if any1 is interested in this $ making opportunity https://staredit.net/topic/18952/
[2026-10-29. : 4:39 pm]
NudeRaider -- sure, make a post in ums assistance
[2026-10-29. : 6:44 am]
CoCo( -- anyone willing to help fix a few triggers on a new "impossible" map? Please
Please log in to shout.


Members Online: UndeadStar, Butch, l)ark_ssj9kevin