Page 1 of 1

Which variable is "do not use" - 32 or 33?

PostPosted: Sun Aug 09, 2009 7:39 am
by Stat Wrecker
...It comes up so rarely for me. MWSD doesn't mention it in the varables section and Google has been no help.

I have a script that has exactly 32 variables of the same type, and while I could just name three or four as "donotuse" variants, I'd really rather know which one it is than shoot blindly... :)

Which variable is "do not use" - 32 or 33?

PostPosted: Sat Aug 08, 2009 11:12 pm
by Nathan Maughan
Note: A long global is effectively a float! In a script, local to that script a long will have a full
32 bits of precision. But used as a global, the number of bits of precision drops to 24, as when
it exists globally a long is a float. Mental Elf discovered this when attempting to use "bit
packing" to get 32 flags into a global long (forum info / mental elf).

Please note that's directly from the MWSD9 document. Is that any help for you?

Which variable is "do not use" - 32 or 33?

PostPosted: Sat Aug 08, 2009 11:58 pm
by TOYA toys
...It comes up so rarely for me. MWSD doesn't mention it in the varables section and Google has been no help.
It is in the pitfalls section. MWSFD9 Pg 167

It is the 34th

Which variable is "do not use" - 32 or 33?

PostPosted: Sat Aug 08, 2009 11:02 pm
by Symone Velez
Please note that's directly from the MWSD9 document. Is that any help for you?


Thanks for the reply, but that's not really what I'm talking about. The differences between short and float are a matter of accuracy and the number of decimal places.

What I'm talking about is an oddity that occurs when you use 32 or 33 variables of the same type. It may have something to do with the flags, I don't know, but I don't think so. The question is whether the 32nd variable is safe to use then don't use the 33rd, or is it the 32nd can't be used skip to the the 33rd? Kind of like the "go on 3"quandry... Is it one, two, and go on three, or is it one, two, three, and then go...

Which variable is "do not use" - 32 or 33?

PostPosted: Sun Aug 09, 2009 10:25 am
by Del Arte
There are three types of variables in the TES script language: short, long and float. According
to the manual these cover the following data ranges:
Short -32,768 to 32,767 (signed integer)
Long -2,147,483,648 to 2,147,483,647 ( long signed integer)
Float 3.4E +/- 38 (float, 7 digits)
Apparently the boundaries for Long given here are only partly correct, in the TES-CS you can
assign a maximum value of 2147483520 (Forum info / Argent).
Theoretically there should be string variables too, but to my knowledge these are not
implemented. Unfortunately there are also no data types to store Object_Id's, which limits the
power of the scripting language to a certain extent.
Variables can be grouped into local variables (valid only in the script that declares them) and
global variables (valid in every script).

I think I found it.

Which variable is "do not use" - 32 or 33?

PostPosted: Sun Aug 09, 2009 6:33 am
by Danial Zachery
It is in the pitfalls section. MWSFD9 Pg 167

It is the 34th

Ah, I was wrong both ways... Thanks, I appreciate it.

I thought I had read that somewhere in MWSD, but when I went back through the variables section, I couldn't find it. I didn't think to look for the pitfalls section... :banghead:

Which variable is "do not use" - 32 or 33?

PostPosted: Sun Aug 09, 2009 1:28 am
by Rachel Tyson
I think I found it.

Thanks for your effort, but Yacoby got it.

Which variable is "do not use" - 32 or 33?

PostPosted: Sun Aug 09, 2009 12:54 am
by Sarah Unwin
And on the variable limits vein, I don't know about during the game, but in the save, everything is a float. Doesn't matter if it's a short, long or float ingame, it's saved as a single/float in the file.
Edit: Actually, there may be limitations on that. I don't remember. Something's funny about it, though.

Which variable is "do not use" - 32 or 33?

PostPosted: Sun Aug 09, 2009 2:16 am
by Marguerite Dabrin
And on the variable limits vein, I don't know about during the game, but in the save, everything is a float. Doesn't matter if it's a short, long or float ingame, it's saved as a single/float in the file.
Edit: Actually, there may be limitations on that. I don't remember. Something's funny about it, though.

I am seriously hoping we can get OpenMW to use Python. The inconsistency of this scripting language does my head in.