For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tutorial 5: Creating Actions

In this tutorial you’ll learn how to create a new action in Coppola and configure it to run in Unreal. You will create a new prop, the well, and setting it up as a smart object to enable the farmer to pick up a bucket and fill it at the well.

Resources you might need for this tutorial:

If you have questions that are not answered by our documentation, join our Discord server and post in #support.

Creating the Action in Coppola

  1. Open the Coppola web tool.

  2. Navigate to Projects → Tutorial Project.

  3. At the top of the page, switch from the Tasks tab to the Actions tab. The Actions tab lists all of the actions that are currently in your project.

  4. Click the blue Create Action button.

  5. Name your new actions fill.

  6. By default every action starts with one required parameter: the instigator, in this case the person who will be doing the filling. Click Add Parameter to add a new parameter to your action.

  7. Name your new parameter object and in the drop down menu select prop_type.

  8. Click Add Parameter to add another parameter to the action. Assign it the name surface and in the drop down menu select prop_type.

  9. Click the blue Create button. Your new action will appear at the top of the action list.

Creating the Well Prop in Coppola

  1. Switch from the Tasks tab to the Prop Types tab.

  2. Click the blue Create Prop Type button.

  3. Name the prop well and click Create.

  4. Your new prop will appear at the top of the prop type list.

Creating the Fill Bucket Task

  1. Switch from the Prop Types tab back to the Tasks tab.

  2. Click the Create Task button, name this new task Farmer | Fill Bucket. Click into your new task to open it.

  3. Click the plus icon next to Task Parameters to create a new parameter.

    1. Under the Role drop down select Farmer.

    2. Click Create.

  4. Click the plus icon next to Task Parameters to create a new parameter.

    1. Switch the type to prop_type

    2. Under the prop drop down select bucket.

    3. Click Create.

  5. Click the plus icon next to Task Parameters to create a new parameter.

    1. Switch the type to prop_type

    2. Under the prop drop down select ground.

    3. Click Create.

  6. Click the plus icon next to Task Parameters to create a new parameter.

    1. Switch the type to prop_type

    2. Under the prop drop down select your well.

    3. Click Create.

  7. Click the plus icon next to Task Methods to add a new method of this task. Name the task method fill bucket at well. This is a good example of a task that might have many methods. The farmers might fill the bucket at the well, the river, a fountain...etc. and the process of filling the bucket might look different in different situations.

  8. Click Add Step.

  9. Search for, and select, the pick up action.

  10. Fill in the action details with the following values:

    1. Instigator → farmer

    2. object → bucket

  11. Click save changes. Your step will appear in the task.

  12. Click Add Step. Search for and select the fill action.

  13. Fill in the action details with the following values:

    1. Instigator → farmer

    2. object → bucket

    3. surface → well

  14. Click save changes.

  15. Click Add Step.

  16. Search for, and select, the put down action.

  17. Fill in the action details with the following values:

    1. Instigator → farmer

    2. object → bucket

    3. surface → ground

  18. Click save changes.

Building Your Project

  1. Click Build Project in the upper right hand corner. Unzip the downloaded folder.

  2. Open your Unreal project. In the content browser, navigate to Bitpart Archetypes → Tutorial. Look for the data asset called BDA_Tutorial. Open the data asset. In the data asset, select Import From JSON file and choose the JSON you just downloaded from Coppola. Save and close the data asset.

  3. Open the data asset called BDS_Tutorial. In this asset, select Refresh Task List. You should see Farmer | Fill Bucket appear in the subsequent list. Click the Disable All button to turn off all the tasks in your domain, then click the check box next to Farmer | Fill Bucket to re-enable just that task. This will make testing your new task easier. Save and close the asset. Note: you don't need to reimport the utterance data table because you have not added any new dialogue lines to the domain.

Adding Fill to the Action Map

  1. Re-open your project in Unreal. In the Content Browser, navigate to Content → BitpartArchetypes → Archetypes → Bitpart-Farmer → Archetype. In this folder there is a data asset called BAM_Farmer_Archetype. Open it.

  2. This data asset is an action map, specifically the farmer's action map. At the top of the asset there is a section for Fallback Action Map that points at BAM_BaseArchetype. That action map contains shared actions that are applicable to all archetypes; when an NPC receives an action, we first check their archetype-specific action map for details on how to execute it. If the action is not in the archetype's action map, we next check the base action map. Click the icon next to Name to Action Hander Map to expand the section.

    1. Click the plus icon in the Name to Action Handler Map row to add a new element to this list.

    2. In the text box, type the word fill.

    3. In the drop down select Bitpart Action Handler Behavior Tree.

    4. In the Behavior Tree drop down, select BT_Bitpart_UseOnSurface.

    5. Under Anim Tag, search for and select BitpartAnim.Fill.

  3. Your updated action map should now look like the map in the screenshot that begins this section. Now, if the director tells the farmer to execute the fill action, the game will run the behavior tree BT_BitpartUseonSurface, using the anim tag for fill.

  4. Save and close the asset.

