From: Martin DeMello Date: 2012-05-10T11:33:42+09:00 Subject: Re: game development in ruby I would not use marshall to do this, specifically because, as you say, it makes it hard to keep track of transient state. Instead, spend some time implementing a serialize/deserialize method for each of your game objects (using json, for instance), at which point you will have very precise control over what aspects of your world get loaded and saved, and what setup code you need to run when importing a saved state. If you post some code I could give you more specific suggestions. martin On Wed, May 9, 2012 at 6:40 PM, Zachary Pearson wrote: > Hi, Im fairly new to ruby, and as an exercise of what i've learned and > an attempt to further understand ruby, i have decided to create a text > based RPG. I've been able to get pretty far with virtually no trouble, > but i have ran into a problem. I am having some trouble with the save > mechanism. the way it works is that it only saves the state of the areas > that you have the ability to travel to. but in certain areas, events are > triggered based on objects in the your inventory/environments. the > trouble i've been having is if you save once you're able to travel to > the areas, but exit the game before the events are triggered, when you > get back on, the game doesnt recognize the objects as being present and > as a result the events that should be triggered arent triggered. I'm > thinking that when it saves, it saves the object with a specific > address, but when the game loads, it loads expecting a new/different > address and doesnt recognize the old/saved address. but thats just a > guess, im not sure if thats actually whats going on. right now, im using > marshal.dump to save and marshal.load to load. would anyone have any > thoughts on this? > > -- > Posted via http://www.ruby-forum.com/. >