I only know this one (not suitable):
http://www.rpgmakervxace.net/topic/18060-local-switches-variables/
And I can't find any other.
But if each event has it's own interpreter. How can they then 'share' custom data like an attr_accessor? It's not static right?
This works (bad coding no alias I know but just for testing):
class Game_Interpreter #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :map_id # Map ID attr_reader :event_id # Event ID (normal events only) attr_accessor :local # <<<<<<<<<<<<<<<< #-------------------------------------------------------------------------- # * Object Initialization # depth : nest depth #-------------------------------------------------------------------------- def initialize(depth = 0) @depth = depth check_overflow clear @local = {} # <<<<<<<<<<<<<<<< end.....
Btw, I don't care that another event can also access
local[:a]. I mean, in C++ you also assign/clear a variable BEFORE you use it anyway. I don't find that troublesome. And as long as parallel events add a prefix (like their event_id) it should be fine... Now that I think about it.. I could code a super simple script that adds the event_id as the prefix. But how do I do the following?:
#@local istypeof Hashclass Game_Interpreter def local[key] @local[event_id+key] end def local=(key, value) @local[event_id+key] = value endendI don't know how to make a custom getter/setter for a hash. I can't find it on Google either (only for classes).