QUOTE (Adrien. @ Aug 31 2011, 08:38 PM)
we all know you can do $someName = SomeClass.new()
But what if you had:
def class SomeClass
#bunch of methods and code
and wanted to make it so that instead of going SomeClass.new all the time or $someName = someClass.new in script calls or scripts you extend or create you would go $someName.new or $someName.someMethodCall
Where in the above code example would I create the global variable?
Well, as an example of something I did in RMXP, I created a class called "Class_Control" to control changes to a character when their class changes.
In game_system I placed this code:
$game_cc = Class_Control.new
And then, I can, for example, call this script from an event:
I'm not sure what changes are in RGSS2 but it's still in ruby. So make a global instance of the class in the system script (or any similar script..Scene_Title perhaps), then you can use that wherever you'd like.
Hope that helps.