Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Adding negative numbers
[SOLVED] Adding negative numbers
Jul 13 2011, 10:39 pm
By: iCCup.xboi209  

Jul 13 2011, 10:39 pm iCCup.xboi209 Post #1



I'm trying to go through EUDs a little further and want to know how to use negative values



None.

Jul 13 2011, 10:46 pm Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

I think very high numbers will be interpreted as negative values.




Jul 13 2011, 10:48 pm iCCup.xboi209 Post #3



So how do i convert a negative value to a really high number then?



None.

Jul 13 2011, 11:05 pm Roy Post #4

An artist's depiction of an Extended Unit Death

Numbers higher than a signed integer's max value will overflow into a negative number. You are limited to this number as the highest value (2147483647). If you enter a number higher than that, it will overflow and add the extra from -2147483648. An unsigned int's max value is something like 4294967295, so you can pretend that this is the highest value possible, even though it will read as -1.

What are you trying to do? Why do you need a negative value?

Edit: numbers were way off :P

Post has been edited 2 time(s), last time on Jul 14 2011, 2:18 am by Roy.




Jul 13 2011, 11:31 pm iCCup.xboi209 Post #5



http://farty1billion.dyndns.org/EUDDB/?pg=entry&addr=7135188
Looking at game speed and want to try -1(i know to use eud actions)



None.

Jul 14 2011, 12:34 am Roy Post #6

An artist's depiction of an Extended Unit Death

I doubt that will work. Anyway, you can't directly enter the negative sign into SCMDraft, but you can copy/paste a negative number into it without a problem.




Jul 14 2011, 2:01 am O)FaRTy1billion[MM] Post #7

👻 👾 👽 💪

-1 is equal to 4294967295. If you add one to 4294967295 (or -1) you get 0. If you add -1 to 0 you get 4294967295.
0 and 4294967296 are the same number since 4294967296 does not fit into 32 bits.

The easiest way to convert negative numbers to unsigned numbers is to put the negative number into windows calculator (scientific mode) and hit the Hex button, hit Dword, then switch back to Dec.
The range of signed numbers is -2147483648 to 2147483647.

Math between signed and unsigned numbers is exactly the same, they are treated the same.

Post has been edited 1 time(s), last time on Jul 14 2011, 2:07 am by FaRTy1billion.



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!

Jul 15 2011, 3:50 am Heinermann Post #8

SDE, BWAPI owner, hacker.

Any game speed value that isn't 0-7 will be an overflow/underflow itself, since that's not actually the speed, but a speed index.




Jul 15 2011, 2:39 pm FoxWolf1 Post #9



Quote from Roy
I doubt that will work. Anyway, you can't directly enter the negative sign into SCMDraft, but you can copy/paste a negative number into it without a problem.

Actually, there's a trick that will make SCMD2 give you a negative sign...in Classic Trigedit, if you just hold down the "9" key until the field fills up, it'll turn into -1 when you hit enter. This gives you a functioning negative sign that you can use to input a negative number (or copy to the clipboard in order to put somewhere else).

Very handy when making a trigger for adding negative minerals/score-- which you might want to do because, unlike subtracting, adding a negative can result in a negative quantity. But that's besides the point...



None.

Jul 15 2011, 5:40 pm Azrael Post #10



Quote from FoxWolf1
Very handy when making a trigger for adding negative minerals/score-- which you might want to do because, unlike subtracting, adding a negative can result in a negative quantity.

You are just full of useful information, this is a trick I wasn't aware of ^^ Thanks for throwing that out there.




Jul 15 2011, 6:11 pm jjf28 Post #11

Cartography Artisan

yea, that trick is going to simplify balancing math :)



TheNitesWhoSay - Clan Aura - github

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

Jul 15 2011, 11:44 pm Alerek Post #12



Quote from FoxWolf1
Quote from Roy
I doubt that will work. Anyway, you can't directly enter the negative sign into SCMDraft, but you can copy/paste a negative number into it without a problem.

Actually, there's a trick that will make SCMD2 give you a negative sign...in Classic Trigedit, if you just hold down the "9" key until the field fills up, it'll turn into -1 when you hit enter. This gives you a functioning negative sign that you can use to input a negative number (or copy to the clipboard in order to put somewhere else).

Very handy when making a trigger for adding negative minerals/score-- which you might want to do because, unlike subtracting, adding a negative can result in a negative quantity. But that's besides the point...
Thats a very nice trick xD, I never knew adding a negative number would actually end up bringing it below 0.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:19 am]
Linekat -- cool
[01:56 am]
Oh_Man -- cool bit of history, spellsword creator talking about the history of EUD ^
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[2024-4-19. : 10:41 am]
v9bettel -- Nice
[2024-4-19. : 1:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[2024-4-18. : 10:11 pm]
Ultraviolet -- :P
[2024-4-18. : 10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
Please log in to shout.


Members Online: Moose, Roy