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.
[06:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[06:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[06:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[06:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[06:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
[06:48 pm]
Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
[06:47 pm]
Vrael -- Do you know anyone with a deep understanding of the unique characteristics of your carpets, ensuring they receive the specialized care they deserve?
[06:45 pm]
NudeRaider -- Vrael
Vrael shouted: I've also recently becoming interested in Carpet Cleaning, but I'd like to find someone with a reputation for unparalleled quality and attention to detail.
beats me, but I'd make sure to pick the epitome of excellence and nothing less.
[06:41 pm]
Vrael -- It seems like I may need Introductions to multiple companies for the Topics that I care deeply about, even as early as Today, 6:03 am.
[06:38 pm]
Vrael -- I need a go-to solution and someone who understands that Carpets are more than just decorative elements in my home.
Please log in to shout.


Members Online: Roy