Difference between revisions of "Category talk:Variables"

1,135 bytes added ,  14:34, 27 March 2008
→‎Overhaul: Specific suggestions
imported>Haama
m (→‎Overhaul: Fixed link)
imported>Haama
(→‎Overhaul: Specific suggestions)
Line 24: Line 24:
:"...a global long is not the same as a scripted long" - How so?  In my experience '''''all''''' variables are stored as floats, not just globals.  Shorts ''aren't'' restricted to the +/-32k range you'd expect from a signed int16.  Longs ''do'' have precision issues that you wouldn't expect from an int32.  This is why personally I've dropped both of them, and simply use "int" now. --[[User:Speedo|Speedo]] 15:45, 25 March 2008 (EDT)
:"...a global long is not the same as a scripted long" - How so?  In my experience '''''all''''' variables are stored as floats, not just globals.  Shorts ''aren't'' restricted to the +/-32k range you'd expect from a signed int16.  Longs ''do'' have precision issues that you wouldn't expect from an int32.  This is why personally I've dropped both of them, and simply use "int" now. --[[User:Speedo|Speedo]] 15:45, 25 March 2008 (EDT)
::See the notes on the [[Globals]] page - essentially the number returned will never be truncated as with script variables. A good example would be the [[Special variables|Special Variable]] GameHour.--[[User:Haama|Haama]] 16:10, 25 March 2008 (EDT)
::See the notes on the [[Globals]] page - essentially the number returned will never be truncated as with script variables. A good example would be the [[Special variables|Special Variable]] GameHour.--[[User:Haama|Haama]] 16:10, 25 March 2008 (EDT)
:::Thinking about this again - could it be that all variables are stored as floats, but not always used as floats? I've had problems with short variables and EffectCodes before that were fixed by changing the variables to longs. More specifically on globals - in script they are always treated as floats, even if marked as short or long; however, what about quest conditions, dialogue conditons, and result scripts?--[[User:Haama|Haama]] 15:34, 27 March 2008 (EDT)
:::Some more specific overhaul suggestions:
:::*Have a variable splash page that explains Global variables and Script variables, with a special warning on Game Settings
:::**Script variables - splash page with details on usage, declaration, variables init at 0 but will stay at whatever setting when script is called again (that info would have been great when I started), variable indexes including deleting and adding back a variable and adding variables in master/child situations, types (might make these into separate pages), should probably include the set function as well
:::**Global variables - Those pages are pretty good, so I don't think they need to change
Anonymous user