Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: How do I make unlimited death counters?
How do I make unlimited death counters?
Dec 3 2012, 7:31 pm
By: FlameViper  

Dec 3 2012, 7:31 pm FlameViper Post #1



How do I preserve death counters in a really effective way?
I need a huge amount of death counters that don't conflict. They're for a spell-based game like WAF, Naruto, etc. where I can't use wait triggers.
I also need to use them for timers.

Post has been edited 2 time(s), last time on Dec 3 2012, 7:43 pm by FlameViper.



None.

Dec 3 2012, 7:38 pm JaFF Post #2



Depends on your situation. Describe in detail what you want to do.



None.

Dec 3 2012, 7:40 pm DevliN Post #3

OVERWATCH STATUS GO

Add 1 death.
Preserve trigger.

We need to know what you're actually trying to accomplish, though.



\:devlin\: Currently Working On: \:devlin\:
My Overwatch addiction.

Dec 3 2012, 7:43 pm Azrael Post #4



You could look here, this may answer your question: Death Counters

For anything more detailed, you'd have to be more specific.

Edit:

Quote from FlameViper
I need a huge amount of death counters that don't conflict.

Can you afford to simply use a different unit for each one, maybe even different players? I recently had a map that needed to use 40 nonconflicting death counters as timers across 8 players, I just used 40 different units for it.

Post has been edited 1 time(s), last time on Dec 3 2012, 7:49 pm by Azrael.




Dec 3 2012, 7:49 pm DevliN Post #5

OVERWATCH STATUS GO

Quote from FlameViper
How do I preserve death counters in a really effective way?
I need a huge amount of death counters that don't conflict. They're for a spell-based game like WAF, Naruto, etc. where I can't use wait triggers.
I also need to use them for timers.
In that case, you basically have every unused unit at your disposal to use as a death counter.



\:devlin\: Currently Working On: \:devlin\:
My Overwatch addiction.

Dec 3 2012, 7:49 pm jjf28 Post #6

Cartography Artisan

Your question needs clarification - what exactly are you trying to do or optimize with/about your counters?

Quote from FlameViper
How do I preserve death counters in a really effective way?

