States¶
State properties¶
In the side panel of the CrowdSim node tree you can define State Properties
.
These state properties can be used to store state of an agent.
By pressing Add State Property
you can add a new state property to the list.
By pressing Remove State Property
you can remove the highlighted state
property. You can change the name of a state property by
double clicking on its name.
A state property can be one of the next types:
String
Boolean
Float
Integer
Countdown
You can also set a default value for the state properties you define.
A countdown property is a special type. Every frame its value is decremented until it reaches zero. Is Countdown Elapsed can be used to check if the property reached zero. With Randomize Countdown the variable can be reset.
State Operation¶
With this node you can perform an operation - Add, Set, Subtract, Multiply - on a State property.
State Property: State property to perform the operation on
Operation: Type of operation to perform
Set: Update the property to the given value
Add: Add the given value to the property
Subtract: Subtract the given value from the property
Multiply: Multiply the property with the given value
Value: The given value for the operation. When using Boolean values you should use 0 for false and 1 for true
Type |
Supported Operations |
---|---|
String |
Set |
Integer |
Set, Add, Subtract, Multiply |
Float |
Set, Add, Subtract, Multiply |
Countdown |
Set, Add, Subtract, Multiply |
Boolean |
Set |
Check State¶
With this node you can check your State property against another value.
State Property: State property to perform the operation on
Check: Type of check to perform
Equal: Is the property equal to the given value
Less than: Is the property less than the given value
Greater than: Is the property greater than the given value
Is True: Is the property true
Is False: Is the property false
Value: The given value for the operation. When using Boolean values you should use 0 for false and 1 for true
Type |
Supported Check |
---|---|
String |
Equal, Less than, Greater than |
Integer |
Equal, Less than, Greater than |
Float |
Equal, Less than, Greater than |
Countdown |
Equal, Less than, Greater than |
Boolean |
Is True, Is False |
Model Variable Operation¶
- With this node you can perform an operation - Add, Set, Subtract, Multiply - on
Target Type: Agent to perform the operation on.
Myself: The operation will be performed on the incoming agent.
My target: The operation will be performed on an agent being targeted.
Targets me: The operation will be performed on agents that targets me.
Target: The target property to check when target type is set to My target or Targets me.
Operation: Type of operation to perform
Set: Update the property to the given value
Add: Add the given value to the property
Subtract: Subtract the given value from the property
Multiply: Multiply the property with the given value
Value: The operand for the operation.
Model Variable: Model variable to perform the operation on
Check Model Variable¶
With this node you can check the value of Model variables.
Target Type: On which agent should the operation be performed on. * Myself: The operation will be performed on the incoming agent. * My target: The operation will be performed on an agent being targeted. * Targets me: The operation will be performed on agents that targets me.
Target: The target property to check when target type is set to My target or Targets me.
All/Any: When target type is Targets me do all agents or just one agent need to pass the check. * Any Agent: This node returns Success when a single agent passes the check. * All Agents: This node returns Success when all agents that target me pass the check.
Check: Type of check to perform * Equal: Is the property equal to the given value. * Less than: Is the property less than the given value. * Greater than: Is the property greater than the given value.
Value: The value to check against.
Model Variable: The model variable to check.
Check Frame Number¶
With this node you can check the frame number of a simulation.
Check: Type of check to perform
Equal: Is the active frame number the same as the entered frame number.
Less than: Is the active frame number smaller than the entered frame number.
Greater than: Is the active frame number larger thatn the entered frame number.
Frame number: Frame number to test against the actual frame.
Check Agent Model¶
Check if an agent is a specific model/character.
Model: Model to check against.
Character: Character to check against. (only shown when the selected model is an armature.)
Check Action Tag¶
Check if a running animation action has a tag.
Tags can be configured for each action in the action editor side panel.
When an action is scheduled for an agent this tag would become active for an agent. The Check Action Tag node would return success when the tag is active for an agent.
Target Type: On which agent should the tags be checked
Myself: Check the incoming agent.
My target: Check the agent that the incoming agent is targeting.
Targets me: Check the agents that targets me.
Target: The target property to use when target type is set to My target or Targets me.
Tag: The tag to check for.
Check Mesh Variation¶
Check if an agent has a given mesh variations
Model: Model to check against.
Character: Character to check against.
Variation: Mesh variation to check against. The list of variation is build from the character configuration of the model.
Check Agent Factory¶
Check if an agent is part of a specific factory
Factory: Agent factory to check against.
Check Collision Impact¶
Check the collision impact of the last intersection test.
Check: The check to perform.
Equals: is the attribute equal to the value
Less than: is the attribute less than the value
Greater than: is the attribute greater than the value
Value: The value to check against.
Check Grid Position¶
Check the position an agent has when created with a grid factory.
Grid Position: The position of the agent when a grid distribution is applied.
Check: The check to perform.
Equals: is the attribute equal to the value
Less than: is the attribute less than the value
Greater than: is the attribute greater than the value
Value: The value to check against.
Set Speed Vector¶
With this node you can set the speed vector of agents.
Direction: The direction to set.
Velocity: The velocity to set.
Acceleration¶
Change speed of the agent. With the Acceleration node it is possible to accelerate/decelerate to a specific speed within a given time. The node keeps running until the time limit has reached, or the given speed has been reached.
Min Velocity: Minimum value when generating a velocity of the agent to reach.
Max Velocity: Maximum value when generating a velocity of the agent to reach.
Duration: The maximum time to try to reach the velocity.
Is Countdown Elapsed¶
Check if a countdown state property reached zero
State Property: State property to perform the operation on. Note that this node only works on countdown state properties.
Randomize Countdown¶
Reset a countdown state property to a value. The new value will be between the given Min and Max
State Property: State property to perform the operation on. Note that this node only works on countdown state properties.
Min: Minimum value to give to the countdown property.
Max: Maximum value to give to the countdown property.