TUTORIAL - Creating Custom Scenarios (2024)

First and foremost: If anything in this article doesn't make sense, or seems to skip a step or two, let me know and I'll fix it.
Updates to RimWorld during the alpha phase of development may change how information is stored in save files, so for the time being, this article is accurate for RimWorld 0.1.334 only.

Getting Started:
The very first thing to do is generate a world that will fit with what you want to accomplish. Depending on luck, this could end up being the most time consuming part. To save yourself some time, don't worry about what storyteller you pick, or what your colonists are like. They can be changed later on.
If a map looks semi-suitable but not ideal, save it before generating another map. You may never find a better map.

Building the World:
This can be done in two ways, through normal gameplay or through God mode.
Normal gameplay has the advantage of the map looking 'lived in'. Blood spots in useful places, rubble in others, things like that. If you don't want to be bothered by the Storyteller AI sending raiders at you, it can be disabled in two ways.
First, open your save file in Notepad++ (or normal Notepad, or your OS equivalent.) and find this section: (Make a backup copy of the save file first before doing this.)

<Storyteller Class="Storyteller_ClassicEasy">
Once there, look through that section and find this part:

<StoryState>
<LastThreatQueueTime>-1</LastThreatQueueTime>
<NumThreatsQueued>0</NumThreatsQueued>
<LastQueueTicks>
<KeyList />
<ValueList />
</LastQueueTicks>
</StoryState>

To completely disable the AI, remove the entire <StoryState> section and replace it with this:

<StoryState IsNull="True" />
To disable the AI for a set period of time, just put in the amount of time (in ticks) in this section:

<LastThreatQueueTime>18500</LastThreatQueueTime>
I have yet to figure out exactly how many ticks are in a day in RimWorld, but it averages ~18,500 per in-game day.

God mode is found by ticking 'Development mode' in the Options screen, and then clicking on it in-game.

Development mode is quickest if you are building an elaborate base, or even just something simple like a containment area, and don't need the map to look lived-in.

Things that can be done:
IMPORTANT: Make frequent backups because if something goes wrong, RimWorld won't tell you, it'll just fail to load. Even something as small as a missed capitol letter is enough for a crash.

Disabling the StoryTeller AI:
See Building the World.

Changing the StoryTeller AI:
See attached file StoryTellers.txt.
Replace the entire StoryTeller section with the one you want from that file. (All 5 are in there.)

Changing teams:
This is actually quite easy, but a side effect is that the player cannot interact with things that are not on the Colonist team.

Almost everything in game looks a little like this inside the save file:

<Thing Class="Building">
<Def>Wall</Def>
<ID>Wall50901</ID>
<Pos>(106, 0, 44)</Pos>
<Team>Colonist</Team>
<Health>280</Health>
</Thing>

In this case, we're looking at the <Team>Colonist</Team> section.

There are a few teams:
� Colonist
◦: This is everything that the player can control or interact with.
� Traveller
◦: These are the guys that wander from one side of the map to the other.
� Raider
◦: These are the guys that attack you from time to time.
� Psychotic
◦: When things have a mental break, they get put into this state. They will attack anything, sometimes even other members of their team.

There are a few special cases that need to be addressed if you change the team that humans and animals use, but nothing really to worry about with buildings. For buildings, if you want the player to not be able to interact with them, change them to 'Traveller'. If you don't want the raiders attacking them, change them to 'Raider'.

The section, <Health> is not as useful as it may appear. Setting it to a higher amount does nothing useful at all, because as soon as it takes any damage, the value shown reverts to it's correct amount. <Pos> is the items exact location in the world. This is useful for precise placement of pawns if your scenario requires it, or for building otherwise impossible things, like doubledoors.

The way I go about doing this is by placing a blueprint for sandbags where I want the new item. Then I save and quit the game, and search for this in the save file:

Sandbags_Blueprint which will give me this to work with:

<Thing Class="Blueprint">
<Def>Sandbags_Blueprint</Def>
<ID>Sandbags_Blueprint30051</ID>
<Pos>(25, 0, 19)</Pos>
<Team>Colonist</Team>
</Thing>

