A Blueprint behaviour module has access to some overrides for interacting with the evens of the Atoms simulation.
Init Simulation: called at the beginning of the simulation, before the first frame.
Pre Frame: called at every frame before any agent is created.
- Agents Created: called when one or more agents are created.
- Agents Killed: called when one or more agents are deleted.
Init Frame: called at the beginning of each frame after the agents are created.
End Frame: called at the end of each frame.
Pre Physics: called before the physics is run.
- PostPhysics: called after the physics is run.
End Simulation: called at the end of the simulation - after the last tick.
- Reset Simulation: when the simulation is reset.
Tutorials
Drive a module parameter
First set up your scene following one of the previous tutorials (make sure your agent group has a state machine module and the state is set to 1), then create an Atoms blueprint asset as described here.
- Double click on the blueprint asset
- Create an init frame override as described here.
- Right click on the viewport and disable "Context sensitive" in the menu.
- Search for "Get Behaviour module" and create a node of that type.
- Search for "Set Module Property as Int" and create a node of that type.
- Connect the nodes as shown in the picture on the right.
- Set the name of the name parameter of the "Get Behaviour module" node to "StateMachine_Behaviour" (this actually depends on the name of your state machine module).
- In the "Set Module Property as Int" node, set the "property name" to "state" and change the "value" to "0".
- Save and compile the blueprint.
- Close the window, then select the agent group from the world outliner.
- Drag and drop the blueprint asset under the other components of the agent group.
- Press play, your agents will be playing state 0.
Changing agent metadatas
First set up your scene following one of the previous tutorials (make sure your agent group has a state machine module and the state is set to 1), then create an Atoms blueprint asset as described here.
- Double click on the blueprint asset
- Create an init frame override as described here.
- Right click on the viewport and disable "Context sensitive" in the menu.
- Reproduce the graph that you see on the right. There are some special Atoms nodes you will need to use: "Get Vector 3Metadata" (gets a vector3 metadata from each agent) and "Set Vector 3Metadata" (sets a vector3 metadata on each agent)
- Save and compile the blueprint.
- Close the window, then select the agent group from the world outliner.
- Drag and drop the blueprint asset under the other components of the agent group.
- Press play, your agents will follow the player pawn during the simulation.
Tutorial
Widget Connector | ||||||
---|---|---|---|---|---|---|
|