Page 1 of 1

How do you save the event queue?

Posted: 23 Dec 2009 11:51
by Brumi
I'm trying to implement save/load for SimpleAI and I'm stuck with saving the event queue. Now if the game is saved when the AI is busy, events waiting at the time will disappear and therefore won't be handled. So is there an easy way to solve this?

Re: How do you save the event queue?

Posted: 23 Dec 2009 15:45
by Yexo
I'm sorry I don't have to time to search through my own code now, but AdmiralAI does handle this case. Take a look at the save and load functions in main.nut. If I remember correctly it fetches all events to a local queue, when saving it saves that queue and when handling events it first adds all events to that internal queue before handling them.

Re: How do you save the event queue?

Posted: 24 Dec 2009 06:49
by Brumi
Thank you for your help, I will try something similar.