Fallout 4

This is a guide on how you can create and add a basic Scene-type random encounter to the game. You don't need to know how to script, make NPCs, or make custom quests in order to follow this tutorial. However, the more you know about those things, the more you'll be able to do with your own custom encounters. I do assume basic knowledge of the creation kit, such as how to create a new mod and search for different objects.

Step 1: Creating Your Basic Encounter

First off, open up the Creation Kit and create a new mod with REFramework.esm as a master. You can add other masters as well, but this tutorial assumes you're using my framework. Once you've got the empty plugin opened up, go ahead and save it for good measure. I'm naming mine REFExample since I am making an example encounter for the purposes of this tutorial.

Once you have your plugin set up, go to Character->Quest and search "Template", without the quotes. It should bring up a list of quests, about half of which start with "RE". Let's go ahead and select RESceneTEMPLATE, press F2, and name it to something else. You should get the following prompt when you do:



Make sure to click yes! We don't need to edit the original template, we just need to copy it.

Bethesda has a standard internal naming policy for random scene encounters which I recommend, which is [DLC Number]_REScene[Author Initials][Encounter Number]. In my case I will be naming it REFE_REScene01, since I'm the only author working on the Random Encounter Framework Example and this is the first scene encounter added.

Congratulations! You already have a basic random encounter set up and ready to add to the game. That said, I assume you want to actually control what this encounter does.

Step 2: Basic Setup for Your Basic Encounter

The first thing we want to do is some basic maintenance work on the encounter. Search up the quest you made using its name, and double click it to open up the Quest editor. Once that is opened up, make sure you're on the Quest Data tab and focus on this section here:


At this point I highly recommend giving your quest a custom name so that it's easy to identify when looking for it down the line. I've decided that the random encounter I'm making will be a group of bloatflies around a dead radstag, so I'm just going to name mine "Bloatflies and radstag corpse"

TIP: If you plan to make a lot of encounters, or you're working on a big project, I recommend also adding your own Object Window Filter. For example, all of the Scene encounters in Commonwealth Encounter Pack have the filter "Random Encounters\CEP\Scene" to make them easy to check.


Next up, let's go to the Quest Stages tab. Once you're there, find the "Papyrus Fragment" section in the middle right. It should look like this:


Now, I know I promised you don't need to know how to script, so you don't need to worry about this. What we actually want is the Advanced tab instead. Click on that, and then click on the Rename Script button that it shows you. You can name the script whatever you want, but keep in mind that fragments do have fairly standard names. I am personally naming mine QF_REScene01. After entering a name, you should also change the namespace.

There's different opinions on what you should do for the namespace. For example, Commonwealth Encounter Pack has all of the quest script fragments in CommonwealthEncounterPack:Fragments:Quests. I recommend that standard, since it matches how Bethesda handled DLC. So for this example plugin, I will put a colon in front of Fragments and then put REFE in front of the colon. Once I'm ready, the Rename Script window looks like this for me:



The step above is very important! The script the creation kit makes when you copy a quest has a very generic name and there is a small chance someone else could make a mod that has the same script.

Step 3: Customizing Your Encounter


And now we're on to the fun part, where we actually decide what goes into the random encounter. First, go over to the Quest Aliases tab. Once you're there you should see a lot of things already present:


You'll want to leave most of these alone unless you know what you're doing, but I'll give you a quick explanation of what they are:

  • TRIGGER: This is the invisible trigger box that created the encounter point.
  • CenterMarker: A little marker object in the center of the trigger box. This is meant to be used for placing NPCs and objects.
  • TravelMarkerA1-TravelMarkerA3: Invisible marker objects that are far away from the trigger box. These are meant to place NPCs who will approach the center of the encounter, such as for ambushes.
  • TravelMarkerB1-TravelMarkerB3: The same as the other travel markers, but in the opposite direction.
  • SceneMarkerA1-SceneMarkerA3: Invisible marker object arranged in a half circle around CenterMarker. These are meant to be used for placing NPCs and objects.
  • SceneMarkerB1-SceneMarkerB3: The same as the other scene markers, but on the other side.
  • ActorAlias: A basic example of a single actor. You will want to copy, edit, or delete this depending on your random encounter's needs.
  • CollectionAlias: A basic example of a group of actors. You will want to copy, edit, or delete this depending on your random encounter's needs.

TIP: If you're making new aliases for your random encounter, make sure they have the "realiasscript" attached to them if they are a reference alias or the "recollectionaliasscript" if they are a collection alias. There are exceptions, but actors should always have them. I recommend copying the existing template aliases where possible.

Now that you have a basic idea of what you're looking at, double-click Actor Alias. It should bring up a rather large window:


There's a lot of info there, and most of this can actually be super useful for you when you're making your own random encounters. That said, you should learn how this works as part of learning how to make custom quests. What you need to know right now is just the basics.

TIP: The "Alias Name" box in the top left must be unique within a quest. So you can have two different quests with an alias named "ActorAlias" but not two aliases in the same quest that are both named "ActorAlias". Keep that in mind when adding new aliases for bigger encounters.


I mentioned earlier that this encounter would be a dead radstag with bloatflies around it. This alias will be the radstag. So first I will change the name at the top left to "Radstag" minute the quotes. After that I need to edit this section here:



The (Temp) checkbox should always be checked for actors and objects spawned by random encounters! Without that, the encounter will leave things behind when it finishes. The exception is object encounters, which I will cover in another tutorial.

First I will change "REFarmer" to "LvlRadStag", and then for fun I'll move it to SceneMarkerB2 so that it has a slightly different position. After that the above should look like this instead:



TIP: If you try to test your random encounter and nothing shows up, this is one of the first places you should check. It may be possible that an object you tried to spawn couldn't be placed. For example, if I tried to place a nuka cola from a leveled list that can give no items, the encounter will fail to spawn if the leveled list doesn't give me an item. Similarly, if I forgot to set something for the object to spawn at from the dropdown on the right, that would do it. One of the mistakes I frequently make is setting something to spawn at a travel marker than then thinking it didn't spawn at all because I checked the center of the encounter.

Once that is done, I need to make sure this radstag is dead on arrival. To do that, I will go to the script section on the right, which looks like this:



From there I click on realiasscript and pres the Properties button. That will bring up a window that looks like this:


From here I will click "StartsDead" followed by "Edit Value". After that I will click the checkbox that appears and select "OK". You don't need to know what the other properties do, but they are all documented and explain their purpose in the bottom right if you click them.

At this point my alias is ready to go. It now looks like this:


Hit OK, and then double-click the "CollectionAlias" box. This one is nearly the same as the alias we were just editing, except it spawns a group of NPCs or objects rather than just one. The first thing I'll do on this one is rename it to "Bloatflies" and change it from spawning a "LvlRaider" to spawning a "LvlBloatfly". After that I'll change the "Max Initial Fill Count" in the top left from 3 to 5, because bloatflies are essentially cannon fodder.

At this point I could click "OK" and be done, but I think I'd like to change how the bloatflies behave a bit. To do that, I'm going to edit this section here:



I want my bloatflies to wander around the radstag, so what I will do is right click the "Alias Package Data" box and select "Add". From there I will search "RESandbox" and double click "RESandboxExteriorAll". Once that is done, I will click the "Keyword" dropdown and pick "RELinkSandbox" from the list, followed by picking Radstag from the Alias dropdown and clicking Add.

With that, my bloatfly collection looks like this before I hit "OK":


And with that, my quest is all set up and ready to add to random encounter pools! I'll hit "OK" on the bottom right of the quest and then save my mod for good measure.

Step 4: Adding Your Encounter to the Game

You're almost there! Just one thing left at this point. In order to add your encounter to the game, you need to use the story manager. Go to Character->SM Event Node in the left panel of the object window and then double click "Script Event" in order to open up the story manager.

For my encounter, I'm just going to add it to the list of daytime encounters in the rural Commonwealth. In order to to that, I will find "Stacked Branch Node: REMainBranch:" and click the little + to the left it. After that I'll continue opening up branch nodes until I get to "Random Branch Node: REScenQuestsParent", which was added by Random Encounter Framework. At the moment, my window looks like this:


Now, the specific node you will want to use may vary, and I have them documented in another article. Regardless, the next thing I'll do is right click RESceneQuestsParent and select "New Quest Node". That should add an unnamed node to the list, which looks like this:



I'm going to name that node "REFE_RESceneQuests" and then copy its conditions from the normal RESceneQuests. That leaves me with the following:


Make sure the "Shares Event" checkbox is unticked! If your random encounter node shares events, it allows multiple encounters to spawn at the same time! This is generally not the preferred outcome.

Once that is set up, I will right click my quest node, select "Add Quests", and then add my REFE_REScene01 quest to the list. You'll know your quest has been properly added because it shows up under the quest node like this:



TIP: At this point you can click your quest and add custom conditions in the Node Conditions box. This lets you control specifically when and where it will appear. There are a ton of conditions to pick from, and some simple examples include adding a minimum level, checking what quests the player has done, or even checking to see what time of day it is. Just make sure you don't check any of your encounter quest's aliases! Those conditions will always fail and prevent the quest from working properly. Even Bethesda made this mistake with encounters like Smiling Larry!

At this point, it's done! You're ready to test your scene encounter ingame. Hit "OK" at the top right, save your mod, and close the creation kit. I recommend you use the "Random Encounter Disabler" optional file on Random Encounter Framework for this part, because it makes it much easier to test your encounter ingame when you can't find Bethesda's encounters getting in the way.

Some important things to note when testing your encounter:

  • Individual random encounters, spawnpoints, and quest nodes can all have their own cooldowns independent of each other. That means testing in an existing save may not show you an encounter in a spot where you think it should.
  • Always test to make sure your random encounter will successfully stop after the player leaves the area. This can happen any time from immediately after leaving to several days later. You can check your encounter status with the console command "SQV [questname]", and you want to make sure it can go from "Running" to "Stopped".

For my encounter, i tested it at the bridge right next to Starlight Drive In:


And with that, I've created a brand new scene encounter! There's a lot more you could do with this as you learn more about actors, quests, and scripting. You could, for example, set a quest stage when the player attacks or kills actors. You can make it so that when the player reaches the trigger box, NPCs spawn at the travel markers and approach them. It's entirely possible to make a patrol of gunners that will walk all the way from the random encounter to Gunners Plaza (if the player follows them rather than letting them unload). Similarly, you could make an NPC who runs up to the player, tells them to take something, and then runs off after giving the player an item. It's all up to you, at this point.

Article information

Added on

Edited on

Written by

Glitchfinder

0 comments