Simple Animations in the Flow Graph
From Blue Mars Developer Guidebook
Back to Tutorials
This page covers the creation of very simple animations with the use of the Flow Graph. First, we will make sure the Components menu is being displayed, then we will show how to trigger an animation that has already been created with PlayAnimation or PlayCGA. Then we will look at using Flow Graph nodes such as MoveEntityTo to move entities. For more information, see the FlowGraph page.
Flow Graph Components
The Flow Graph can be opened from the "FG" icon, or from the City Editor's View Tab > Open View Pane > Flow Graph. Inside the Flow Graph, display the Components menu from the Flow Graph's View Tab > Components. If any appear to be missing, check the View Tab > Components... menu to display the desired Nodes (eg, View Tab > Components... > Release).
Triggering an Existing Animation
To trigger an existing animation,
- Use the Start input of the Animations:PlayAnimation node and set the Animation name, or
- Use the Trigger input of the Animations:PlayCGA node and specify the CGA animation name:
Creating Movement with Flow Graph Nodes
Here's one simple example of moving an entity to a location, using the Entity:EntityPos and Movement:MoveEntityTo nodes from the Components menu. Once these nodes are dragged into the Flow Graph,
- Right-click on the EntityPos node to assign a selected TagPoint in your level
- The TagPoint entity can be found on the RollupBar at Objects > AI > TagPoint
- Right-click on the MoveEntityTo node to assign the selected entity that you wish to move
- Link the EntityPos node's pos Output to the MoveEntityTo node's Destination Input, and trigger the movement with the Start Input.
Pictured below: the Components menu, including the mentioned Nodes and the TagPoint Location.
Simple Animations In Flowgraph
(Please note that this bus is just a model and not a fully functioning vehicle, also the player who triggers this animation will be the only one who sees the actual animation playing.)
Back to Tutorials