Updating the Bucket's Animation Chooser

  1. In the Content Browser, navigate to Content → BitpartArchetypes → Props → Choosers. In this folder there is an animation chooser called AnimChooser_Bucket. Open it.

  2. This chooser table has two elements in, click the Edit button next to the drop down with the word Bucket in it to open the bucket's animation chooser.

  3. Click on one of the rows in the chooser table, then copy and paste to duplicate the row.

  4. The drop down in the first column is where you select the animation you would like to play. Click into the drop down for the row you just created and search for AM_MM_Stand_Fill_Bucket_Well.

  5. In the third column, labeled Gameplay Tag, clear the existing tag and select the BitpartAnim.Fill tag you created earlier.

  6. Save and exit.

Configuring a Smart Object Definition for the Well

  1. In the Content Browser, navigate to Content → BitpartArchetypes → Tutorial → Tutorial_Actions.

  2. Right click inside the folder and, select Miscellaneous → Data Asset

  3. Search for and select BP_BitpartSmartObjectDefinition.

  4. A new data asset will appear in your folder. Name it SO_Well. Open it.

  5. In the top right of the window, switch from the Outliner to Preview Settings.

  6. Under Object Mesh Path select SM_Tutorial_Well. The well will appear in the center of the screen. Switch back to the Outliner view.

  7. Click Add Slot to add a new interaction slot to the well. A Slot named "None" will appear in your Slots list. Click the arrow next to the slot name to expand it.

  8. Change the name of the Slot to FillBucket.

  9. Adjust the Size to 20.0

  10. Change the offset settings to:

    1. X= 0

    2. Y= 155

    3. Z= 0

  11. Change the Rotation settings to:

    1. X=0

    2. Y=0

    3. Z= -90

  12. Under Activity Tags, search for and select Bitpart.Prop.Well followed by BitpartAnim.Fill

  13. Click the plus icon next to Behavior Definitions.

    1. In the drop down, select Gameplay Behavior Smart Object Behavior Definition.

    2. Under Gameplay Behavior Config, select GameplayBehaviorConfig_Base.

    3. Click the arrow next to Gameplay Behavior Config to expand this section. You'll see a row called Event Tag set to None. Click the down arrow next to the word None to open the Gameplay tags menu again. This time navigate to InputTag.Prop.UseSO and select it.

  14. Save your smart object definition and close it.

Creating the Well Blueprint

  1. In the Tutorial_Actions folder you'll see the SM_Tutorial_Well. Right click on it and in the menu, select Asset Actions → Create Blueprint Using This. Change the target folder to the Tutorial_Actions folder and name this BP_Tutorial_Well.

  2. Open the BP_Tutorial_Well.

  3. Click on the Static Mesh component and look at the details panel. Under Transform, the default Mobility is set to Movable. Change this setting to Static.

  4. Scroll down to the Collision settings. Set the field "Can Character Step Up On" to No.

  5. Under Collision Presets select Custom and expand this section. Then set the following collision settings:

    1. Collision Responses: Ignore.

    2. Visibility: Block

    3. Camera: Block.

    4. Leave the other collision settings at Ignore.

  6. In the components area of the blueprint viewer (upper left), click the green Add Button. Search for, and add, the Bitpart Prop component.

  7. Click on the Bitpart Prop component. Under Details → Bitpart → Prop Type click into the drop-down and search for well. Select the one under BDA_Tutorial. This list refreshes when you import a new copy of your domain so you should now have the well prop type in this list. If you don't see it, make sure you've updated your BDA_Tutorial with the latest copy of your domain.

  8. Fill out the Anim Prop Tag field with Bitpart.Prop.Well .

  9. In the components area of the blueprint viewer, click the green Add Button. Search for, and add, the SmartObject Component.

  10. Under Details → Smart Object → Smart Object Definition select SO_Well

  11. Compile, save, and exit the asset.

Adding the Well to the Level

  1. Click and drag the BP_Tutorial_Well into the level. Make sure you're adding the BP version and not the SM_Tutorial_Well.

  2. Click play. You should see one of the farmers pick up the farmer bucket, fill it from the well, and return the bucket to the ground.

The other two farmers will not do anything because we turned all the other tasks off in the BDS_Tutorial_Domain and only one farmer can claim the bucket at a time so they do not have anything to do.

Last updated