Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The only actors used for the Objective in the world, are an AOCObjective_Generic, AOCHudmarker, and Path Nodes for the Peasants to spawn and move to. Path Nodes can be place placed wherever desired, though I will be using the example map setup. The initial Kismet setup is the same as covered in previous documentation for Initial Setup, thus I will not go too far into detail. 

...

Peasants stop and play animation:

In this example, the Peasant will run to a point, then upon arrival, play one of three random animations. Most of the nodes up to the Random Switch were covered in the previous example, so I will be jumping ahead to the NPC Play Anim actions in the breakdown.

Image Added

Image Added


NPC Play Anim is an action that will allow you to drive the animations on an NPC bot using any of the game's animations. The properties window will reveal a multitude of options. 

Image Added

 

By going into the Content Browser and filtering 3p, you can bring up the AnimSet "ANIM_3p_NPC". Double Click the AnimSet Icon highlighted below.

Image Added

 

In the Mesh tab of the AnimSet viewer, set the Skeletal Mesh to SK_NPC_Peasant01. This is mainly for previewing the animations.

Image Added

 

Change the tab of the Browser to Anim. Make sure it is set to ANIM_3p_NPC. From here, you can preview the animations, and more importantly, grab the file name for the NPC Play Anim action in Kismet. You can Right Click the name of the Animation in the Sequence Browser, and click "Copy Sequence Name to Clipboard".

Image Added

 

Return to Unreal Kismet. Select the NPC Play Anim action, and paste the animation name, in this case "3p_NPC_noblecower02". There are various other settings here, most of which are explained by tool tips when moused over. For this example, just mimic what is checked off below.

Image Added

All Peasants dying completes the Kill Objective:

The final step of this objective is to keep track of how many Peasants have been killed. To track how many Peasants have been killed, we will use some simple Kismet math. Each of the death events fires into an already open gate. Each time, it adds to a switch, which exists to close the gate after all the peasants have died. Each Death also passes through the gate and a minor delay into the next Add Int Action.

Image Added


Add Int is taking A(1) and adding it on to the total. So in simple math, 1+x=x, with x being carried to the equation each time. So it starts as 1+0=1, 1+1=2, 1+2=3, and so on. That result is then checked by a Compare Int Action. It simply takes the result, and compares it to the number needed to complete the objective. In this case, it is using A >= B, which means A needs to be greater than, or equal to (5) to activate the AOCObjective_Generic Complete Event, effectively ending the objective.

Image Added