If we change that to this:

<Thing Class="Building_Door">
<Def>Door</Def>
<ID>Door30051</ID>
<Pos>(25, 0, 19)</Pos>
<Team>Colonist</Team>
<Health>240</Health>
<DesirePowerOn>True</DesirePowerOn>
</Thing>

We now have a shiny new door instead of the sandbag blueprint. Please note the <ID> section. This must ALWAYS contain a unique number, and its best to use the number the game assigned to the blueprint.
TUTORIAL - Creating Custom Scenarios (1)
Unfortunately triple doors are not completely possible at this time. They can be made, but only in one orientation.

That's it for teams.

Trader Ships:
You'll find them listed under: <VisitorManager>

I recommend getting a save file that contains at least one of each type of trade ship, as it's much easier to copy and paste them, rather than write them up from scratch. This save contains 3 of the 4 possible trade ships, Farming, Slaver and Combat. It does not have Industrial.
When it comes to traders, you can affect most things, except the prices for which they buy and sell things. That is controlled by the game at this point, and is affected the the social skill of whoever is communicating with the ship.

What each section covers:

<Visitor Class="Trader">

Pretty self explanatory. I don't think there are any other classes, so don't modify this section. Of course you can if you want to, but I don't know what will happen if you do.

<Name>John Larman</Name>

Do I really need to explain this? TUTORIAL - Creating Custom Scenarios (2)

<TicksUntilDeparture>40000</TicksUntilDeparture>

This is how long they will stay in orbit before they leave. Remember, approx.~18,500 ticks is one day.
You can set this to an absurbly high number if you wish to make them stay in orbit for pretty much indefinitely.

<traderType>Slaver</traderType>

This determines what they can buy or sell.
The given example is a slave trader ship. Ships that deal with weapons are given this: <traderType>Combat</traderType>
Farming ships don't have this section at all. I don't know what industrial ships have.

<things>

This is a big section. If it's empty, instead of the header being <things>, it's <things />
I highly suggest just having a look at the attached file, and seeing the structure they have.
I've also attached what weapons they can have. Technically there are two more weapons, but they are unfinished and/or extremely overpowered. (One of them is the LM-15, the weapon the turret uses, the other is even more OP than that. (Hint: <Def>Gun_Minigun</Def>)

<commodities>

This is what the trader has as items you can buy and sell.
� <KeyList>
◦: Things like food, metal, uranium, etc. It's best not to modify this list, problems can occur.
� <ValueList>
◦: This is how many of each thing they have. The max number I use is 999999999, although you could probably use a higher number. There is an upper limit at which point problems start occurring. I don't know what that number is.

That's it for traders.

Letters
You'll find this listed under: <LetterStack>

These are the sometimes annoying notes that pop up on the side of the screen. You can use these to convey a message to the player.

� <Letters>
◦: This is just a container. If there are no letters, this will be: <Letters />
� <Letter Class="UI.Letter">
◦: This is the letter itself. I do not know if there are classes other than "UI.Letter".
� <Text>
◦: What the message is. Don't make the message too long.
� <LookTarget IsNull="True" />
◦: This is where the "Show me" button takes you inside letters such as notes about raiders landing. I have never dealt with this, so I always leave this as shown.

That's it for letters.

Research Topics:

You'll find this listed under: <ResearchManager>

� <CurrentProject>
◦: The currently selected topic for research.
� <ProjectList>
◦: Everything that can be researched. Note: It is impossible to remove research topics. The game reinserts them if removed.
� <ResearchProject Class="ResearchProject">
◦: The container for each different thing that can be researched. Inside here you will find this:

<ResearchProject Class="ResearchProject">
<RType>Hydroponics</RType>
<Label>Hydroponics</Label>
<Progress>0</Progress>
<TotalCost>22000</TotalCost>
<Description>Allows you to build hydroponics tables to rapidly grow crops indoors.</Description>
</ResearchProject>

