ReactingActor - storytron/swat GitHub Wiki
When an actor learns of an event the Reaction Cycle for that event begins and the actor becomes a reacting actor to that event. The actor will be added to the ReactingActor group for this event.
As a reacting actor the first thing this actor will do is seek a suitable role for themselves from the roles provided by the event's verb.
(an event can have more than one reacting actor). This actor becomes part of the ReactingActor group that the Storytron engine will loop through when considering actors for the roles associated with the event's verb. The actor goes through the event's roles in the order in which they are listed in the verb's Role list.
For each role, the actor checks the role's AssumeRoleIf script, which will tell them whether or not they can assume this role. If they find a role then can assume, they assume it immediately and proceed to the next step (which is?). For the duration of their turn, the role that the actor has assumed is called the AssumedRole.
If an actor finds no role to assume, they pass their turn. It is not required that a reacting actor assume a specific role.
Once the ReactingActor has assumed a role the following steps happen:
- Any of the role's EmotionalReaction scripts will be executed (this might change the ReactingActor's personality profile)
- The ReactingActor will create a Plan in reaction to this event (they might not be able to do so if the event is Hijackable)
- The ReactingActor will find the Acceptable candidates for the wordsockets of each Options verb
- The ReactingActor will assign words to each options wordsockets
- The ReactingActor selects a valid option
- The ReactingActor creates a reaction plan
- A new reacting actor is chosen to assume one of this event's unassumed roles
Old Wiki: The Reaction Cycle