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:57 am]
NudeRaider -- https://staredit.net/381600/ You have 5 minutes, then you can only edit your posts.
[04:05 pm]
NudeRaider -- DarkenedFantasies
DarkenedFantasies shouted: you eat lots of beans
:lol:
[11:30 am]
NudeRaider -- I would like 3000 minerals, please
[2026-4-16. : 7:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[2026-4-16. : 4:15 am]
DarkenedFantasies -- you eat lots of beans
[2026-4-16. : 3:46 am]
IskatuMesk -- how do i get gas
[2026-4-15. : 11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
Please log in to shout.


Members Online: anoeth47