Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Preserve trigger keeps spawning units
Preserve trigger keeps spawning units
Mar 16 2022, 2:57 pm
By: Sala  

Mar 16 2022, 2:57 pm Sala Post #1



I want a single unit to spawn every time a condition is met. For example, each time a Zergling dies, I want one more Zergling to spawn somewhere else. In testing when I kill a ling and preserve trigger is on, they just keep spawning lings nonstop. How do I solve this?



None.

Mar 16 2022, 5:50 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

The problem is that you can't modify kills counter. Maybe death counter works for you? You can modify that.




Mar 16 2022, 6:41 pm Prankenstein Post #3



Quote from Sala
I want a single unit to spawn every time a condition is met. For example, each time a Zergling dies, I want one more Zergling to spawn somewhere else. In testing when I kill a ling and preserve trigger is on, they just keep spawning lings nonstop. How do I solve this?

If you post the exact trigger you're using, it's easier to help.



None.

Mar 16 2022, 7:25 pm Sala Post #4



Quote from NudeRaider
The problem is that you can't modify kills counter. Maybe death counter works for you? You can modify that.

I can modify the death counter, but how do I use that death counter to continuously trigger an event? Do I just have to write 1,000 triggers for each possible number of deaths?

EDIT:
Quote from Prankenstein
Quote from Sala
I want a single unit to spawn every time a condition is met. For example, each time a Zergling dies, I want one more Zergling to spawn somewhere else. In testing when I kill a ling and preserve trigger is on, they just keep spawning lings nonstop. How do I solve this?

If you post the exact trigger you're using, it's easier to help.

Trigger("All players"){
Conditions:
Deaths("Current Player", :Zerg Zerglings", Exactly, 1);

Actions:
Create Unit("Current Player", "Zerg Zerglings", 1, "Respawn");
Preserve Trigger();
}

It's a problem that I can only choose "exact," "at least," or "at most" deaths, and not just have the trigger activate for any death. But even still, this causes nonstop Zergling spawn instead of just one.

Post has been edited 1 time(s), last time on Mar 16 2022, 9:02 pm by NudeRaider. Reason: pls edit instead of double posting



None.

Mar 16 2022, 8:08 pm Nekron Post #5



Youd need to subtract the death here




Mar 16 2022, 8:48 pm Sala Post #6



Quote from Nekron
Youd need to subtract the death here

You're a genius, I love you.



None.

Mar 17 2022, 12:45 am TheHappy115 Post #7



Depending on the circumstance, you may also want to change the condition to "at least 1 death" versus "exactly 1 death."

This would help solve issues should 2 Zerglings die at the same time resulting in the trigger not going off in the first case (unless you wanted something different to happen in that case). I imagine this could happen in cases where you want to increase the amount of Zerglings a player can control and die, and they remain with those same amount of units. This will only mean that 1 Zergling will spawn with each trigger check though. You can always increase the amount respawning at the same time by either duplicating the trigger or just adding a new one for cases where that happens. Duplicating the trigger shouldn't cause issues in the case where only 1 Zergling dies (because the condition on the first trigger will be satisfied and the action reduces the death count. Then the next trigger isn't satisfied since the previous one already set it to 0 deaths).



None.

Mar 17 2022, 5:20 am Sala Post #8



Quote from TheHappy115
Depending on the circumstance, you may also want to change the condition to "at least 1 death" versus "exactly 1 death."

This would help solve issues should 2 Zerglings die at the same time resulting in the trigger not going off in the first case (unless you wanted something different to happen in that case). I imagine this could happen in cases where you want to increase the amount of Zerglings a player can control and die, and they remain with those same amount of units. This will only mean that 1 Zergling will spawn with each trigger check though. You can always increase the amount respawning at the same time by either duplicating the trigger or just adding a new one for cases where that happens. Duplicating the trigger shouldn't cause issues in the case where only 1 Zergling dies (because the condition on the first trigger will be satisfied and the action reduces the death count. Then the next trigger isn't satisfied since the previous one already set it to 0 deaths).

Yeah the first thing I did was test with "exact" and when a group died at the same time, only one respawned. The "at least" setting fixed this.



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: Roy