| A little problem triggering things... (Synopsis below)
I've been working on a RTS (real time strategy) video game for quite a while now, and have decided over time to implement a system of "triggers". Those with previous knowledge of such games would know that triggers are system used in games to tell things to perform actions when a certain event occurs in the game world. However, I'm rather clueless on where to begin with the implementation of this trigger system.
The way the trigger would work would be simple. One or a series of variables are tripped by other things in the game world (time passing, objects moving to a certain place, etc.), and the trigger then tells several events to occur as a result of this. (money being given or units being destroyed).
The problem I'm encountering in the early stages of implementation of this system is the dynamic nature of the variables that can activate any given trigger. One type of trigger may say "when a tank goes to location A and the player has 5000 dollars, destroy a tank in location B" while another may say "when 500 frames have passed, give the player 2000 dollars and blow up his defenses". So no one constructor would work to make a trigger which could be used with all the necessary properties.
Synopsis :
What I need is something that can create a trigger (or condition-like) object that can have changing amounts of multiple variables of different classes within a single constructor. Any ideas on how to do something like this, or the counsel of anybody who has stumbled on this problem before would be greatly appreciated. |