Adding NPCs: Archery Trainees

From Nexus Mods Wiki
Jump to: navigation, search


This tutorial will help you add two trainee archers to your dungeon, each firing at their own targets. If you're only interested in creating one trainee that's ok too: follow the guide, but do not repeat any steps when told to do so.

Note:This tutorial assumes you are already familiar with loading the ESP files the Creation Kit refers to. It also assumes that you are familiar enough with editing to have created your own space or dungeon to place the trainee archers in. If not, please see Bethesda's Creation Kit wiki before continuing.

Required Tools

  • Creation Kit: available on Steam (Menu option View -> Tools and then select Creation Kit)

Add Trainee Archer NPCs

The main steps for adding a trainee archer into the game are:

  1. Creating a new Actor
  2. Adding targets and idle markers
  3. Adding Actors
  4. Editing Actor inventories
  5. Creating a new AI Package
  6. Assigning references

Creating a new Actor

Because we are editing default Actor inventory and AI Package information, we need to create a new Actor. This enables us to make changes to a default Actor without effecting any other existing Actors in the main game or other mods.

  1. With *All selected in the Creation Kit's Object Window, type the following into the filter: lvl*imperial
  2. Right-click on LvlGuardImperial and select 'Duplicate'
  3. Double-click on the duplicated entry, and rename it in the 'ID' field. For ease, let's call it LvlGuardImperialArcher
  4. Click on OK
  5. The error message that pops up is asking us if we want to make a new Actor. Because we don't (we've already created it by duplicating it instead) select 'No'
  6. You will then get another error message that asks 'Are you sure?' Select 'Yes'

Adding targets

Here we will add the archery targets the Actors will shoot at.

  1. With *All selected in the Creation Kit's Object Window, type the following into the filter: archerytarget
  2. Drag the object into the Render Window to add it to your cell
  3. Duplicate the target by selecting it and entering CTRL+D. Drag the duplicated target into position
    Tip: It's a good idea to set your targets against a wall as this reflects where they would be placed in the real world.
  4. Double-click on the first ArcheryTarget object
  5. Give it a distinct name in the 'Reference Editor ID' field. Let's call it 'TargetA1'
  6. Repeat for the second target, this time naming it 'TargetB1'

Adding idle markers

We're now going to place idle markers a reasonable distance away from our archery targets.

  1. With *All selected in the Creation Kit's Object Window, type the following into the filter: patrolidle
  2. Drag and drop a PatrolIdleMarker from the Object Window into the Render Window. The marker should be placed a reasonable distance away from your A1 target
  3. Repeat, adding an idle marker opposite the B1 target
    Tip: Make sure the idle markers are in a straight line away from the target. Also ensure that the edge with the triangle - the 'front' - is pointing towards the target
  4. As with the ArcheryTarget objects we need to assign each idle marker a name. Let's use 'ArcheryIdleA1' for the marker opposite 'TargetA1', and 'ArcheryIdleB1' for the marker opposite 'TargetB1'

Adding Actors

Now that we've set up the framework, we need to add the Actors!

  1. With *All selected in the Creation Kit's Object Window, type the following into the filter: lvl*imperial - notice that the Actor we created before appears on the list
  2. Drag one LvlGuardImperialArcher Actor from the Object Window and place him in the cell, close to the A1 idle marker
  3. Duplicate the Actor by selecting it in the Render Window and entering CTRL+D
  4. Move the duplicated Actor over to the B1 idle marker

Adding inventory items to an NPC

Here we're going to assign a bow and arrows to the inventory of the Imperial archer Actor.

  1. Double-click on the actor we've placed near ArcheryIdleA1
  2. Click on 'Edit Base'
  3. In the new screen, untick 'Use Inventory' from the Template Data flags (lower left)
    Note: We are about to edit the default inventory for LvlGuardImperialArcher. Every time we load LvlGuardImperialArcher it will come with this inventory attached.
  4. On the tabs along the upper centre, select 'Inventory'
  5. When we assign our own inventory we derobe the Actor. Assign a 'Default Outfit' and a 'Sleep Outfit' - for simplicity, choose CWSoldierImperialArcherOutfit from each list
  6. You'll see that there is a blank table below. Right-click and select 'New'
  7. From the 'Object' drop-down select 'ImperialBow'. You can type the first few characters, and the list will move to that entry
  8. Add a new item, this time 'SteelArrow'. You can assign a Count of any number, but the Actor will keep firing indefinitely, using an infinite number of arrows along the way

Creating a new AI Package

AI Packages assign behaviours to Actors within the game. They can be used to give instructions, and that's what we're going to do here.

  1. Now untick 'Use AI Packages' from the Template Data flags (lower left). This allows us to edit the AI Package of LvlGuardImperialArcher
    Note: As with the inventory edit above, we are now editing the default AI Package list for LvlGuardImperialArcher. Every LvlGuardImperialArcher Actor will come with this AI Package attached.
  2. On the tabs along the upper centre, select 'AI Packages
  3. Right-click in the white tabled field and select 'New'
  4. Give your package an ID. It doesn't matter too much what we call it, so long as it makes sense to you and any others who may use your mod
  5. Under the 'Package' tab select 'UseWeapon' from the 'Package Template' drop-down
  6. Update the following options, which are listed in the 'Public Package Data' table:
    • Weapon Type - There are many options here, and we can specifically instruct Actors to use melee weapons, ranged weapons, spells, or no weapons at all. For now, leave this as 'Weapons: Any'. Each archer will automatically default to using the bow we assigned
    • Use Weapon Location - Click on the button labelled 'Near package start location'. On the next screen select the 'Linked Reference' radio button. Leave the Keyword as NONE
    • Target to Attack - Click on the button labelled 'NONE'. On the next screen, select 'Linked Reference' again, only this time change the Keyword to 'TrainingTarget'
    • Trigger Ref - Leave this as 'Self'
    • Trigger Radius - Change this to 1250
      Note: If the radius is too small, the archer will not acquire the target!
    • Pause between barrages - Change this to true
    • Min Pause - Change this from 0 to 0.5
    • Max Pause - Change this from 0 to 2.5
      Tip: These pauses can be any length you like. They are designed to stop the archers shooting simultaneously, which looks a little surreal. As a comparison, the Min and Max Pauses on the training archers in Solitude are 2 and 5 respectively. In a small area where not much else is going on, shorter intervals will give a greater impression of trainee focus and make them seem more real.
  7. Next, click on the 'Flags' tab and untick 'Random conversations'. This stops the Actors from delivering random chitchat when the player approaches!
  8. Click 'OK' twice, until you're back the LvlGuardImperialArcher's Actor details screen

Assigning references

Now that we've set everything up we need to link it all together!

  1. Staying with the Actor over by the A1 idle marker, select the tab labelled 'Linked Ref'
  2. Right-click and select 'New'
  3. Click the button labelled 'Select Reference in Render Window', and double-click on the 'TargetA1' object
  4. Change the Keyword to 'TrainingTarget' and click 'OK'. This is what our AI Package refers to, so here we're forging a link
  5. Right-click on the table area again, and again select 'New'
  6. This time, select the ArcheryIdleA1 marker as your reference from the Render Window. Make sure you do not add a Keyword. Click 'OK' twice, closing the Actor details screen
  7. Follow the same steps in this section for the second archer, this time using the 'B1' naming conventions

Conclusion and next steps

Save and enter the game. Both trainees should be standing directly opposite their training targets, firing arrows at staggered intervals.

This concludes the tutorial. Further targets and trainees can be added easily.

This tutorial was successfully tested by the author at 17:58, 1st April 2013


Nexus Forum thread: adding NPCs attacking dummies