i noticed that in quake, the AI is written as a set of functions, with one function for each frame.
in each function, it tells the game which to call next. it looks something like:
attack1(){ modelframe =1; nextthink=attack2;}
attack2(){modelframe=2; nextthink = attack3; damage(enemy); nextthink=run1}
and so on.
if you save, say, in mid-attack, and load, the enemy will be in exactly the same position he was when you save.
however, i think that if you write the AI as one large function, when you load, the enemy will revert to idle position and have to spot you again.
is there any way to preserve the progress of an enemy when you save other than frame functions?
maybe if you serialize while the method is still executing, or will that cause an error?
or should i use an interpreted script?