If you just want death counters that behave well, you should use units that cannot be in the game (like Cantina's) or units that will never die in the game (like mineral fields).

Quote from name:Thread Title
How do I make unlimited death counters?

There are limits to how much easily manipulable data you can store in a given broodwar map, making unlimited counters is in-feasible.

- A death counter will store a value between 0 and (2^32)-1.
- Each unit is worth eight* death counters, one for each player.

*Technically you can have death counters for p9-12, but you have to actually kill units for them, making them much less useful.

You can add more storage capacity to a death counter by logically combining it with other death counters or value holder. Say you wanted to double the max number stored in a death counter; A switch holds either 1 (set) or 0 (cleared), you could say that for all numbers greater than or equal to 2^32, switch 1 will be set, and for all numbers less than 2^32, switch 1 will be cleared (or that the value of switch 1 is equal to its given value * 2^32).

To check for the value (2^32+4) you would then have conditions:
Code
Switch 1 is Set
DeathCounter is exactly 4


Edit:
Quote
I need a huge amount of death counters that don't conflict.

Oh, here's a huge list ;)

Code
Goliath Turret
Tank Turret type 1
Nuclear Missile
Alan Turret
Duke Turret type 1
Duke Turret type 2
Tank Turret type 2
Scanner Sweep
Protoss Scarab
Unused type 1
Unused type 2
Map Revealer
Disruption Field
Unused Terran Bldg type 1
Unused terran Bldg type 2
Uraj Crystal
Khalis Crystal
Unused Zerg Bldg
Protoss Unused type 1
Protoss Unused type 2
Khaydarin Crystal Formation
Mineral Field (Type 1)
Mineral Field (Type 2)
Mineral Field (Type 3)
Cantina
Mining Platform
Independent Command Center
Independent Starport
Jump Gate
Ruins
Vespene Geyser
Terran Marker
Protoss Marker
Zerg Beacon
Terran Beacon
Protoss Beacon
Zerg Flag Beacon
Terran Flag Beacon
Protoss Flag Beacon
Dark Swarm
Floor Hatch (UNUSED)
Left Upper Level Door
Right Upper Level Door
Left Pit Door
Right Pit Door
Start Location
Flag
Young Chrysalis
Psi Emitter
Data Disc
Khaydarin Crystal
ID:228


Post has been edited 1 time(s), last time on Dec 3 2012, 7:55 pm by jjf28.



Rs_yes-im4real - Clan Aura - jjf28.net84.net

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Dec 3 2012, 10:19 pm Vrael Post #7



Quote
How do I preserve death counters in a really effective way?
Write down which counters you use, and what you use them for, and what range of values they can take.

For example, take the unused unit Cantina:

Cantina:
P1 0 = off; 1-43 Firebolt spell
P2 0 = off; 1-43 Firebolt spell
..
P6 0 = off; 1-43 Firebolt spell
P7 0-155 Timer
P8 0-215 Timer

If you have all this information stored and you know it, then you know you can code a 2nd spell or something in values 44+, as long as that spell can't be run at the same time as Firebolt, and you know its completely gone for P7/P8 since you're using it for a timer. However, you do have to be careful. If you code a 2nd spell in values 44+ and some of the firebolt conditions are "at least X deaths of firebolt for P1-6" then some of the firebolt conditions will be true when this hypothetical 2nd spell is going off, but if you just account for it with an "at most 43 deaths" condition, you can safely reuse these death counters if you know Firebolt and Spell 2 can't be used concurrently.



None.

Dec 4 2012, 12:18 am rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!

I recommend for simplicity's sake:

If:
Player has suffered exactly 0 deaths.
Then:
Run actions
Set deaths to 250

And always subtract 1 from deaths.

This way, all your conditions will be the same, your actions will determine the cooldown. It's also very similar to wait in that regard, as waits are in the action as well. Finally, "subtract 1" will never go lower than 0, so your death counts are auto limiting, and by default the map starts out with 0 for all death counts, meaning all triggers would be ready to fire without waiting at the beginning of the game. If you want to reset the cooldown, just set to 0 (easier than adding 9999).



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 4 2012, 1:32 am BiOAtK Post #9



Quote from rockz
I recommend for simplicity's sake:

If:
Player has suffered exactly 0 deaths.
Then:
Run actions
Set deaths to 250

And always subtract 1 from deaths.

This way, all your conditions will be the same, your actions will determine the cooldown. It's also very similar to wait in that regard, as waits are in the action as well. Finally, "subtract 1" will never go lower than 0, so your death counts are auto limiting, and by default the map starts out with 0 for all death counts, meaning all triggers would be ready to fire without waiting at the beginning of the game. If you want to reset the cooldown, just set to 0 (easier than adding 9999).
Oh my god, that's so useful, I can't believe I never thought of that...



None.

Dec 24 2012, 7:16 am samsizzle Post #10



Or you could scratch all that shit and just learn to use OreoTriggers which does a great job preserving as many DCs for you as it can. Without you having to keep track of anything.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:15 am]
IlyaSnopchenko -- Or was it a switch :)
[06:59 am]
IlyaSnopchenko -- But I need to do more work on the system to make it look better (hard to explain without showing the map and explaining precisely what i added them for)
[06:57 am]
IlyaSnopchenko -- I've added set death hypertriggers
[2019-8-25. : 4:02 am]
Pr0nogo -- single frame hypers with a simple line of code without using EUDs imo
[2019-8-24. : 11:01 pm]
Suicidal Insanity -- They never go to bed on time
[2019-8-24. : 9:49 pm]
NudeRaider -- But why would you even want to do that? Hypers have almost no downsides.
[2019-8-24. : 9:49 pm]
NudeRaider -- IlyaSnopchenko
IlyaSnopchenko shouted: A stupid question: can I run hypertriggers for just one phase in the map, not all of it (I know I can... just wanting to know if there are any caveats)
you can, but you'd need to run switched hypers. Classic hypers can't be stopped afaik.
[2019-8-24. : 4:42 pm]
TF- -- It should be fine
[2019-8-24. : 3:41 pm]
IlyaSnopchenko -- Is that a yea or nay? :)))
[2019-8-24. : 3:36 pm]
TF- -- 🤙🏾
Please log in to shout.


Members Online: Roy, BeatMeistro