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.
[02:30 am]
Symmetry -- I dreamed about that as a kid. The idea of a computer capable of analyzing a starcraft map and calculating the fastest possible way to hit the victory condition
[02:29 am]
Symmetry -- But can AI beat my custom maps?
[12:32 pm]
Oh_Man -- yea APM vs eAPM
[08:48 am]
NimoStar -- plus most of the human APM is just spam clicking APM inflation
[08:47 am]
NimoStar -- the thing with the "*12" thing is completely misleading. The AI isn't using two control groups, it can use each of those actions to command a single unit individually and issue different commands to each single unit.
[08:06 am]
NudeRaider -- NudeRaider
NudeRaider shouted: Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
*Pluto's wraiths
[08:05 am]
NudeRaider -- Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
[2026-9-22. : 2:18 am]
Oh_Man -- Close enuf
[2026-9-21. : 4:14 pm]
Vrael -- perhaps there is a small professional player trapped in a box in the server rack where pluto is running? hmm?
[2026-9-21. : 4:14 pm]
Vrael -- 240*12*2 is 5760, where is the other 240 APM?
Please log in to shout.


Members Online: MobMob