Dynamic Response System (DRS) includes many features that can be used to ensure that a unique response is made available for a signal. In order to efficiently use the DRS, Conditions and Actions should be set up according to the expected outcome.
Each of these features has a unique effect and they can be combined to achieve any kind of response that has been envisioned for a signal.
The features that can be found on the Response Tree are as follows:
The conditions refer to a specific value or function that is required to be checked before an action can be executed. They play the role between a signal and an action and define whether the action is executed, repeated or stopped etc.
Users can assign the following conditions to a Response:
Conditions
Option | Description |
---|---|
Execution Limit | Whenever a response is executed, its internal ExecutionCounter is incremented. With this condition you can check this ExecutionCounter
The test is carried out as: ExecutionCounter>=MinExecutions AND ((ExecutionCounter<=MaxExecutions) OR MaxExecutions< 0) Examples For an easy and only once condition, set MinExecutions to 0 and MaxExecutions to 1. For an after the third time condition, set MinExecutions to 3 and MaxExecutions to -1. For a when executed for the fifth time condition, set MinExecutions and MaxExecutions to 5. The execution counter will not be incremented if the conditions in the base were not matched. In this case, the response is treated as not started at all. |
Game Token | Similar to Variable in range. However, this condition does not test a DRS variable; it tests a game token instead.
In general, the DRS variables are faster to use in conditions so you should prefer using them if possible. Only use game token-checks if the data is shared with other systems such as the Flow Graph. If a game token is of type bool then the condition changes to an equal-test, instead of a range-check. |
Inherit Conditions | This condition allows you to re-use conditions. Meaning that you can have a Response-Base-Template, which checks basic things like PlayerIsAlive, DoesHaveAGun, IsNotCoughing and then re-use the conditions of this response in various other responses. This makes editing easier, since you have the basic conditions in one central place.
|
Placeholder |
This very basic condition is always true (unless negated) and it and it can be useful in a few ways:
|
Random | A random number is generated and checked against the specified value. Allows you to add an element of randomization to your responses.
|
Time Since | Checks how much time has passed since the time stamp stored in the specified variable (via a ‘ResetTimer’ action).
The test is implemented as: TimerVariable >= MinElapsedTime and ((TimerVariable <= MaxElapsedTime) OR MaxElapsedTime < 0.0f) |
Time Since Response | This option is almost the same as the Time Since condition, but instead of checking a time stamp stored in a variable, it checks the system-internal time stamp on each response that gets set every time a response is executed.
|
Variable Basic Checks (Less than, Greater than, Equal to) | These three conditions check the value of the variable against the specified value.
If the variable does not exist, it will be threaded as 0. Comparing DRS variables is much faster than checking for example game tokens because they are written in a less generic way. If you compare a variable with a value of a different type such as a float variable with an integer value, the result will be totally undefined and it will probably not work the way you intended it to. |
Variable in range | Checks if the specified variable is between GreaterThanValue (included) and LessThanValue.
The check is implemented as: VariableValue >= GreaterThanValue and VariableValue <= LessThanValue |
VariableToVariable |
Similar to the Variable in range condition, but instead of comparing the value of the variable to specified values from the conditions, the values are fetched from other DRS variables. This Condition checks if the value of ToTestVariable is larger than or equal to the value of LessOrEqualVariable and smaller than or equal to the value of GreaterOrEqualVariable.
So if you want to do an equal test, you have to specify the same variable for LessOrEqualVariable and GreaterOrEqualVariable.
|
Distance to Entity | Determines the distance (in meters) between the actor and an entity and compares it with the value that has been assigned to Distance. It is especially useful when deciding the volume of a dialogue based on distance; i.e. whether it needs to sound stronger or weaker.
|
The following is a list of all available default actions that can be added to a response.
Actions
Option | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CancelSignal | This action cancels an already running response.
If Signal is left empty, the name of the current response is used, so the currently executed response is canceled. You can use the special keyword All in here to cancel any currently running response. In combination with OnAllActors this can be used to cancel all running response on all actors. | ||||||||||
CancelSpeaking | This action will make the specified actor(s) stop speaking immediately. The lines won’t count as finished, therefore play-only-once lines can be played again at some later point. Queued lines are also canceled.
The response that started the canceled line will not be canceled by this unless the initial SpeakLine action is configured in a way that it should end the response when canceled. Therefore if there are follow-up responses , the actor might directly start its next line. Use the Cancel Response option if you want to cancel the response instead. | ||||||||||
Change Variable | This action is used to change the value of DRS variable. You can directly set a new value or change the current value by adding to/subtracting from it by using different values for Operation.
Running cooldowns are reset on save/load, so you should not use them for longer durations. For these scenarios, please use the ResetTimer action. | ||||||||||
Copy Variable | Copies certain variables that are stored in collections within the DRS.
| ||||||||||
ExecuteResponse | This action executes another response and waits for it to finish. If you don’t need to wait, check the SendSignal action instead.
This can be very useful to re-use re-occurring sequences of actions by creating responses that are just used as containers, holding these action-sequences and are not meant to be executed directly. | ||||||||||
ResetTimerVariable | This action saves the current time into a variable. The stored time can then be used in combination with the TimeSince condition. The time is stored as a float value just like the global variable CurrentTime.
| ||||||||||
SendSignal | This action simply sends a new signal. This is an easy way to start another response. If you want to wait for the other response to finish, you should use Execute Response instead.
| ||||||||||
SetActor | This action sets the currently active actor for the current response. What this means is that any further actions, such as SpeakLine actions, Set (local) variable and Send Signal, will be executed on this actor. The name of the actor is the name of the entity.
This action is really important if you want an actor to react to another actor receiving a signal. For example, a setting as follows can be used: Response for "WasShot": SpeakLine “Ouch”, SetActor “Ally”, SpeakLine “Watch out”. Some actions might have an override depending on which actor is used. For example, in the SpeakLine action you can specify an Override actor that is used instead of the current actor. | ||||||||||
SetActorFromVariable | Same as SetActor but instead of directly specifying the name of the actor to set, you specify a variable that holds the name of an actor. It allows you, for example, to pass the name of the nearest ally along with a signal and use that data in another response to set the actor that is supposed to do something.
Example: Signal: “WasShot” send to the player with ContextVariable “Attacker = enemy1”. A response starts with these actions: SpeakLine “Ouch”, SetActorFromVariable “Context::Attacker”, SpeakLine “That will teach you!” <-- will be spoken by "enemy1" | ||||||||||
SetGameToken | This action will set the game token to the specified value. In general, it's faster to use DRS variables to store data. However, it should be used only if you want to communicate with other systems like Flow Graph.
| ||||||||||
SpeakLine | Requests the current actor, or the SpeakerOverride if one is provided, to speak the specified line.
There are three possible outcomes of this request:
If you click on the dropdown menu to the right of Line Flags, you can choose several Line Flags: These Line Flags can be used to let the action fire new signals at specific events such as line started, line canceled, line skipped. This allows the actor to react with another response when a line was for example skipped. The signals are named LineCanceled, LineSkipped, LineStarted and LineFinished. Each one has a context variable called Line. If you select the flag SendSignalOnStart it will send a signal called LineStarted with a context variable called Line. If you select the flag SendSignalOnCancel it will send a signal called LineCanceled with a context variable called Line. Etc.
| ||||||||||
Wait | This action does nothing for the specified time and you can use it for some basic timing adjustments. Since the response won't continue executing until all actions in the current segment are done, this will delay the start of any further actions
| ||||||||||
Execute Audio Trigger | Defines the Audio Trigger that is to be executed in the Response. For more information about Audio Triggers, please refer to the Audio Controls Editor page.
| ||||||||||
Set Audio Switch | Defines which Switch and Switch State will be used in the Response. It is especially useful when different vocalization types need to be played based on a certain condition; e.g. whisper, speak, shout etc. For more information about Switches and Switch States, please refer to the Audio Controls Editor page
| ||||||||||
Set Audio Parameter | Defines which Parameter will be used and potentially modified within the Response. This option can be useful when driving an audio implementation setup that is using a Parameter, and to change its sound by altering the playing sound in a Middleware. For more information about Parameters, please refer to the Audio Controls Editor page.
|
Users can specify multiple Follow up responses for any given signal which will execute after the base response has been successfully executed.
The DRS always executes the Follow up response with the most conditions that have been met. When more than one Follow up response is available with the same number of conditions, the DRS picks a response randomly.