Scenario editing
In the scenario file(s) (ScenarioDescription(*).json in your scenario folder) you can define all quests, events, story elements, progression states and the intro sequence.
Loader intro
You find the intro definition in: ScenarioDescription.json > LoaderIntro
In "Scene" you can select which intro scene logic should be used. Currently there is only "res://Data/UI/MainMenu/WorldLoader/Overlay/Kerzoven/KerzovenLoaderOverlay.tscn". The "Data" is passed to the scene.
Entry key | Type | Description |
---|---|---|
Icon | string (path to a texture.) | Which icon to show next to the text box |
Character | string (path to a texture.) | Which character or texture to show above the text box |
Map | string (path to a texture.) | Which map or texture to show on the right side |
Text | string (path to a texture.) | Which text to display (translatable) |
Scenario state
You find the intro definition in: ScenarioDescription.json > ScenarioState
"Active" contains an array of currently active quest keys.
Fill this with quests you want to have active at game start (tutorial? main scenario? timers? etc.)
Scenarios
You find the intro definition in: ScenarioDescription.json > Scenarios OR in any ScenarioDescription***.json file (*** can be anything).
All scenario entries in all files are combined to one data model. This way you can have a file for the main quest and another for story events and another for side quests etc.
Entry key | Type | Description |
---|---|---|
Condition | Condition entry | Data for the trigger |
Key | string | Identifier to be triggered by other results or conditions. |
Result (optional) | array of result entries | What happens if the condition is fulfilled. |
OnFailed (optional) | array of result entries | What happens if the condition is failed. |
Visibility | string (enum flags) | Sets visibility flags for QuestLog (shows in the journal quest log) and or MainTask (shows in the box on the right side). |
Conditions
Almost all conditions require a "Title", "Text" and a "Description". Depending on the settings, they are shown in the quest journal and on the right quest tracker. Almost all condition support an optional priority to be listed higher in the small quest window on the right side.
Condition types |
---|
#EndGamePause |
#CheckDay |
#ConstructBuilding |
#DemoEnd |
#TaskCollection |
#UnlockDiplomacy |
#DiscoverRegion |
#CreateItem |
#AcceptTask |
#ReallocationTask |
#StateExpression |
EndGamePause
True if the game is not paused
Entry key | Type | Description |
---|---|---|
Title | string | Which text to display (translatable) |
Text | string | Which text to display (translatable) |
Description | string | Which text to display (translatable) |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
CheckDay
True if the specified day has been reached.
Entry key | Type | Description |
---|---|---|
Title (optional) | string | Which text to display (translatable). You get an optional String.Format {0} argument with the days left. "Wait {0} days." |
Text (optional) | string | Which text to display (translatable). You get an optional String.Format {0} argument with the days left. "Wait {0} days." |
Description (optional) | string | Which text to display (translatable). You get an optional String.Format {0} argument with the days left. "Wait {0} days." |
Image (optional) | string (texture path) | Image shown next to the "Text" |
Day | number | Fixed day to reach. To use relative time points, set this to a negative number and provide RelativeDays. |
RelativeDays (optional) | number | If Day is a negative number: How many days to reach after the entry got activated.
For example if Day is -1 and RelativeDays is 1 and the entry is activated the first time at day 17, it will trigger in day 18. |
FailsOnCondition (optional) | boolean | If set to true, this condition will fail the quest when the day was reached. |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
ConstructBuilding
True if one of the given buildings was built by the player.
Entry key | Type | Description |
---|---|---|
Text | string | Which text to display (translatable) |
Image (optional) | string (texture path) | Image shown next to the "Text" |
IDs | array of numbers (building ID) | which buildings are targeted. First one generates the text. |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
DemoEnd
Never true. No data.
TaskCollection
True if all specified conditions are true.
Entry key | Type | Description |
---|---|---|
Title | string | Which text to display (translatable) |
Text | string | Which text to display (translatable) |
Description | string | Which text to display (translatable) |
Image (optional) | string (texture path) | Image shown next to the "Text" |
Condition | array of Conditions | Yes, this is recursive. This way you can add as many conditions as you like. |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
UnlockDiplomacy
True if the player unlocked the given right
Entry key | Type | Description |
---|---|---|
DiplomacyRight | string (DiplomacyRight) | Which right needs to be unlocked |
SpecificFactionIndex (optional) | int (faction index) | What other faction should the player faction unlock something. If no number is given, we will check if any faction has unlocked it with the player. |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
DiscoverRegion
True if the player discovered the given region.
Entry key | Type | Description |
---|---|---|
Map | string (map file name) | The map to discover. For example Tablelands.bin |
RegionHint (optional) | string (is translated) | Helps to hint which region to discover: "Discover Tablelands (Desert)" where Desert is the translated RegionHint. |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
CreateItem
True if the player created the given amount of items since this quest is active.
Entry key | Type | Description |
---|---|---|
Text | string | Which text to display (translatable) |
Image (optional) | string (texture path) | Image shown next to the "Text" |
ItemID | Number | Item ID to create |
ItemCount | Number | How many items need to be created |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
AcceptTask
True if the player accepted this task.
Entry key | Type | Description |
---|---|---|
TaskTitle | string | Which text to display (translatable) |
TaskTitleMark (optional) | string | Optional quest marker: It is placed directly in front of the TaskTitle. Can be the year or a symbol or something short. |
TaskText | string | Which text to display (translatable) |
Description | string | Which text to display (translatable) |
Rejectable (optional) | boolean | Set this to true if this task can be rejected. This will fail the task. |
Image (optional) | string (texture path) | Image shown next to the "Text" |
Question (optional) | string | Text shown above the accept button |
AcceptButtonText (optional) | string | Text shown on the accept button. Default is "Faction_Accept" (Accept). |
RejectButtonText (optional) | string | Text shown on the reject button. Default is "Faction_Reject" (Reject). |
Subtask (optional) | Condition | Can be any condition from this list. Usually a CheckDay to let the quest fail automatically after some time. |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
ReallocationTask
True if the player delivered the material.
Entry key | Type | Description |
---|---|---|
Title | string | Which text to display (translatable) |
Text | string | Which text to display (translatable) |
Description | string | Which text to display (translatable) |
Image (optional) | string (texture path) | Image shown next to the "Text" |
Entries | array of reallocations | Reallocation data |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
Reallocation entry (items)
Used to reallocate items (move items to the community centre to solve this task)
Entry key | Type | Description |
---|---|---|
ID | integer | constant 0 for items |
ItemId | integer | Item ID to reallocate (see Items) |
StepsDone | integer | 0 default / scenario starting point. This is later overwritten by the engine |
TotalSteps | integer | How many items should be reallocated? |
AllowDespawn (optional) | boolean | Allows this quest to take items directly from the faction. Disabled by default.
Normally, people will have to transport the items to the community centre and repack them there. This can be useful for early game reallocation quests. Avoid this in late game. |
Reallocation entry (time)
Used to work at the community centre (required, community activity)
Entry key | Type | Description |
---|---|---|
ID | integer | constant 2 for time |
StepsDone | integer | 0 default / scenario starting point. This is later overwritten by the engine |
TotalSteps | integer | How much work must be done? 1 step is about 30 simulated minutes |
StateExpression
True if the expression results in true.
Entry key | Type | Description |
---|---|---|
Title (optional) | string | Which text to display (translatable) |
Text (optional) | string | Which text to display (translatable) |
Description (optional) | string | Which text to display (translatable) |
Image (optional) | string (texture path) | Image shown next to the "Text" |
FailsOnCondition (optional) | boolean | If the expression results in true, this condition fails instead of resulting in done. |
Expression | ST expression | expression to check. |
Priority (optional) | number | low numbers have high priority, high numbers low priority. 0 is the default. Defines the order in the right small quest box. |
Results
All entries in "Result" are triggered right after each other.
EventEntity
Adds a event entry to the event list
Entry key | Type | Description |
---|---|---|
EventType | string (enum) | Defines in which areas it is shown (Story, Warning, Decision) |
Title | string | Which title to display (translatable) |
Text | string | Which text to display (translatable) |
Subtext (optional) | string | Which additional text to display (translatable) |
Image | string (texture path) | Image shown next to the "Text" |
AsPopup | boolean | true will open the event window as a popup |
IsNew | boolean | Set by the game. False if the player has read the event |
PlaySound
Plays a predefined sound from the Shorts or Clicks list.
Entry key | Type | Description |
---|---|---|
Sound | string (enum Shorts or Clicks) | Sound file to play by enum |
ActivateEntry
Activates another entry with the given key
Entry key | Type | Description |
---|---|---|
Entry | string | Which entry to activate |
ModifyImmigrants
Adds the given number to the event immigration calculation
Entry key | Type | Description |
---|---|---|
Modification | Number | Adds to the event immigration |
ForceImmigration
Directly adds a new person or animal to the game to players faction.
Entry key | Type | Description |
---|---|---|
DaysAlive (optional) | Number | How many days the new person has been alive. Instance default if not given. |
DynamicID (optional) | Number | ID to spawn. Default human if not given. |
ScenarioAchievement
Unlocks a scenario achievement with the given key.
Entry key | Type | Description |
---|---|---|
Key | string | Unlocks a scenario achievement type |
AssignmentExpression
Assigngs a value or a boolean according to the given expression.
Entry key | Type | Description |
---|---|---|
Expression | ST expression | The assignment to execute. |
ModifyGold
Used to give or remove Gold from the player.
Entry key | Type | Description |
---|---|---|
Amount | integer | How much gold to add or remove. |
ItemReward
Used to give a item to the player. It is added to a community centre. If none exists, the reward is lost.
Entry key | Type | Description |
---|---|---|
ItemID | integer | Which item you want to reward the player. |
Count | integer | How man y items you want to add. |
ApplyDynamicEffect
Applies an effect to the defined dynamic objects (buff / debuff)
Entry key | Type | Description |
---|---|---|
EffectID (optional) | integer | Effect ID to apply. Default is Joyful. |
FrameDuration (optional) | integer | Number of simulation frames this effect is active. Default is 1 day (144000). |
Map (optional) | string | Map file name to apply the buff. If no map is given the effect is applied to all maps. |
Targets (optional) | integer array (Animals id) | Applies the buff to all targets with the given IDs. Default is [ 9 ], humans only. |
CustomRain
Changes the rain pattern of a map to a new one, or resets it to map default.
Entry key | Type | Description |
---|---|---|
Map | string | Map file name to modify. |
Data (optional) | integer array ([28], one for each day per year) | The amount or rain per 0.1l x 40 x number per day per tile (4l x number per day).
"4" is already a good amount of water every few days. "8" can create local floods depending on the soil, river-ways and plants. Have a look at the existing rain patterns in the editor to get a feel for which climate / map needs how much water. If data is not given, the map rain will fall back to the default map rain (set in the map editor) |
CustomTemperature
Changes the temperature generator data of a map to a new one, or resets it to map default.
Entry key | Type | Description |
---|---|---|
Map | string | Map file name to modify. |
Data (optional) | float array ([4], generator arguments) | Arguments for the environment temperature generator of the map.
In the world editor you can play around with the values and see graphically how the environment temperature is generated in a year. Have a look at the existing temperature generator arguments in the editor to get a feel for which climate / map needs what environment temperature. If data is not given, the generator will fall back to the default map generator arguments (set in the map editor) |
UnlockDiplomacyReward
Skips the precondition of a diplomatic right with a specific faction and sets the diplomatic quest to active.
Example: If you want to block the "Join" diplomatic action until a quest is solved do the following:
- MissionDescription.json > Diplomacy > Factions > (select faction from the list) > Diplomacy Quests > Join > Preconditions > Write any key EXCEPT one from DiplomacyRight. See Mission editing#Faction definition > Diplomacy Quest Entry > Preconditions.
- ScenarioDescription.json > Scenarios > (select quest from the list) > Result > add UnlockDiplomacyReward entry.
Now the precondition of the diplomacy quest is always false until the quest is solved.
Entry key | Type | Description |
---|---|---|
SourceFaction | int (faction index defined in the mission file, the 0 based position in the faction list) | Which faction wants to unlock something. |
TargetFaction | int (faction index defined in the mission file, the 0 based position in the faction list) | Which faction to unlock something. |
DiplomacyRight | string (DiplomacyRight) | What to unlock. |
DirectlyActivateQuest (optional) | boolean | Directly queues the diplomacy task. |