HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Maximum value of Unit Custom Value

12-19-2005, 12:25 PM#1
qwertyui
Which value is the maximum value possible to have as a unit custom value?
12-19-2005, 12:52 PM#2
Zoxc
Generaly the maxium integer value.

I thinks its 2147483647, but im not sure....
12-19-2005, 01:14 PM#3
iNfraNe
I guess what you are asking for the the maximum integer value.

I did this little test:
Code:
function test takes nothing returns nothing
loop
set udg_i = udg_i + 1
endloop
endfunction
function Test1 takes nothing returns nothing
local integer i = 0
loop
exitwhen i > 8000
call ExecuteFunc("test")
set i = i + 1
endloop
endfunction
It took me ages to wait and then to display it I used this:

Code:
asdf
    Events
        Player - Player 1 (Red) skips a cinematic sequence
    Conditions
    Actions
        Game - Display to (All players) the text: (String(i))
        Set i = (i + 1)
        Game - Display to (All players) the text: (String(i))
My result was this: The game gave me two numbers 342898857 and 342898857 Then I started with that number and tried it again (know that each run takes over 3 minutes :)) so after I while still havent reached the limit I started adding 0's after the number and noticed the number flipped to negative, which seemed weird to me, but I thought I'd find the flipping point.
So I tried powers of 2 that seemed logical and found out the the maximum integer number is 2147483647, which is 2^31 - 1. After this is will become negative.

So yes, zoxc is right (I started this stuff b4 he answered -.-) And I know my method at first was stupid but I thought it would be somewhat lower then this...
12-19-2005, 01:17 PM#4
Zoxc
I just checked Delphi help file :P Thought it applied to all programming languages or something is wrong with Borland.
12-19-2005, 01:54 PM#5
Blade.dk
By the way, what language is wc3 and JASS made with? What is it based on?
12-19-2005, 01:59 PM#6
qwertyui
Thats a 32 bit integer then

Does anyone know if its dependent on individual machine?

I mean, will, on some very very old comp, it be 16 bit integer? Or a comp that long simply won't be able to run wc3?


The reason i want to know is that that's effectively an open space to store 32 flags about unit's current state. Which i really want to use in my new map project.
12-19-2005, 03:15 PM#7
Zoxc
Its made in C++ Using DirectX SDK I belive.
12-19-2005, 04:25 PM#8
Vexorian
I think it could be C actually, blizzard never talks about that though
12-19-2005, 05:05 PM#9
Starcraftfreak
I could have told ya without testing that it's a signed 32-bit integer.

Quote:
Originally Posted by qwertyui
Does anyone know if its dependent on individual machine?

I mean, will, on some very very old comp, it be 16 bit integer? Or a comp that long simply won't be able to run wc3?
It's not machine-dependant. It cannot. You can't run 32-bit apps under Win16 (lets set aside that those CPUs would be way too weak anyway, even if they were capable of 32-bit). Under Win64 WC3 will run as a 32-bit app in Microsofts WoW64 emulator (which is just as fast as under Win32, since the CPUs support both modes natively). Additionally it also runs under Mac OS, which use PowerPC CPUs from IBM, which are a bit different compared to x86. And yes, I know, that they will switch to Intel (and therefore x86) next year.

The bottom line is that what you want to do will work on any machine that runs WC3 once its properly implemented. Imagine what would happen, if WC3 worked machine-dependant. Happy desync I'd say

Quote:
Originally Posted by Zoxc
Its made in C++ Using DirectX SDK I belive.
At the very least they used OpenGL (for Mac and also Windows) and some Mac developer tool too (at least a compiler).

@Vexorian:
I'd rather say C++. Nobody writes games in C those days. Though you never know, given how f*cked up JASS is
12-19-2005, 05:34 PM#10
Blade.dk
I looked at the read me html that comes with the game, somewhere it says something like (C++ rules!!) so I guess that's what they made it with. I'm not sure at all though.
12-19-2005, 06:48 PM#11
N00byStance
If it had at least a bit more from C... I would be so thankful!
12-19-2005, 06:52 PM#12
Zoxc
Hello looks who's here! Welcome to Wc3c N00byStance

Wc3 made in JASS
12-19-2005, 07:28 PM#13
Vexorian
Wc3c was made in JASS

well the whole rules for melee stuff

I said it could be C cause JASS is not too object oriented the way JASS works sounds as the dummy object orientedness you end up using when you make stuff in C so it could be that JASS is like that because its developer's liked C style more.

But I don't know it could be C++ too
12-19-2005, 10:11 PM#14
Starcraftfreak
Quote:
Originally Posted by Vexorian
Wc3c was made in JASS

well the whole rules for melee stuff

I said it could be C cause JASS is not too object oriented the way JASS works sounds as the dummy object orientedness you end up using when you make stuff in C so it could be that JASS is like that because its developer's liked C style more.

But I don't know it could be C++ too
Jass is so dumb because it was a rushjob.

Or better: They didn't want to do it better. It was way better than the SC-Trigger Editor so why bother making it perfect. It was designed for implementing the features Blizzard needed. Not really anything more. Thats why we tap into so many stupid limitations.
12-19-2005, 10:50 PM#15
iNfraNe
Stupid limitations like what... I have found no real "stupid" limitations. Only "understandable" limitations like.. not being able to make it into a different gametype without ruining the game for bnet play (lag ownz).

For all other limitations you just have to be a little more innovative, which is good for the brain every now and then.

Wc3 has the best editor I have ever seen and I wonder what will top it. I dont call it lazyness they didnt make jass a full scripting language, I thank them for making us able to mod wc3.