Modding: Events
Contents
Event basics[edit]
Every game Event requires text for descriptions and choices, an illustration plus an XML-file to put it all together. The latter might be confusing to do at first, but this section explains the structure and syntax in detail so you can start creating your own in-game encounters. By far the easiest way to make one is to copy an existing Event and modify it to your needs instead of starting from scratch. Notepad++ or similar editor is highly recommended (set language to XML to get color-coded tags).
Bare minimum you’ll need:
- Name of the event
- Initial description text
- One choice and its button text
- Description of the outcome
- Event illustration (16:9 image, resolution 960x540 PNG format or character: 960x960 PNG format)
- Event XML file named “Eventnamehere.event”
You can create simple Events such as survivors coming over to ask for food or more elaborate ones with several different options and outcomes. Triggers enable you to tie the event to a specific time of day, building present in the colony and so on. Various content options allow you to tweak sound and 3D models attached to the situation.
Events can:
- Give, take or exchange resources
- Give more colonists (but not take away)
- Add conditions to incoming or existing colonists (Injury, Radiation Sickness etc.)
- Affect the colony’s overall Happiness.
The basic XML structure might look something like this:
<lists /> <events> <event setup and choices /> <event result 1 /> <event result 2 /> <event result 3 /> </events>
All ID’s with a hashtag # refer to a text in localization file, which are converted to an actual text string in-game. Example: <button text_key="#EVENT_EXAMPLE_GO" /> could convert to a button reading “Let the colonists go”
XML structure[edit]
Here’s an abbreviated example event with bolded parts explaining in detail what each of them does. The full document is shown after this one with the same color-coding to help you visualize it easier.
LISTS: First, list all the resources and possible random event results.
<list_data> <Resource list name> List of resources <Resource types used> Type and quantities of the resources </Resource list name> <Colonist list> List of new colonists <Colonists you might receive> Gender, age and conditions of the colonist(s) </colonist_list> <Event list name> List of random outcomes <Positive event /> ID of the positive outcome <Negative event /> ID of the negative outcome </Event list name> </list_data>
INITIAL SETUP: Then, set up what the player sees in the notification, what text the initial description uses, different choices, illustration and other parameters such as triggers, 3D models and sound assets.
<events> <Event ID> Unique ID for localization/text <Event content /> Various parameters for refining the event <Triggers /> When and why the event is triggered, usually how many days have passed, the time of day and that Gate is built <choice 1> First choice the player can take <Button text /> Text on the button <Load result /> Which result is loaded after pressing the button </choice> <choice 2> Second choice the player can take <Button text /> Text on the button <Load result /> Which result is loaded after pressing the button </choice> </event>
RESULTS: Finally, create results for the choices a player makes
<Positive result> Text and content of the result <Result 1 content /> Parameters of the result <choice 1> <Button text /> Button text in once the event is over <Load result /> Results of this outcome </choice> </event>
<Negative result> <Result 2 content /> <choice 2> <Button text /> <Load result /> </choice> </event>
<Decline result> <Result 3 content /> <choice 3> <Button text /> <Load result /> </choice> </event>
</events> End tag
Full example document (Example.event)[edit]
And this is what it looks like once done. Pay close attention to the syntax, starting/closing tags and the structure.
< data version="0.0.6"> <list_data> <resource_list name="EVENT_EXAMPLE_RESOURCES_01"> <resource type="Metal" min="3" max="5” /> Which resources and how many are given or taken <resource type="Parts" min="2" max="3" /> </resource_list> <resource_list name="EVENT_EXAMPLE_RESOURCES_02"> <resource type="Tools" min="1" max="1" /> <resource type="Medicine" min="1" max="1" /> </resource_list> <colonist_list name="EVENT_EXAMPLE_01"> <colonist age="25" gender="male" conditions="Injured"/> <colonist age="44" gender="female"/> </colonist_list> <event_list name="EVENT_EXAMPLE_01_RESULTS"> <event_id id="EVENT_EXAMPLE_01_POSITIVE" /> <event_id id="EVENT_EXAMPLE_01_NEGATIVE" /> </event_list> </list_data> <events> <event id="EVENT_EXAMPLE_01" timeout="480" cooldown="9600"> How long the event is available and when can it reappear (in seconds) <content header_key="#EVENT_EXAMPLE_01_NAME" desc_key="#EVENT_EXAMPLE_01_DESC" image_name="Event_Example" soundevent_id="Example" notification_header_key="#EVENT_EXAMPLE_01_NOTIFICATION_HEADER" notification_desc_key="#EVENT_EXAMPLE_01_NOTIFICATION_DESC" visual_object_type="Group" /> <trigger type="DaysPassed" min="10" max="999" /> Time period the event can appear <trigger type="TimeOfDay" min="0.2" max="0.5" /> Time of day event can appear. Midday: 0, Dusk: 0.33, Midnight: 0.5, Dawn: 0.66 <trigger type="Building" target="Trapper" /> Which building must be built before the event can appear, usually the Gate <choice> <button text_key="#EVENT_EXAMPLE_GO" /> <result type="LoadEvent" list_name="EVENT_EXAMPLE_01_RESULTS" /> Picks one result from the list at random </choice> <choice> <button text_key="#EVENT_EXAMPLE_STAY" /> <result type="ModifyColonistsNeeds" event_need_id="DECLINE" happiness_delta = "-0.02" duration ="300" /> Decision leads to 2% Happiness decrease for 300 seconds <result type="LoadEvent" target_event_id="EVENT_EXAMPLE_01_STAY" /> </choice> </event> <event id="EVENT_EXAMPLE_01_POSITIVE" parent_event_id="EVENT_EXAMPLE_01"> <content header_key="#EVENT_EXAMPLE_01_LOOT_NAME" desc_key="#EVENT_EXAMPLE_01_LOOT_DESC" image_name="Event_Scout" soundevent_id="Positive"/> <choice> <button text_key="#EVENT_DONE" /> <result type="ModifyResources" modify_type="add" amount="1" list_name="EVENT_EXAMPLE_RESOURCES_01" /> Choice led to adding 1 resource (example: 2 Parts) from the first list to the player <result type="ModifyResources" modify_type="add" amount="1" list_name="EVENT_EXAMPLE_RESOURCES_02" /> And 1 resource from the second list </choice> </event> <event id="EVENT_EXAMPLE_01_NEGATIVE" parent_event_id="EVENT_EXAMPLE_01"> <content header_key="#EVENT_EXAMPLE_01_INJURY_NAME" desc_key="#EVENT_EXAMPLE_01_INJURY_DESC" image_name="Event_Scout" soundevent_id="Negative" /> <choice> <button text_key="#EVENT_DONE" /> <result type="ModifyColonistsConditions" amount="1" condition="Injured” /> Choice led to 1 random injured colonist </choice> </event> <event id="EVENT_EXAMPLE_01_STAY" parent_event_id="EVENT_EXAMPLE_01"> <content header_key="#EVENT_EXAMPLE_01_STAY_NAME" desc_key="#EVENT_EXAMPLE_01_STAY_DESC" image_name="Event_Scout" soundevent_id="Negative"/> <choice> <button text_key="#EVENT_DONE" /> </choice> </event> </events> < /data>
List data[edit]
Resources[edit]
Used in: <resource type="Wood" min="10" max="15” />
Resource name ID and syntax
Resource name | ID/Syntax |
---|---|
Logs | Wood |
Planks | Plank |
Metal | Metal |
Junk | Scrap |
Parts | Parts |
Tools | Tools |
Clothing | Cloth |
Fiber | Fiber |
Metal Scrap | Debris |
Plastic Trash | Trash |
Firewood | Firewood |
Concrete | Concrete |
Medicine | Medicine |
Components | Component |
Plastic | Plastic |
Fun Box | Entertainment |
Iodine Pills | Iodine |
Antibiotics | Antibiotics |
Corn | Corn |
Fish | Fish |
Wheat | Wheat |
Potatoes | Potato |
Cabbages | Cabbage |
Lettuce | Lettuce |
Venison | Venison |
Berries | Berries |
Carrots | Carrot |
Peanuts | Peanut |
Soybeans | Soybean |
Crickets | Crickets |
Cockroaches | Cockroaches |
Canned Fruit | CannedFruit |
Jerky | Jerky |
Protein Bars | ProteinBars |
Prime Meat | PrimeMeat |
Mealworms | Mealworms |
Buffaloworms | Buffaloworms |
Waxworms | Waxworms |
Science Points | Research |
Silver | Currency |
Seeds | type="cropname" min="1" max="1" |
Eggs | type="insectname" min="1" max="1" |
People[edit]
If you wish to add people to your colony as a result of the event, you can use the following format (taking away colonists is not yet possible):
Create a list of colonist similar to resource list:
<colonist_list name="EVENT_SURVIVORS_PEOPLELIST"> <colonist age="22" gender="female" /> <colonist age="25" gender="male" /> <colonist age="34" gender="female" conditions="Infected"/> </colonist_list>
And use the following line to spawn one random person from that list:
<result type="SpawnColonists" modify_type="add" amount="1" list_name="EVENT_SURVIVORS_PEOPLELIST" />
You can also set give them a condition like Infected, RadiationSickness or Injured.
Seeds and eggs[edit]
Set compatible crop or insect type min and max amount to "1".
Some IDs differ from their resource name due to changes in the game (for example ID for Junk is “Scrap”).
Conditions[edit]
Used in: <result type="ModifyColonistsConditions" amount="1" condition="Injured" />
Condition | ID |
---|---|
Injured | Injured |
Radiation sickness | RadiationSickness |
Infected | Infected |
Mutated | Mutated |
Illustrations[edit]
Used in: <content image_name="Event_Fire"
Illustration ID | Description |
---|---|
Event_Fire | Building burning inside the colony |
Event_Trade | Jolly merchant with a van |
Event_Bandit | Group of menacing bandits with prisoners |
Event_Injured | Wounded people returning to colony |
Event_Survivors1 | Guards looking towards nondescript people outside the gate |
Event_Survivors2 | Nondescript people coming towards the gate |
Event_Survivors3 | A group of worn-down, exhausted people |
Event_Van | A red van with a person with a rifle on top with others around him |
Event_Scout | A single scout using binoculars, looking into the distance |
Event_Sick | A dimly-lit tent full of injured/sick people |
Event_Fight | Two people fighting, surrounded by others |
Event_Unrest | An angry group of colonists |
Event_Building1 | A lone production building from the outside |
Event_Driving | Car and passengers speeding past a large sign |
Character_Bandit | A single masked bandit |
Character_Merchant | A jolly merchant |
Character_Bandit_Leader | Single menacing and big bandit |
Character_Bandits | Two bandits with weapons |
Character_Child | A lone child |
Character_Colonists | Two angry colonists |
Character_Man | A large beaded man holding a gas canister |
Character_Medic | A grinning, colorful young woman with medic's attire |
Character_Merc | A colorful mercenary with a gun and a crossbow |
Character_Survivors | A group of three worn-down survivors, man, woman and child |
Character_Wanderer | Shifty man in an overcoat, carrying a big backpack |
Character_Woman | A female colonist |
Character_Hurtwoman | A female holding her arm in pain |
Character_Carrier_Woman | A stern woman next to some crates |
Character_Hazmat | A male colonist in a hazmat suit |
Character_Man_Hungry | A thin male colonist feeling hungry |
Character_Woman_Old | An older female colonist |
Character_Man_Cultist | A male with open arms |
Event_imagename illustrations are traditional 16:9 pictures. Character_imagename are characters standing on the left side of the text area.
Sound assets[edit]
Used in: soundevent_id="Bandit"
Sound | ID |
---|---|
Bandit | |
Hunt | |
Merchant | |
Help | |
Survivors | |
Positive | |
Negative |
3D models[edit]
Used in: visual_object_type="Default"
Model(s) | ID |
---|---|
Merchant's van | Default |
A colorful van | Merchant |
Couple of bandits | Bandit |
A single man | Single |
A single woman | SingleFemale |
Woman with a child | WomanChild |
Three people in a circle | Group |
A single bandit | SingleBandit |
A group of bandits with hostages | Slavers |
Five people in a circle | MediumGroup |
Two colonists with binoculars | Scouting |
Leader and small group approach the gate | LeaderGroup |
A single beat-up car drives to the gate | RegularCar |
Armored cars and armed people arrive at the gate | Mercs |
Buildings[edit]
Used in setting trigger conditions to events (event will spawn only if all trigger conditions are met), for example:
<trigger type="Building" target="Tent" />
Or for damaging buildings (upcoming feature not yet in the game), for example:
<result type="DamageBuilding" target_name="ToolShop" min_damage = "0.51" max_damage ="0.51" target_count="1" is_hidden="true" />
Buildings start smoking at 50% health and catch on fire at 25%. Some special buildings such as storages and the Gate cannot be damaged this way.
Building | ID and syntax |
---|---|
Tent | Tent |
House | House |
Two-story House | TwoStoryHouse |
Shanty | Shanty |
Stockpile | StorageOutside |
Warehouse | StorageInside |
Food Storage | StorageFood |
Solar Panel | SolarGenerator |
Water Well | Well |
Battery Rack | Battery |
Mission Control | MissionControl |
Scrapper | Scavenger |
Water Tower | WaterTower |
Large Water Tower | WaterTowerLvl2 |
Wind Turbine | WindTurbine |
Large Wind Turbine | WindTurbineLarge |
Mechanic Shop | MechanicShop |
Recycler | Recycler |
Forester | Forester |
Trapper | Trapper |
Sawmill | Sawmill |
Tailor | Tailor |
Medical Tent | MedicalTent |
Toolshop | ToolShop |
Bunker | Bunker |
Broken Truck | Truck |
Pile of Boxes | Bags |
Emergency Shelter | EmergencyShelter |
Tenement | Tenement |
School | School |
Fishing Hut | Fishery |
The Gate | Gate |
Gate Ruins | GateDestroyed |
Small Field | FieldSmall |
Medium Field | FieldMedium |
Large Field | FieldLarge |
Arena | StormDome |
Greenhouse | Greenhouse |
Trade Center | TradeCenter |
Environmental Station | EnvironmentalStation |
Logging Camp | LoggingCamp |
Burial Pit | ThePit |
Secure Storage | SecureStorage |
Cookhouse | Cookhouse |
Mess Hall | MessHall |
Bore Well | BoreWell |
Field Hospital | FieldHospital |
Memorial | Memorial |
Large Solar Panel | LargeSolarPanel |
Radar | Radar |
Insect Farm | InsectFarm |
Bakery | Bakery |
Mill | Mill |
Medical Lab | MedLab |
Library | Library |
Game Arcade | GameArcade |
Movie Theater | MovieTheater |
Large Green Bush | Bush1 |
Large Yellow Bush | Bush2 |
Pink Flower Bush | Bush3 |
White Flower Bush | Bush4 |
Small Green Bush | Bush5 |
Tall Green Bush | Bush6 |
Red Flowers | Bush7 |
Tiny Pink Flowers | Bush8 |
Tiny White Flowers | Bush9 |
Green Tree | Bush10 |
Bottle Tree | Decoration1 |
Bottle Cactus | Decoration2 |
Plastic Flowers | Decoration3 |
Log Flowers | Decoration4 |
Plastic Viola | Decoration5 |
Paper Windmills | Decoration6 |
Stats screen IDs (Needs)[edit]
Used in: <result type="ModifyColonistsNeeds" event_need_id="TRIPSUCCESS" happiness_delta = "-0.02" duration ="300" is_hidden="false" /> Text in Colony status screen
Text in Colony status screen | ID and syntax |
---|---|
Ventured outside the Gate | TRIPSUCCESS |
Successful hunt | HUNT |
Minor bandit event | BANDITS1 |
Bandit event | BANDITS2 |
Major bandit event | BANDITS3 |
Indecision | INDECISION |
Agreement | AGREE |
Disagreement | DISAGREE |
Declined request | DECLINE |
Feast | FEAST |
Hostilities | HOSTILITIES |
Luck | LUCK |
Nuclear Fallout | FALLOUT |
Pandemic | PANDEMIC |
Magnetic Storm | MAGSTORM |
Meteor Shower | METEORS |