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.



TheNitesWhoSay - Clan Aura - github

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.
[04:31 pm]
Zoan -- where's the option to delete my account
[04:30 pm]
Zoan -- goodbye forever
[04:30 pm]
Zoan -- it's over, I've misclicked my top right magic box spot
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are some real members mixed in those latter pages, but the *vast* majority are spam accounts
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are almost 3k pages
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- the real members stop around page 250
[2024-4-14. : 9:20 pm]
O)FaRTy1billion[MM] -- look at the members list
[2024-4-12. : 12:52 pm]
Oh_Man -- da real donwano
da real donwano shouted: This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
it's pretty common
[2024-4-11. : 9:53 pm]
da real donwano -- This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
[2024-4-11. : 4:18 pm]
IlyaSnopchenko -- still better than "Pakistani hookers in Sharjah" that I've seen advertised in another forum
Please log in to shout.


Members Online: NudeRaider, Zoan, C(a)HeK, jjf28