I’m working on a project which requires save to be availiable anytime.
But I run “triggers” (self-made class Trigger) on this map, i.e; actions performed when a game-event is fired.
For example, a timer runs, indicating game time. An event can be “Every 2 seconds of game time” and the correspondaing trigger will be fired every 2 seconds.
This trigger will (or not) execute a method to determine whether the conditions are met for it to run. If yes, it will execute another method, representing the actions, on its own thread.
But if the game is saved, and the trigger’s actions are running, I need to save the actual context of the trigger (i.e., of the thread) and which method is being executed in the action method.
I also need to save which triggers are running, even if they just responded to the event and ran nothing.
Condition method has the same problem.
How would one achieve this?
Is there no other option than using a self-made script language, seen as self-made bytecode?