Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Integer Variable (Preserved)
Integer Variable (Preserved)
Jan 7 2009, 9:44 pm
By: ZugZugZealot  

Jan 7 2009, 9:44 pm ZugZugZealot Post #1



This is a method that let's you store and use a Death Count value for anywhere from 0 to 1023, without making 1024 triggers to do so, it allows the value to be changed flexibly and used over and over. Though it may not seem useful, but in my opinion it'd be helpful for dynamic trigger damage.

The basic concept of it, is there's three variables (Death Counts). One to store the value (Var A), another that temporarily holds the value (Var B), and one that applies the value (Var C). What it does, is it deducts from Var A, and adds to Var B and Var C for the same amount, and does this until Var A is 0, then it will deduct from Var B and add to Var A for the same amount until Var B is 0, then Var C will be applied to whatever calls for it.

Note: I didn't comment it. I figured it'd be easier to look at the contents uncommented.

Attachments:
IntegerVariable.scx
Hits: 4 Size: 33.47kb



None.

Jan 7 2009, 9:46 pm Demented Shaman Post #2



It is a very useful concept, but it is also a very old one.

I myself have made extensive use of them in this map http://www.staredit.net/topic/32/

These maps also use them to perform math operations.
http://www.staredit.net/files/592/
http://www.staredit.net/files/276/



None.

Jan 8 2009, 1:09 am Falkoner Post #3



This is more commonly referred to as Binary Count-Offs, and as Devilesk said, it's pretty old: Copying with Binary Countoffs, and Math with Binary Countoffs have been being used for a while.
When you said 0-1023 did you mean that your map does that? Because they can go up to 2147483647(2^31 is the maximum death count value).



None.

Jan 8 2009, 1:59 am Heinermann Post #4

SDE, BWAPI owner, hacker.

Actually, I had to do a test on signed/unsigned values.

> Scores and counts will be displayed as signed in the leaderboard and top-right fields.
> Resources will be read as signed when determining if the player has enough resources to build something.
> These values will be read as unsigned in trigger conditions (AtMost, AtLeast).

A fix for this would be an additional condition of the opposite comparison for the maximum/minimum positive value.

To subtract values and run over 0, you can use add -1.




Jan 8 2009, 2:44 am Falkoner Post #5



So Starcraft uses signed longs for a lot of it's variables? The adding a negative is very interesting :P



None.

Jan 9 2009, 5:37 am O)FaRTy1billion[MM] Post #6

👻 👾 👽 💪

Quote from Falkoner
So Starcraft uses signed longs for a lot of it's variables? The adding a negative is very interesting :P
I've done it before, I think I've even told/shown you. ;o



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Jan 9 2009, 2:23 pm scwizard Post #7



Quote from Falkoner
So Starcraft uses signed longs for a lot of it's variables? The adding a negative is very interesting :P
Signed 4 byte integers for triggers and various other things. Signed 2 byte integers for a lot of other things. Unsigned 1 byte integers for a few other things and unsigned 4 byte integers for the size of a map section.



None.

Jan 10 2009, 6:54 am Heinermann Post #8

SDE, BWAPI owner, hacker.

I'm pretty sure you're making that up. It's unsigned for [most] conditions. signed for display and [most] actions.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
Please log in to shout.


Members Online: 9sophiec5285ep5, 8charlottee882wh3, newageofpower