What's the best way to write a script engine? ( I mean the engine should understand scripts written in .dat files, like LoadMap(map1.map), Pos(2,3) and that stuff ) .. And which functions should I think about before starting to write the engine?
What's the best way to write a script engine? ( I mean the engine should understand scripts written in .dat files, like LoadMap(map1.map), Pos(2,3) and that stuff ) .. And which functions should I think about before starting to write the engine?
There is no "best way". Do what is neccessary for your game. I personally like a Lisp/Scheme like syntax. Parsing is very easy thanks to the parantheses and all statements/operators have the same syntax: (OP ARG1 ARG2 ... ARGn)
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.