What is the purpose of doing it that way?
I wouldn't do it like that - mainly because I can't see what you're trying to achieve.
'$napoleon_data' or something therein would be a more RGSS standardized way to do what you are going for.
If you were going to do that, wouldn't you have to go through ALL the scripts and change any existing reference to $data_* to suit the new method of access? I'm assuming the intention is to package all the existing database into a single entity?
I think it would be with custom data going forward.
I wouldn't really change the existing database arrays, and don't see much need to.
if you would do something like Nap.data.x, you would need to make data into another type that has its own methods/data right?
anyway, I prefer the $ way simply because that's the ruby way of doing it...
I'm sorry for the confusion. $data (not $data_actors or something) does not exist yet and is not related to any existing data. It will contain my custom 'field-data' like the state of certain maps, global dialogues (4 self switches are not enough sometimes) and other things. I should have used another sample name for it I'm sorry...
It will contain basic classes and variables that eventually will be nested a few levels deep. Like
Nap.data.Elisabeth[:trainstation][:hallway_x][:color] = 16 # << probably this one
or
Nap.data.Elisabeth.trainstation.hallway_x.color = 16 # << like adiktuzmiko mentioned, probably too much trouble to make this and there is no code completion in the RGSS editor anyway to make good use of this.
I don't like using the build in $game_variable.
I don't really like the $ in front of it all the time for some reason and I will be typing that variable quiet a lot. Perhaps I will shorten it to $nfd (napoleon field data) instead. It's just personal preference.
Yes the abstraction is another future that the module approach brings. Especially for debugging purpose (now I can see exactly where and who is retrieving/setting the variable) and the extra function call is neglectable in terms of resource usage.
But it seems that either solution is 'proper' and that it is all a matter of personal preference.