Map-based object scripting?
Hi, I am a fair way down the line of coding a script interpreter for my mapping engine. It works along similar lines to the StarCraft map script engine (When is do , ... ). There are a lot of conditions and a lot of actions (conditions based on time, score, player position, player position relative to objects, other object positions relative to other objects... and a fair number of actions along the lines of createobject@x,y, killobject, moveobject, increasestat x by y points, decreasestat x by y, etc.).
These scripts can be attached to the map globally or to individual objects on the map.
The main reason for this being, you can create new enemies with special scripts or you can make a highly dynamic map because things can move around or be replaced.
My issue is that I have never really spent any time developing interpreters and so I am getting very confused and my code is getting hectic and sluggish (frame rate is dropping from 60 to 20). At the moment I am storing the scripts as text and then parsing them for the event. Once the event is extracted I have a huge If structure that checks what type of event is being specified. Once this has happend, the code goes on to check if the event should be fired (condition=true) and then goes on to try and figure out what actions need to be taken and execute them.
It strikes me as the only way to do this kind of thing but... man are my eyes and fingers getting tired!
Anyhow, if anyone has any references, ideas, insights or caveats I would appreciate a note.
Thanks
I have plenty of talent and vision, I just don''''t give a damn.
'Doing the impossible is kind of fun' - Walt Disney
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement