Inthis Studio
Workflows

How to make a Fallout 4 mod: your first script

03
A first script

A welcome message when the player activates an object

A welcome message is the smallest script worth writing: the player activates one object and the screen shows one line of text. It is a fair first answer to how to make a Fallout 4 mod, because it needs only one Papyrus file and one object in the Creation Kit.

01

Open the project folder

Create a folder for your scripts and choose it as the working folder in Inthis Studio.

02

Describe the script

Write in plain words what should happen, for example a message when the player activates an object.

03

Review before you accept

In Ask first, read the card for InthisWelcome.psc and press Accept or Reject.

04

Compile and test

Compile, attach the script in the Creation Kit, save the plugin and enable it, then load a save and activate the object.

The script the agent writes

InthisWelcome.psc
ScriptName InthisWelcome extends ObjectReference
{Shows a message when the player activates this object.}

; Text shown on screen. Editable in the Creation Kit.
String Property WelcomeText = "Welcome home" Auto

Event OnActivate(ObjectReference akActionRef)
    ; React only to the player, not to an NPC.
    If akActionRef == Game.GetPlayer()
        Debug.Notification(WelcomeText)
    EndIf
EndEvent

In Fallout 4 Papyrus, a script like this is a plain text .psc file. The OnActivate event runs when something activates the object, and the If line lets only the player trigger the message.

Two small jobs to try next

Read the Papyrus log after a failed test

The Papyrus log is the first place to look after a failed script test, because a script that stops or fails leaves its error line there. Set bEnableLogging=1 and bEnableTrace=1 in the [Papyrus] section of your INI file, run your test, then copy the log into your working folder. The agent opens it with read_file, searches it with grep for your script name and the word error, and reads the matching .psc file. In Ask first mode, edit_file shows the proposed fix as a diff. Accept it, compile again, and run the same test in the game. When you ask for Fallout 4 settlement mod help on a forum, include the relevant lines from this log.

Keep notes on mods you try

Keep one notes file for the mods you try, with a short entry per mod: what it changes, what you changed in it and what broke. Fallout 4 mod suggestions from friends or forums go into the same file, with the plugin name beside each one. The agent reads the file with read_file and uses grep to check every plugin name against Plugins.txt, so a typo or a missing plugin shows up. Before you change mods, back up your saves, because starting a new game should not be your only way back. Plan only lists the steps first. Read the plan, switch to Ask first for the edits, and test each change in a save you can afford to lose.

Inthis Studio for Windows

Write your first script with an agent

Download Inthis Studio ↗