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-6-04. : 3:42 am]
RIVE -- Hellooooo, Nurse
[2026-6-03. : 4:19 pm]
NudeRaider -- Hello World!
[2026-6-01. : 4:03 pm]
IskatuMesk -- no Hello World? No Hello . jpeg? Not even ddosing some government website? smh my head
[2026-5-31. : 10:02 pm]
Symmetry -- I was really just figuring out how to compile
[2026-5-31. : 10:02 pm]
Symmetry -- I didn't make it do anything
[2026-5-31. : 9:17 pm]
Ultraviolet -- hell yeah. did you have trouble making the button functional, or just haven't gotten there yet?
[2026-5-31. : 8:29 pm]
Symmetry -- I made the marine shoot lasers and gave the medic a nonfunctional button
[2026-5-31. : 8:07 pm]
Ultraviolet -- Symmetry
Symmetry shouted: I did my first EUD thing today. Feels like me finding arsenal at age 8 again
haha for sure. in some ways it's even more exciting because you can play EUD maps on regular battle.net, don't need to convince someone to download your mod to play with you. what did you do?
[2026-5-31. : 6:47 pm]
Symmetry -- I did my first EUD thing today. Feels like me finding arsenal at age 8 again
[2026-5-31. : 3:20 pm]
l)ark_ssj9kevin -- le reddit
Please log in to shout.


Members Online: Sie_Sayoka, RIVE