Saving Functions to JSON-file, what happens?
Posted: Fri Nov 14, 2025 5:19 pm
I just noticed I had used in some cases something like:
When I save this as JSON file, and then load it later, will both these functions still work, or do I need to take something into account, or even separate data and functions so that I can just save/Load data and function are elsewhere.
Would have done this separation right from beginning, had I realised that my simple save/load method would include all these functions too, and now wondering If I should do that now afterwards, which luckily wouldnt be terribly big task.
Code: Select all
Creature = {X=10, Y=10}
Function Creature.Move()
Creature.X = Creature.X + 1
Creature.Y = Creature.Y + 1
EndFunction
Function Creature:Bark()
Debugprint("Wof!")
EndFunctionWould have done this separation right from beginning, had I realised that my simple save/load method would include all these functions too, and now wondering If I should do that now afterwards, which luckily wouldnt be terribly big task.