- Joined
- Jun 14, 2012
- Messages
- 98
- Reaction score
- 21
- First Language
- portuguese
- Primarily Uses
Sorry, i was going to elaborate on that but before i needed to test something and then i got sleepy haha. I don't know what omoney means by saving instances variables so i assume he just wants to save the value of @somevariable.Not sure why you would need to post to reaffirm a fact, also you can dump the information of nearly any object, so it is possible to save the contents of an instance variable.
Instances variables belongs to specific objects and can be referenced from any method of their class or subclass but the value of any unintialized instance variable is nil, so if he saves a instance variable when he loads the game that variable value will be nil. And if he initializes it again, it will recieve the first value he asigned and not the saved one.
There's another problem, he can't simply put the code below in make_save_contents:
Code:
contents[:test] = @test
The right way to save an instance variable is through accessors, seting them inside objects that will be saved. So you're not necessarily saving an instance variable but an atribute to that object.
I'm not sure if i explained it right (my english is not that good so it limits me...) or if i'm missing something but as far as i understand ruby and the rgss api, thats it.

