Spawn a NPC in UT3 for storytelling purposes
In this tutorial I will show you all the steps we have made in order to make the following happen:
- NPC spawns
- NPC with an idle in-game movement state
- NPC has a name over it's head
As seen in the above list, alot of steps have to be made in order to acchieve the thing we want: a NPC that can give us quests, and where we can deliver quests at.
The NPC's we have placed in our game Son of Argan are all spawned through Kismet.
In order to make this tutorial work, you must make sure that you have patched UT3 with patch 5 and used the UT3 bonus pack
step 1: Create a basic level
For this tutorial I have created a basic level with a skydome, as to be seen in the image underneath. You can choose to make any kind of level you like. For information on how to make a basic level for testing purposes, check the other tutorials on this website.
Save your game, and name it: DM-yourname.ut3 The DM- stands for DeathMatch. Be sure to use it, or your NPC won't spawn!
step 2: Spawn a NPC and give it an idle movement state and a name over it's head
Insert a dynamic trigger somewhere on the floor of your level
Insert a pathnode directly on top of this trigger. We are going to use the pathnode as spawnpoint, and we are attatching the trigger to the NPC. (we won't use the trigger in this tutorial, but there are tons of options you can with a trigger that moves along with an NPC).
Open your Kismet screen by pressing the big green K in the top menubar of your screen. Make sure both the pathnode and the trigger are selected, rightclick in your Kismet screen and select "New Object vars using Trigger_Dynamic_0 and Pathnode_0"
Two objectvars appear in your Kismet screen
Insert a "Level Startup" object (right click, New Event > Level Startup) and an "Actor Factory" object (New Action > Actor > ActorFactory)
Next thing to do is connect the allready created Pathnode var to the pink square underneath SpawnPoint in the ActorFactory, create a blank ObjectVar underneath Spawned and a new Int underneath SpawnCount with it's value set to '1' (we only want 1NPC)
Furthermore, set all the values in theActorFactory as seen in the image below
- select all four checkboxes above "factory"
- Insert a new "Factory" item by selecting the blue triangleand select UTActorFactoryAI from the dropdownlist
- Select UTBot in ControlleClass
- Select UTHeroPawn in PawnClass (or another one if you don't have HeroPawn in your list)
- Set the PawnName to a name you want to give the NPC (remember we have marked the checkbox "bOutputCommentToScreen". The PawnName is the Comment here, so that one is commented to the screen.
- SetSpawnCount to '1'
- Set SpawnPoint to your Pathnode (select your node in the editor, and select the green arrow in this properties screen, or type the correct pathnode name)
Now we insert a "Pawn Anim" objectto set the idle state (right click, New Action > Pawn > Pawn Anim. Inside it's properties, type: "CC_Human_Male_Idle" in the AnimName area. Connect the "In"block from "Pawn Anim" with "Finished" from the "Actor Factory", adn connect the "Target" from "Pawn Anim" with the empty object var underneath "Spwaned" in the "Actor Factory".
When you build your level, a character will spawn, with the name "Test Character" over it's head, and a basic idle animation with it's hands dropped down.






do you know why?