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

Post » Sun Aug 09, 2009 7:39 am

...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... :)
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am

Post » Sat Aug 08, 2009 11:12 pm

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?
User avatar
Nathan Maughan
 
Posts: 3405
Joined: Sun Jun 10, 2007 11:24 pm

Post » Sat Aug 08, 2009 11:58 pm

...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
User avatar
TOYA toys
 
Posts: 3455
Joined: Sat Jan 13, 2007 4:22 am

Post » Sat Aug 08, 2009 11:02 pm

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...
User avatar
Symone Velez
 
Posts: 3434
Joined: Thu Sep 07, 2006 12:39 am

Post » Sun Aug 09, 2009 10:25 am

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.
User avatar
Del Arte
 
Posts: 3543
Joined: Tue Aug 01, 2006 8:40 pm

Post » Sun Aug 09, 2009 6:33 am

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:
User avatar
Danial Zachery
 
Posts: 3451
Joined: Fri Aug 24, 2007 5:41 am

Post » Sun Aug 09, 2009 1:28 am

I think I found it.

Thanks for your effort, but Yacoby got it.
User avatar
Rachel Tyson
 
Posts: 3434
Joined: Sat Oct 07, 2006 4:42 pm

Post » Sun Aug 09, 2009 12:54 am

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.
User avatar
Sarah Unwin
 
Posts: 3413
Joined: Tue Aug 01, 2006 10:31 pm

Post » Sun Aug 09, 2009 2:16 am

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.
User avatar
Marguerite Dabrin
 
Posts: 3546
Joined: Tue Mar 20, 2007 11:33 am


Return to III - Morrowind