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.
[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
[03:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[01: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: RIVE, Ultraviolet