Figure 9-15. The Replies arrays partially set up
7. Save the scene and save the project.
You will start filling in messages as you get the other action objects up and running.
Object Metadata
In the previous section, you set up the beginnings of your state-management system. The ObjectLookup script, using the object’s current state and the cursor or other object that interacted with it, will tell you what state the object goes into and the states that any auxiliary objects go into as well. The bulk of the information about the actions required by the state transitions will be stored on the individual object as metadata in the Interactor script. Each action object will have to know all of the information required to move into each of its states.
The most important variable you will add to your object is for its current state. The current state, because it will change throughout the object’s lifetime, will have to be initialized. This will also give you an easy way to test interactions without having to go through all of the steps (state changes) to get to the one you want. By creating an additional variable, an initial state variable, you will have the flexibility to start objects at whichever state you wish. This is the starting point for processing object transitions.