Except for <RType> all these can be modified. So you can make a particular research item take far longer to research, or make it much quicker to research by changing the <TotalCost> section.
You can also set a research topic to being something that has already been researched by changing the <Progress> section to equal +1 of the <TotalCost> section. In this case, setting it to <Progress>22001</Progress> will mark Hydroponics as already researched.

That's it for research.

The Reservation Manager:

You'll find this listed under: <ReservationManager>

Ever tried to select something and seen a note stating that somebody else was already doing it? That's this section.
I've never really dealt with this section, but if you intend to give custom movement to pawns (Yes, you can make pawns walk from A to B if you want.) knowing about this section may help.

� <Reservations>
◦: The container for things reserved.

This is a typical reservation:

<ThingReservation Class="AI.ThingReservation">
<claimant>Pawn29549</claimant>
<resType>Total</resType>
<target>
<TargetThing>Potatoes24482</TargetThing>
</target>
</ThingReservation>

I haven't personally needed to make or edit these, so I can't tell you much about them. If you have, please explain what each section is in a reply below and I'll add it to this section.

However, I have needed to remove things from here. The <claimant> is the <ID> tag of the pawn who reserved this particular item. So if you manually remove something from the save, you'll need to remove their reservation from here as well.
Also, if you remove plants from the save file (not a fun task), be sure to remove all references to said plants from the reservation manager.

If you see something that has this: <claimant>Null</claimant> Remove it. This happens as a result of not using unique <ID> numbers for pawns, and essentially breaks anything that attempts to interact with the claimed thing.

That's it for the reservation manager.

The Raider Controller:
You'll find this listed under: <AIKingManager>

This is what raiders use to determine when to attack you after they have landed, and under what conditions they should consider fleeing from the fight.

� <KingList>
◦: The container for controlled raider teams. If you remove raiders from the game, it's best to remove them from this section as well, but not essential.

This is almost a typical AIKing: (This one is taken from my Zombie Defence scenario.)

<AIKing Class="AI.AIKing">
<Config>
<Team>Raider</Team>
<StagingTime>281610</StagingTime>
<AssaultingTime>320000</AssaultingTime>
</Config>
<FleeChecker>
<NumPawnsGained>1</NumPawnsGained>
</FleeChecker>
<Cortex>
<TicksSpentStaging>0</TicksSpentStaging>
<TicksSpentAssaulting>0</TicksSpentAssaulting>
</Cortex>
<BaseCenter>(10, 0, 189)</BaseCenter>
<OwnedPawns>
<Ref>Pawn110111</Ref>
</OwnedPawns>
</AIKing>

About each section.
First, this one:

<Config>
<Team>Raider</Team>
<StagingTime>281610</StagingTime>
<AssaultingTime>320000</AssaultingTime>
</Config>

� <Team>
◦: Pretty self explanatory.
� <StagingTime>
◦: How long they wander around before deciding to attack you. In this case, this guy will wait for 15 days before attacking.
� <AssaultingTime>
◦: The difference between this number and the <StagingTime> number is how long they spend attacking before giving up and leaving. I suggest looking into a normal raider AIKing to see what a normal number for this section would be. I have intentionally high for a reason.

Now about this section:

<FleeChecker>
<NumPawnsGained>1</NumPawnsGained>
</FleeChecker>

� <NumPawnsGained>
◦: To have the raiders leave under normal losses conditions, this is set to the exact number of raiders there are. Setting this to a number higher than the number of actual raiders will cause the raiders to leave after suffering fewer losses than what a normal raider would leave under. Setting this to a lower number will cause the raiders to stay, even after suffering heavy losses. Setting this to 1 will cause the raiders to never flee from a fight. They will fight until they are all dead.

Now about this section:

<Cortex>
<TicksSpentStaging>0</TicksSpentStaging>
<TicksSpentAssaulting>0</TicksSpentAssaulting>
</Cortex>

This is basically how long they have been in the world since they first landed. I suggest modifying the <Config> section rather than this one.

And the final two sections:

<BaseCenter>(10, 0, 189)</BaseCenter>
<OwnedPawns>
<Ref>Pawn110111</Ref>
</OwnedPawns>

