Original Post
Hi,
I''m in the process of creating a scripting language specifically for my game''s maps and map objects. The idea being that my map editors can add objects to a map and then write behavioural characteristics for each object (and for the map as a whole). This would allow them to, for example, open doors when levers are switched, effect objects on other maps (if you blow up the power plant on this map, the mag-loc doors are open on another), change the default behaviour of enemies and so on.
The script language would be entirely event driven (OnGameTime, OnTouch, OnBring, etc.) with very simple commands allowing the editor to specify modifying other object''s properties and the player''s statistics. A very basic example would be something like this:
[RocketPack]
OnTouch
Player.RocketAmmo +10
End
But obviously, I wouldn''t use the script for simple item acquisition.
The problem I am facing is that the only other time I''ve done something like this, I used simple text parsing to interpret the script functions. That was a database app, and so the execution speed was not important. But, using text parsing functions is just too slow for a game, and I have no idea how to go about pseudo-compiling the script stuff to make it faster. Does anyone have any ideas for me?
The only thing I could think of was to give each operator, statement and event a unique ID and then convert the text script to numeric, which would be faster. But, this seems to still be a duct-tape method of solving the problem.