On Thu, 2010-12-02 at 06:41 +0200, Vlad Dragu wrote: > [vlad] I think it can work. I'll probably have to make the mission > engine a singleton so i can access the same instance of it anywhere. > But if i do it this way i don't think i need to serialize the mission > at all. The only information i actualy use from the mission is the > action queue. It tellm me what action should i listen for and what > function should i launch when the action is performed. If i store each > action in the database, then i don't think i'll need to serialize the > mission, no? > Or do you think that on later mission the editors would want to be > able to set some additional vars and be able to remember what the > value for those vars are?
Yes, it's nice to leave this option to the mission creator, I think it will get especially useful to polish the missions or when they get more complex (remembering that the player already did something, storing a value that the player entered in a google search, etc). Ah, while we talk about serialization - I ran into a nasty bug yesterday that took me a while to figure out, so just in case: if you need to use the __sleep() method, have a look at http://www.sematopia.com/2006/03/how-to-use-__sleep-to-serialize-your-class/ Xavier. _______________________________________________ Farsides mailing list - [email protected] Wiki: http://farsides.com/ List: http://farsides.com/ml/ Forum: http://farsides.com/forum/ Ideas: http://farsides.com/ideas/ Chat: http://farsides.com/chat/