� <BaseCenter>
◦: This is a single point on a map that they will basically revolve around while waiting. It's a circle with a 6 tile radius. Unless the raiders are actually contained somewhere, they may attack your colonists sooner than you anticipate if a colonist wanders too close. If you build a containment building out of ordinary walls, make sure to set the <team> of the walls to Raider, otherwise the walls will be attacked.

� <OwnedPawns>
◦: <Ref> is the <ID> tag of specific pawns. You can have as many raiders as you like listed here, each with their own specific <Ref> tag. The most I've ever added to this section is 128 individual pawns. Other than a short pause in-game when they decide to attack (caused by the game taking the time to assign targets and generating paths for each of the raiders to follow), there is no harm done. I have no idea if there is an upper limit to this.
If the pawn in question does not exist, and there was only one to begin with, the game will still display the "Raiders have finished staging" message on the screen at the appropriate time.

That's it for the AIKing.

Pawns:
You'll find these listed as: <Def>Pawn</Def>

First, animals. Since they are all pretty much identical (with a few exceptions), the following applies to all of them:

<Def>Pawn</Def>
<ID>Pawn53855</ID>
<Pos>(181, 0, 83)</Pos>
<Rot>1</Rot>
<Kind>Squirrel</Kind>
<Sex>Female</Sex>
<Age>52</Age>

I think these are pretty much self-explanatory.
If an animal is psychotic, it'll also have this in this section: <Team>Psychotic</Team>

<mind Class="AI.Pawn_MindAnimal">
<MindState>
<EnemyTarget>null</EnemyTarget>
</MindState>
</mind>

Unless the animal is psychotic, nothing here changes. If it is psychotic, it'll have this as well: <BrokenState>Psychotic</BrokenState> Anything that does not have this is a potential target. This can be used to have an entire species of animal go insane and attack not only everything else, but also each other.

The sections <jobs> and <pather> will have their own separate category, as they are complex and apply to all Pawns.

<healthTracker>
<PawnHealth>17</PawnHealth>
<TicksToNextHeal>346</TicksToNextHeal>
</healthTracker>

I think these are pretty much self-explanatory as well.

The <inventory> section will be covered when talking about humans. For animals this section doesn't really apply.

I see absolutely no use whatsoever for the <filth> section. If you wish to remove whatever filth the animal is carrying, change the section to this:

<filth>
<CarriedFilth />
</filth>


<food>
<PieceFood>
<CurLevel>72.04837</CurLevel>
</PieceFood>
</food>

The food level of the animal. 100 is the maximum. The lower this gets, the more likely the animal will eat. It also determines how much the animal will eat.

If the animal is starving, <CurLevel> will be replaced with this: <TicksToNextStarveDamage>2346</TicksToNextStarveDamage>

The rest of the animal doesn't apply to them:

<rest IsNull="True" />
<carryHands IsNull="True" />
<psychology IsNull="True" />
<prisoner IsNull="True" />
<ownership IsNull="True" />
<talker IsNull="True" />
<skills IsNull="True" />
<story IsNull="True" />
<apparel IsNull="True" />
<equipment IsNull="True" />

Click me to see the continuation of this post.
Because this happened while updating it:
The following error or errors occurred while posting this message:
The message exceeds the maximum allowed length (20000 characters).

[attachment deleted by admin: too old]

TUTORIAL - Creating Custom Scenarios (2024)

References

Top Articles
Latest Posts
Article information

Author: Dean Jakubowski Ret

Last Updated:

Views: 5849

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Dean Jakubowski Ret

Birthday: 1996-05-10

Address: Apt. 425 4346 Santiago Islands, Shariside, AK 38830-1874

Phone: +96313309894162

Job: Legacy Sales Designer

Hobby: Baseball, Wood carving, Candle making, Jigsaw puzzles, Lacemaking, Parkour, Drawing

Introduction: My name is Dean Jakubowski Ret, I am a enthusiastic, friendly, homely, handsome, zealous, brainy, elegant person who loves writing and wants to share my knowledge and understanding with you.