Modding: Creating new Events

From Surviving the Aftermath Wiki
Jump to navigation Jump to search

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.


<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>

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
Weapons Weapons
Medicine Medicine
Components Components
Plastic Plastic
Fun Box Entertainment
Herbal Medicine Herbal
Iodine Pills Iodine
Antibiotics Antibiotics
Vaccine Vaccine
Electronics Electronics
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
Mealworms Mealworms
Buffaloworms Buffaloworms
Waxworms Waxworms
Seed: Wheat wheat_seed
Seed: Cabbage cabbage_seed
Seed: Carrot carrot_seed
Seed: Peanut peanut_seed
Seed: Soybean soybean_seed
Eggs: Crickets cricket_eggs
Eggs: Cockroaches cockroach_eggs
Eggs: Mealworms mealworm_eggs
Eggs: Buffaloworms buffaloworm_eggs
Eggs: Waxworms waxworm_eggs

NOTE: If you set the min and max amount to 1 with highlighted resources and the player doesn’t yet have the ability to grow said plant/insect, the game reads it as a seed/egg and not a single piece of Wheat or Crickets, for example.

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
Poisoned Poisoned

Illustrations[edit]

Used in: <content image_name="Event_Fire"

Illustration ID Description
Event_Fire Rough sketch of a burning bunker
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
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

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
A single person Default
A colorful van Merchant
Couple of bandits Bandit
A single man Single
Woman with a child WomanChild
Three people in a circle Group
A single bandit SingleBandit
A group of bandits with hostages Slavers

Trigger buildings[edit]

Used in: <trigger type="Building" target="Tent" />

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 WindGenerator
Large Wind Turbine WindTurbine
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
Disagreement DISAGREE
Declined request DECLINE
Feast FEAST
Hostilities HOSTILITIES
Luck LUCK
Nuclear Fallout FALLOUT
Pandemic PANDEMIC
Magnetic Storm MAGSTORM
Meteor Shower METEORS