Adding NPCs: Archery Trainees
From Nexus Wiki
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.
- 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:
- Creating a new Actor
- Adding targets and idle markers
- Adding Actors
- Editing Actor inventories
- Creating a new AI Package
- 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.
- With *All selected in the Creation Kit's Object Window, type the following into the filter: lvl*imperial
- Right-click on LvlGuardImperial and select 'Duplicate'
- Double-click on the duplicated entry, and rename it in the 'ID' field. For ease, let's call it LvlGuardImperialArcher
- Click on OK
- 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'
- You will then get another error message that asks 'Are you sure?' Select 'Yes'
Here we will add the archery targets the Actors will shoot at.
- With *All selected in the Creation Kit's Object Window, type the following into the filter: archerytarget
- Drag the object into the Render Window to add it to your cell
- 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.
- Double-click on the first ArcheryTarget object
- Give it a distinct name in the 'Reference Editor ID' field. Let's call it 'TargetA1'
- 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.
- With *All selected in the Creation Kit's Object Window, type the following into the filter: patrolidle
- 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
- 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
- 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'
Now that we've set up the framework, we need to add the Actors!
- 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
- Drag one LvlGuardImperialArcher Actor from the Object Window and place him in the cell, close to the A1 idle marker
- Duplicate the Actor by selecting it in the Render Window and entering CTRL+D
- 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.
- Double-click on the actor we've placed near ArcheryIdleA1
- Click on 'Edit Base'
- 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.
- On the tabs along the upper centre, select 'Inventory'
- 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
- You'll see that there is a blank table below. Right-click and select 'New'
- From the 'Object' drop-down select 'ImperialBow'. You can type the first few characters, and the list will move to that entry
- 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.
- 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.
- On the tabs along the upper centre, select 'AI Packages
- Right-click in the white tabled field and select 'New'
- 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
- Under the 'Package' tab select 'UseWeapon' from the 'Package Template' drop-down
- 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.
- Next, click on the 'Flags' tab and untick 'Random conversations'. This stops the Actors from delivering random chitchat when the player approaches!
- Click 'OK' twice, until you're back the LvlGuardImperialArcher's Actor details screen
Now that we've set everything up we need to link it all together!
- Staying with the Actor over by the A1 idle marker, select the tab labelled 'Linked Ref'
- Right-click and select 'New'
- Click the button labelled 'Select Reference in Render Window', and double-click on the 'TargetA1' object
- Change the Keyword to 'TrainingTarget' and click 'OK'. This is what our AI Package refers to, so here we're forging a link
- Right-click on the table area again, and again select 'New'
- 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
- 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