This tutorial demonstrates the use of the ChangeLocationEvent in Story Manger to spawn NPCs at locations of your choice when a player enters either an interior or exterior cell. I use this method a lot and the example in this tutorial involves spawning NPC's when a player enters a Tavern and then deletes them after the player leaves.

For the purposes of this tutorial I assume NPC's have been created in the CK.

Set upEdit

First there are some things to set up:

  • Create a Location for your cell
  • Create a number of Location Ref Types
  • A number XMarkerHeading's in the cell for the NPCs to spawn at.
  • Assign each XMarkerHeading a Location Ref Type.

Create a Location and Location Ref TypesEdit

First Create a location object in the CK:


Then assign it to your cell:


Create a number of LocRefTypes, you will need one for each XMarker in your cell:


Place Xmarkers in your CellEdit

Place as many XMarkerHeading's in the cell as you want NPC in this particular example there are four.


Double click on each XMarkerHeading to open its reference window and set the Location Ref Type of each to a different LocRefType (in the CK the XMarkerHeading will have a coloured block over it when this is set).


Create a QuestEdit

Now we have created the objects needed to make our quest. Create a new quest and fill the first tab in below, then click OK and open the Quest again.


Open the Quest again and go to the Stage Tab and create 2 stages, the first ticked as the start up and the second as the shut down stage:


In this example I want the NPC's to disappear after the player leaves the cell because I run the Quest everytime the player enters. So the shut down stage deletes the NPC's, if you only want to run the quest once you don't need to do this.


Now go to the Alias Tab, and we need to create Alias's for the Location, the Positions (of the XmarkerHeadings) and the NPC's:


Here's what each of those Alias's look like:


Note how the NPC Alias is set to one of the Position Alias's; you can set more than one NPC Alias to a single Position but in this example they are each allocated to a different one.

Running the Quest in Story ManagerEdit

Now we need to get the quest to run when the Player enters the cell, so we first need to go into the change location event in Story Manager:


Double click on ChangeLocationEvent to open up the SM Event Node:


You can see from the screenshot that I have created a Stacked Branch node because I have lots of these events and it puts them under their own group (right click on the top line and select 'new branch node'). Then you right click on the Branch node you have created and select 'new quest node'. Then right click on the Stacked quest Node and select 'Add Quest' in this example I have four quests each are identical except they use different NPCs so the player sees more variety; but it could be just one quest.

The screen shot shows the Stacked Quest Node and you can see what boxes have been selected and the Node Condition I have added:


You can add other Conditions here such as a GetQuestCompleted or GetLevel, note the Target is the player.

Other Uses of this MethodEdit

I also use this method to set up encounters with bad guys in interior and exterior cells, in those cases there may be only be a single quest and the Alias's will be monsters of some sort (there is no need to delete these in the shutdown stage unless you want to remove the corpses!). You may also want to set the Quest to run only once.

I find this quite useful in Cave encounters becuase if I have another Quest that needs to use that Cave I can suppress the encounter quest if that quest is running (with a Node Condition). For example if the player has been sent to track down a bad guy in a cave you don't want the bad guy killed by the 4 Bears your encounter quest puts in there.

You can also spawn anything you like as long as it is an Alias in your quest.