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.
[11:29 pm]
Vrael -- idk what I did but I like triple-posted in SD sorry
[02:45 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: have i ever told u guys my SC2 pro-gamer story
how many GSL titles?
[2026-7-27. : 10:41 am]
ManCubuS -- Seems like something's broken regarding the site then. Sadge...
[2026-7-27. : 7:36 am]
Oh_Man -- have i ever told u guys my SC2 pro-gamer story
[2026-7-26. : 11:30 pm]
Ultraviolet -- That's strange, it looks like you targeted the base image file (sometimes people make the mistake of just using the imgur page link which doesn't work for embedding) but it still didn't work it sounds like.
[2026-7-26. : 3:34 pm]
ManCubuS -- Used : " [img=https://i.imgur.com/gpOjTuD.jpeg] "
[2026-7-26. : 3:28 pm]
ManCubuS -- Even tried with imgur, doesn't attach.
[2026-7-26. : 3:14 pm]
ManCubuS -- I should try a workaround, thanks! Sadly imgur is blocked in my country for some unknown reason.
[2026-7-26. : 3:05 pm]
NudeRaider -- I think SEN has trouble with https or hotlinking is forbidden. It certainly is nothing about the size, it just fails to get any size. You can get it working if you use imgur and include the actual image link for the img tag. Like this: [img=https://i.imgur.com/ddYqXZa.jpeg]
[2026-7-26. : 11:15 am]
ManCubuS -- Hey fellas! Anyone knows why when I try to upload an image it says "failed to get image size"? I even tried making it so small. Imgur isn't working here and I tried postimg no luck.
Please log in to shout.


Members Online: Symmetry