View Single Post
  #183    
Old October 24th, 2011 (12:40 PM).
DavidJCobb
RESIDENT RAAAAAAAAAAAAGEMASTER
 
Join Date: Jul 2010
Gender: Male
Nature: Lonely
Quote:
Originally Posted by SupahNinja View Post
Does this mean that vars under 4000 are safe to use?
Variables under 4000 can't be used because:
  • They overlap RAM used for flags
  • Most script commands don't recognize them as variables
    • Most commands basically do this: "If argument > 0x3FFF, then find the value of variable number argument and use that value. Else, use argument itself as a value."
Quote:
Originally Posted by SupahNinja View Post
Does this mean that vars in betwen 408B and 5EF4 are safe to use?
Some of them have been confirmed unsafe since I last updated that document. The rest are a mystery and could be safe or unsafe.
  • Variables 0x4100 to 0x417F (inclusive) overlap the RAM used for a special data type called "hidden variables" -- a set of 64 dwords used by certain script commands whose purpose is unknown.
  • Variables 0x5084 to 0x55CC overlap RAM used for seemingly-arbitrary data. I haven't noticed any ill effects from overwriting this data, but it changes frequently, so the variables themselves are unreliable.
  • Variables 0x56F4 - 0x5EF3 appear to also overlap RAM used for the PC. This doesn't match with JPAN's findings (the 0x5EF4 figure is from him) so either one of us is wrong, or this variable range overlaps non-essential parts of the PC data.
My suspicion -- an unconfirmed one -- is that the only safe variables are those from 0x4000 to 0x40FF (inclusive), excluding variables in that range that are set or read by the core game engine (as opposed to those used by scripts that can be safely removed).

Basically, you're better off keeping your variables to a minimum. If you find yourself running short on variables, see if flags (or perhaps key items) could be used instead of variables to track the player's progression through different scripts.
__________________
Reply With Quote