Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: No idea why trigger isn't working
No idea why trigger isn't working
Mar 16 2022, 1:43 pm
By: Sala  

Mar 16 2022, 1:43 pm Sala Post #1



Trigger("All players"){
Conditions:
Command("X", "Zerg Evolution Chamber", Exactly, 1);
Countdown Timer(Exactly, 45);

Actions:
Set Resources("Current Player", Add, 12, ore);
Preserve Trigger();
}

I have a countdown timer that keeps repeating. Players only get the 12 minerals the first time it hits 45 though, not the following times. Anyone know why?



None.

Mar 16 2022, 2:23 pm NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Are you using hyper triggers? If not, there might not a trigger check happening while the timer is at 45.
You could alter the condition to at most 45 and add another with at least 44 or 43. This, however, runs the risk that the trigger fires multiple times. If you do use hyper triggers it will definitely fire several times.

So the suggested solution is to add hyper triggers and do the actual timing with death counters and have the countdown timer only for show.




Mar 16 2022, 2:41 pm Sala Post #3



Quote from NudeRaider
Are you using hyper triggers? If not, there might not a trigger check happening while the timer is at 45.
You could alter the condition to at most 45 and add another with at least 44 or 43. This, however, runs the risk that the trigger fires multiple times. If you do use hyper triggers it will definitely fire several times.

So the suggested solution is to add hyper triggers and do the actual timing with death counters and have the countdown timer only for show.

I wasn’t expecting such a fast reply, thanks! I just read up about hyper triggers. I had no idea StarCraft only checks for triggers every 2 seconds normally, that could definitely explain this.



None.

Mar 17 2022, 1:39 am riffdex Post #4



If you are still having issues getting it to work, you could do a toggle that only allows it to fire once per countdown timer cycle. So

Trigger("All players"){
Conditions:
Command("X", "Zerg Evolution Chamber", Exactly, 1);
Countdown Timer(At Most, 45);
Death Count("X", "Terran Beacon, Exactly, 0)

Actions:
Set Resources("Current Player", Add, 12, ore);
Set Death Count ("X", "Terran Beacon, Set to, 1;
Preserve Trigger();
}


Then on the other trigger that I presume restarts the Countdown timer for another cycle, set all player's Death Count for Terran Beacon back to 0



None.

Mar 17 2022, 3:47 am TheHappy115 Post #5



Please note: When you use hyper triggers, they cause wait blocks. This means if your map adds hyper triggers and then also adds wait commands in the action, it can create conflicts.
Personal solutions from testing to avoid this:
1) Ensure Hyper triggers are at the bottom of the trigger list (this way they won't "block" other wait commands).
- This method is fairly easy, although could be annoying (just move them to bottom, or simply just remake it)

2) Use Death counters. Instead of having "count down timer" for everything, you can just set the deaths of something unused such as "cave doodad" to 100, and have a trigger that subtracts 1 "cave doodad" death every trigger check. You can then estimate the time of how many "100" trigger checks will be as your timer and this will help improve the overall UI since all players won't see the timer. This method also helps you run multiple counters that won't conflict with each other as well as adding time or subtracting it.

3) Terran burning structure. You can make a terran structure burn and after a set amount of time it will die, and you can have that act as your timer. I've never personally used this method so I don't know to much about it but I have seen it used in other maps.

The problem with using multiple wait commands is if you have 2 occurring at the same time for the same player, they may conflict with each other and one will take priority over the other. This is a very large problem when timing matters.

When you add hyper triggers, they should check triggers once every other frame. I believe on fastest speed that is about 12 checks per second (for 24 frames per second). I've been told you can speed this up to a check every frame using a EUD trigger for forcing the check.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:24 pm]
Vrael -- CUT IT OUT
[05:24 pm]
Vrael -- HEY STOP BEING NICE
[05:01 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: actually I am mad after all, looks like you're gonna have to follow through
didn't I by posting the note?
[04:59 pm]
Ultraviolet -- actually I am mad after all, looks like you're gonna have to follow through
[04:59 pm]
Ultraviolet -- :lol:
[04:46 pm]
NudeRaider -- damn, and here I was prepared and got chatgpt to rephrase it a bunch of times for more people to join the bandwagon. :D https://anotepad.com/notes/7fk84xef
[04:33 pm]
Ultraviolet -- lol it's fine, I was just being sassy :P
[03:19 pm]
Vrael -- maybe my browser window didnt update or something funky
[03:19 pm]
Vrael -- lol sry UV, I must not have read that? I couldve sworn I was the next person to say something after CAFG but clearly based on timestamps I was 4 hours later
[03:18 pm]
Vrael -- :teach:
Please log in to shout.


Members Online: RIVE, Roy