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.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: RexyRex