Modding:Location contexts
← Index
This page explains location contexts. This is an advanced guide for modders.
Format
Custom contexts can be created by editing the new Data/LocationContexts asset, and setting the context name in the location's LocationContext map property.
The data asset consists of a string → model lookup, where the key matches the Name field and the value is a model with these fields:
Required fields
field | effect |
---|---|
Name | The unique string ID for the location context. |
Player actions
field | effect | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AllowRainTotem | (Optional) Whether a rain totem can be used to force rain in this context tomorrow. If false, using a rain totem here will show a "this item can't be used here" message instead. | ||||||||||||
RainTotemAffectsContext | (Optional) If set, using a rain totem here will change the weather in the given context ID. For example, rain totems in the desert change weather in the valley. | ||||||||||||
MaxPassOutCost | (Optional) When the player passes out (due to exhaustion or at 2am) in this context, the maximum amount of gold lost. If omitted or set to -1, uses the same value as the Default context (![]() | ||||||||||||
PassOutMail | (Optional) When the player passes out (due to exhaustion or at 2am) in this context, the possible letter IDs to add to their mailbox (if they haven't received it before). If multiple letters are valid, one will be chosen randomly (unless one specifies SkipRandomSelection).
This consists of a list of models with these fields:
| ||||||||||||
PassOutLocations | (Optional) When the player passes out (due to exhaustion or at 2am) in this context and they started the day in a different location context, the locations where they'll wake up. (If the player started the day in the same context, they'll wake up in the last bed they slept in instead.)
If the selected location doesn't contain a bed and doesn't have the AllowWakeUpWithoutBed map property, the player will wake up in the farmhouse instead. This consists of a list of models with these fields:
If no locations are specified or none match, the player will wake up in their bed at home. | ||||||||||||
ReviveLocations | (Optional) If the player just got knocked out in combat, the location names where they'll wake up.
This consists of a list of models with these fields:
If the selected location has a standard event with the exact key PlayerKilled (with no / or preconditions in the key), that event will play when the player wakes up and the game will apply the lost items or gold logic. The game won't track this event, so it'll repeat each time the player is revived. If there's no such event, the player will wake up without an event, and no items or gold will be lost. If no locations are specified or none match, the player will wake up at Harvey's clinic. |
Season
field | effect |
---|---|
SeasonOverride | (Optional) The season which is always active for locations within this context (one of spring, summer, fall, or winter). For example, setting summer will make it always summer there regardless of the calendar season. If not set, the calendar season applies. |
Weather
field | effect | ||||||||
---|---|---|---|---|---|---|---|---|---|
WeatherConditions | (Optional) The weather logic to apply for locations in this context (ignored if CopyWeatherFromLocation is set). Defaults to always sunny. If multiple are specified, the first matching weather is applied.
This consists of a list of models with these fields:
| ||||||||
CopyWeatherFromLocation | (Optional) The Name (i.e. unique ID) of the location context from which to inherit weather. |
If a passive festival is active in any location within this context, the weather is sunny for the entire context regardless of these fields.
Music
field | effect | ||||||||
---|---|---|---|---|---|---|---|---|---|
DefaultMusic | (Optional) The cue ID for the music to play when the player is in the location, unless overridden by a Music map property. Despite the name, this has a higher priority than the seasonal music fields below. Ignored if omitted. | ||||||||
DefaultMusicCondition | (Optional) A game state query which returns whether the DefaultMusic field should be applied (if more specific music isn't playing). Defaults to always true. | ||||||||
DefaultMusicDelayOneScreen | (Optional) When the player warps and the music changes, whether to silence the music and play the ambience (if any) until the next warp (similar to the default valley locations). Default false. | ||||||||
Music | (Optional) A list of cue IDs to play before noon in this location unless it's raining, there's a Music map property, or the context has a DefaultMusic value. If multiple values are specified, the game will play one per day in sequence.
This consists of a list of models with these fields:
| ||||||||
DayAmbience NightAmbience |
(Optional) The cue ID for the background ambience to play when there's no music active, depending on the time of day. Both default to none. | ||||||||
PlayRandomAmbientSounds | (Optional) Whether to play random outdoor ambience sounds depending on factors like the season and time of day (e.g. birds, crickets, and mysterious groan sounds in the rain). This is unrelated to the DayAmbience and NightAmbience fields. Default true. |
Advanced
field | effect |
---|---|
CustomFields | The custom fields for this entry. |