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 set it up as a Smart Object to enable the farmer to pick up a bucket and fill it at the well.
Creating the Action in Coppola

Open the Coppola desktop app.
Navigate to Projects → Tutorial Project.
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.
Click the blue Create Action button.
Name your new actions fill.
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.
Name your new parameter object and in the drop down menu select prop_type.
Click Add Parameter to add another parameter to the action. Assign it the name surface and in the drop down menu select prop_type.
Click the blue Create button. Your new action will appear at the top of the action list.
Creating the Well Prop in Coppola

Switch from the Tasks tab to the Prop Types tab.
Click the blue Create Prop Type button.
Name the prop well and click Create. The prop list is alphabetized so it will appear on the second page of the list.
Creating the Fill Bucket Task

Switch from the Prop Types tab back to the Tasks tab.
Click the New Task button, name this new task Farmer | Fill Bucket. Hover over the task name, click the three dots followed by the plus icon to add a new method. Name this 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.
Hover over Farmer | Fill Bucket in the left hand pane, click the three dots followed by the settings cog to open the task settings.
Click the plus icon next to Task Parameters and create a role task parameter for
farmer. Click the plus icon next to Task Parameters a second time to create a prop task parameter forbucket. Repeat this to task parameters forgroundandwell.Click the X next to the task name to close the task settings.
Click Add Step.
Search for, and select, the pick up action.
Fill in the action details with the following values:
Instigator → farmer
object → bucket
Click save changes. Your step will appear in the task.
Click Add Step. Search for and select the fill action.
Fill in the action details with the following values:
Instigator → farmer
object → bucket
surface → well
Click save changes.
Click Add Step.
Search for, and select, the put down action.
Fill in the action details with the following values:
Instigator → farmer
object → bucket
surface → ground
Click save changes.
Building Your Project
Click Build Project in the upper right hand corner.
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.
Open the data asset called BDS_Tutorial. In this asset, select Refresh Task List. You should see
Farmer | Fill Bucketappear 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.
Adding Fill to the Action Map

Re-open your project in Unreal. In the Content Browser, navigate to Content → Bitpart-Tutorial → DataAssets. In this folder there is a data asset called BAM_MedievalArchetypes_Tutorial. Open it.
This data asset is an action map, which defines the different actions that can be used by NPCs. Under the Fallback Action Map section, you'll see an asset called BAM_BaseArchetype. This action map offers basic actions that are used agnostic of archetype pack like speak to, pick up, and put down. 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 arrow icon next to Name to Action Hander Map to expand the section.
Click the plus icon in the Name to Action Handler Map row to add a new element to this list.
In the text box, type the word fill.
In the drop down select Bitpart Action Handler Behavior Tree.
In the Behavior Tree drop down, select BT_Bitpart_UseOnSurface.
Under Anim Tag, search for and select BitpartAnim.Fill.
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.
Save and close the asset.
Updating the Bucket's Animation Chooser

In the Content Browser, navigate to Content → Bitpart-Tutorial → Tutorial → TutorialAssets → Props → Choosers. In this folder there is an animation chooser called AnimChooser_Bucket_Tutorial. Open it.
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.
Click on one of the rows in the chooser table, then copy and paste to duplicate the row.
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.
In the third column, labeled Gameplay Tag, clear the existing tag and select the BitpartAnim.Fill tag you created earlier.
Save and exit.
Configuring a Smart Object Definition for the Well

In the Content Browser, navigate to Content → Bitpart-Tutorial → Tutorial → NewActionTutorial.
Right click inside the folder and, select Data → Data Asset
Search for and select BP_BitpartSmartObjectDefinition.
A new data asset will appear in your folder. Name it SO_Tutorial_Well. Open it.
In the top right of the window, switch from the Outliner to Preview Settings.
Under Object Mesh Path select
SM_Tutorial_Well. The well will appear in the center of the screen. Switch back to the Outliner view.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.
Change the name of the Slot to
Fill Bucket.Adjust the Size to 20.0
Change the offset settings to:
X= 0
Y= 155
Z= 0
Change the Rotation settings to:
X=0
Y=0
Z= -90
Under Activity Tags, search for and select Bitpart.Prop.Well followed by BitpartAnim.Fill
Click the plus icon next to Behavior Definitions.
In the drop down, select Gameplay Behavior Smart Object Behavior Definition.
Under Gameplay Behavior Config, select
GameplayBehaviorConfig_Base.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.
Save your smart object definition and close it.
Creating the Well Blueprint

Follow the path Content → Bitpart-Tutorial → Tutorial → NewActionTutorial. Within this folder you'll see 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.
Open the BP_Tutorial_Well.
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.
Scroll down to the Collision settings. Set the field "Can Character Step Up On" to No.
Under Collision Presets select Custom and expand this section. Then set the following collision settings:
Collision Responses: Ignore.
Visibility: Block
Camera: Block.
Leave the other collision settings at Ignore.
In the components area of the blueprint viewer (upper left), click the green Add button. Search for, and add, the Bitpart Prop component.
Click on the Bitpart Prop Component to open the details panel. Fill out the Anim Prop Tag field with
Bitpart.Prop.Well.Under Initial World State Facts you should see a yellow warning sign indicating that the prop does not have a fact about its prop type. Fill this section in with:
Fact Type: Bitpart Prop Type Fact (should be preselected)
Prop Type: BDA_Tutorial → Well. 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.
In the components area of the blueprint viewer, click the green Add Button. Search for, and add, the SmartObject Component.
Under Details → Smart Object → Smart Object Definition select
SO_Tutorial_WellCompile, save, and exit the asset.
Adding the Well to the Level
Click and drag the
BP_Tutorial_Wellinto the level. Make sure you're adding the BP version and not the SM_Tutorial_Well.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.
Last updated