I have written a little 2D editor for my upcoming game. The editor is external to the game and written with Qt. It has things like Tile loading with any size and tranformation, paths, etc... But there's a missing part that is one of the big problems in any editor: the entity editor.
I can load entities and position them in the world in a static way (no animation, I don't need it). But I would like to add triggers that run actions on the entities or run a cutscene, etc... For example I would like to set a lever in the world and a wall and bind the lever on event to the wall open action. I have been thinking all day about how to do this and haven't come to any good solution.
At the moment the editor loads a set of entities templates in xml, where things like what events can throw and what actions can execute. are set And can produce an xml like this for the event association:
<Entity type="Lever"> <Signal Name="On"> <Listener Name="Door1" Action="Open" /> </Signal> <Signal Name="Off> <Listener Name="Door1" Action="Close" /> </Signal></Entity>
The problem is to use this in a clean way in C++, and as I have said couldn't be able to find a good solution. I'm using boost signals if it is of any help. In the other hand don't know if using a scripting language could help on this beause its more flexible nature.
Sorry for the long post, if you need any other help let me know.
Thanks in advance,
HexDump.