How do you save the event queue?
Moderator: OpenTTD Developers
How do you save the event queue?
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?
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?
Thank you for your help, I will try something similar.
Who is online
Users browsing this forum: No registered users and 5 guests