Ludeon Forums

Ludeon Forums

  • August 05, 2021, 06:44:01 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4

Author Topic: Save file structure  (Read 21238 times)

Zanaras

  • Muffalo
  • *
  • Posts: 4
  • Refugee
    • View Profile
Re: Save file structure
« Reply #15 on: November 13, 2013, 10:27:59 PM »

LetterStack is the list of all messages you receive about passing traders, raiders, wanderers, and wild critters, that you have not deleted/acknowledged.
Logged

Galileus

  • Guest
Re: Save file structure
« Reply #16 on: November 14, 2013, 03:53:24 AM »

LetterStack is the list of all messages you receive about passing traders, raiders, wanderers, and wild critters, that you have not deleted/acknowledged.

No wonder I had it empty, I delete 'em as soon as they show :) Great, should finish the easy list in few hours and can start with specific saves!
Logged

Galileus

  • Guest
Re: Save file structure
« Reply #17 on: November 14, 2013, 12:56:59 PM »

My brain is not brainin today, so instead of planned tests on different saves I'm going to just go on with some more raw data from the basic one.

<FogGrid>

The grid of known and unknown tiles. Like other grids later I believe they are literally grids made up of different values, so the only real job here is to make up list of symbols/values used. Should be easy enough to confirm or reject that theory with Rhodes' mods for all-mountain or all-plains maps. Comparing amount of symbols to amount of tiles on map should do the trick too (unless specyfic values are of different length)


Quote
      <Fog>
P
z8/Pz8/Pz8/Pz8/Pz8HAAAAAAAAAAAAADA/DwAAAAAAAAAAOD8/BwAwPz8/Pz8/Pz8/Pz8/Pz8BAAAAAAAAAAAAADA/AwAAAAAAA
AAAPj8HAAA8Pz8/Pz8/Pz8/Pz8/Px8AAAAAAAAAAAAAAAAfAAAAAAAAAAAgPx8AAAA/Pz8/Pz8/Pz8/Pz8/PwcAAAAAAAAAAAAAA
AAAAAAAAAAAAAA4PwAAADA/Pz8/Pz8/Pz8/Pz8/PwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+BwAAADw/Pz8/Pz8/Pz8/Pz8/DwAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAfAAAAAD8 (...) AAAAAAAAAAAAA==
      </Fog>

" == "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TU1NTU1NTU1NTU1NTU1NTU1AAAANTU1NTU1NTU1NTU1N
QAAAAAAAAAAAAAAAAAAAAA3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAADcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN
TU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1N
TU1NTU1NTU1NTUANTU1NTU1NTU1NTU1NTU1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==

Logged

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12474
    • View Profile
    • Tynan's Blog
Re: Save file structure
« Reply #18 on: November 14, 2013, 01:00:57 PM »

This is the code that saves boolean grids into that compressed format. It uses Base64 to save characters after bit-packing the booleans several at a time into an array of bytes.

Code: [Select]
public static void ExposeBoolGrid( ref bool[,] grid, string label )
{
string fogBase64 = "";
int numBytes = (int)Math.Ceiling((Find.Map.Size.x * Find.Map.Size.z) / 6f );
byte[] fogBytes = new byte[ numBytes ];

if( Scribe.mode == LoadSaveMode.Saving )
{
//Pack the fog of war map into an array of bytes in base64
int byteInd = 0;
byte bitInd = 1;
for( int k=0; k< Find.Map.Size.z; k++)
{
for( int i=0; i< Find.Map.Size.x; i++)
{
if( grid[i,k] )
fogBytes[byteInd] |= bitInd;

bitInd *= 2;
if( bitInd > 32 )
{
bitInd = 1;
byteInd++;
}
}

}

fogBase64 = System.Convert.ToBase64String( fogBytes );

fogBase64 = AddLineBreaksTo(fogBase64);
}


Scribe.LookField( ref fogBase64, label);


if( Scribe.mode == LoadSaveMode.LoadingVars )
{
fogBase64.Replace("\n", "");

//Unpack the Base64 into the fog map

fogBytes = System.Convert.FromBase64String( fogBase64 );

int byteInd = 0;
byte bitInd = 1;
for( int k=0; k< Find.Map.Size.z; k++)
{
for( int i=0; i< Find.Map.Size.x; i++)
{
if( grid == null )
grid = new bool[Find.Map.Size.x, Find.Map.Size.z];

grid[i,k] = (fogBytes[ byteInd ] & bitInd) != 0;

bitInd *= 2;
if( bitInd > 32 )
{
bitInd = 1;
byteInd++;
}
}
}
}

}

Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Galileus

  • Guest
Re: Save file structure
« Reply #19 on: November 14, 2013, 01:05:08 PM »

So, no puzzle for me? Fair enough :)

You put Skyrim's modding support to shame, Tynan. And RimWorlds is good in alpha and before modding ;)
Logged

Galileus

  • Guest
Re: Save file structure
« Reply #20 on: November 14, 2013, 02:11:33 PM »

Note to self - look at a save with half-builded thingies.
Note to self - I'm the self inflicted, mind detonator. Yeah! I'm the one infected, twisted animator. I'm a firestarter, terrific firestarter.

I'll make a basic sketch here, will fill it up with <Def> tags, <Rot> description and such after getting a better save to do so

<Things>

By far most interesting category for most save file editors right after "resources" ;) Contains list of all things on map - colonists, raiders, guns, rubble, filth, steam geysers... Every entry is enclosed in <Thing Class="X">...</Thing> so this is what I'm going to concentrate on.

Common tags

These tags exist in most entries

Quote
         <Def>Reference to the object class, ex. RockRubble, PlantPincushionCactus</Def>
         <ID>ID of the specyfic object in the world, ex. RockRubble30727</ID>
         <Pos>Position of the object in world in XZY coordinates, ex. (118, 0, 3)</Pos>
         <Rot>Rotation, seems the tag isn't there if rot=0 (standard 12'o clock direction)</Rot>
         <Team>Owner of thing</Team>
         <Health>Health/damage of thing</Health>

Marked at the beginning of every class description:

<Def> ; <ID> ; <Pos> ; <Team> ;

In that example said class have <Def>, <ID>, <Pos> and <Team> tags, but does not have <Rot> or <Health> tags.

Electric buildings tags:

Quote
<PowerOn>Is power turned on? (item menu option) True/False</PowerOn>
<DesirePowerOn>Requires power to use? True/False</DesirePowerOn>

Storage buildings tags:

Quote
<SlotGroup>
<AcceptColonistCorpses>True</AcceptColonistCorpses> Do/don't accept colonists corpses
<AcceptStrangerCorpses>True</AcceptStrangerCorpses> Do/don't accept stranger corpses
<AcceptAnimalCorpses>True</AcceptAnimalCorpses> Do/don't accept animal corpses
</SlotGroup>

Tags are present only is True, removed if False. If all these tags are false, the group is empty: <SlotGroup />

Interaction tag:

Quote
<Forbidden>True</Forbidden> Is that thing forbidden for interaction? Not present if False

<Thing Class="Building">

<Def> ; <ID> ; <Pos> ; <Team> ; <Health>

<Thing Class="Building_Battery">

<Def> ; <ID> ; <Pos> ; <Rot> ; <Team> ; <Health>

Quote
<StoredPower>873.2795</StoredPower> Power stored in battery... duh!

<Thing Class="Building_Bed">

<Def> ; <ID> ; <Pos> ; <Rot> ; <Team> ; <Health>

<Thing Class="Building_Chair">

<Def> ; <ID> ; <Pos> ; <Rot> ; <Team> ; <Health>

<Thing Class="Building_CommsConsole">

<Def> ; <ID> ; <Pos> ; <Rot> ; <Team> ; <Health>

<PowerOn> ; <DesirePowerOn>

<Thing Class="Building_Door">

<Def> ; <ID> ; <Pos> ; <Rot> ; <Team> ; <Health>

<PowerOn> ; <DesirePowerOn>

To be continued... when plants and filth stops flying right in front of my eyes ^^'
« Last Edit: November 17, 2013, 08:19:07 AM by Galileus »
Logged

Rhodes

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Re: Save file structure
« Reply #21 on: November 15, 2013, 10:29:31 AM »

I've been cautious of posting anything in this thread because I didn't want to put something in that shouldn't be.  However, I think I should be safe with this edited list.

Normal Buildings:
Code: [Select]
            Comms console:
                maxHealth = 250;
                desc = "Communicate with nearby ships here for negotiation and trade.";
                workToBuild = 400f;
                costList.Add(new ResourceCost(EntityType.Metal, 120));
                filthLeavings.Add("SlagRubble", 2);
                basePowerConsumption = 200f;
                startElectricalFires = true;

            Nutrient paste dispenser:
                maxHealth = 350;
                flammability = 1f;
                desc = "Synthesizes nutrient paste from organic feedstocks.";
                workToBuild = 600f;
                costList.Add(new ResourceCost(EntityType.Metal, 90));
                filthLeavings.Add("SlagRubble", 3);
                startElectricalFires = true;

            Grave:
                useStandardHealth = false;
                desc = "Place the dead in graves to give them a decent final resting place.";
                workToBuild = 200f;
                costList.Add(new ResourceCost(EntityType.Metal, 0));
                storables.Add(StoreType.Corpse);
                maxNumStoreSlots = 1; //(I already tried modding this to make mass graves - doesn't work)

            Gibbet cage:
                maxHealth = 120;
                desc = "Place corpses in gibbet cages for display. These inspire disgust and fear.";
                workToBuild = 200f;
                filthLeavings.Add("SlagRubble", 2);
                maxNumStoreSlots = 1;
                researchPrerequisite = ResearchType.FearTech1;

            Solar generator:
                maxHealth = 300;
                flammability = 1f;
                desc = "Produces electricity from sunlight. Does not work in the dark.";
                workToBuild = 500f;
                costList.Add(new ResourceCost(EntityType.Metal, 80));
                leavings.Add(new LeavingRecord(EntityType.DebrisSlag, 8));
                filthLeavings.Add("SlagRubble", 2);
                transmitsPower = true;

Geothermal generator:
                maxHealth = 500;
                flammability = 1f;
                desc = "Produces electricity from geothermal steam geysers. Must be placed on a geyser.";
                workToBuild = 1000f;
                costList.Add(new ResourceCost(EntityType.Metal, 250));
                leavings.Add(new LeavingRecord(EntityType.DebrisSlag, 0x10));
                filthLeavings.Add("SlagRubble", 3);
                transmitsPower = true;
                placementRestrictions.Add(PlacementRestriction.OnSteamGeyser);

            Battery:
                maxHealth = 100;
                flammability = 2f;
                desc = "Stores electricity when there is excess power and yields it when there is not. Warning - charged batteries tend to explode when heated.";
                workToBuild = 200f;
                costList.Add(new ResourceCost(EntityType.Metal, 50));
                leavings.Add(new LeavingRecord(EntityType.DebrisSlag, 1));
                filthLeavings.Add("SlagRubble", 2);
                transmitsPower = true;
                startElectricalFires = true;

Building Areas:
Code: [Select]
            Stockpile area:
                useStandardHealth = false;
                desc = "Colonists drop resources here.";
                workToBuild = 0f;
                costList.Add(new ResourceCost(EntityType.Metal, 200));
 
            Dumping area:
                useStandardHealth = false;
                desc = "Designates an area where colonists will dump unwanted items.";
                workToBuild = 0f;
                storables.Add(StoreType.Corpse);
                storables.Add(StoreType.Debris);
                storables.Add(StoreType.Meal);
 
            Growing area:
                useStandardHealth = false;
                desc = "Designates an area where colonists will plant crops. Usually grows enough for one or two people.";
                workToBuild = 0f;
                plantToGrowDefName = "PlantPotato";
                supportsPlants = true;

Natural Buildings:
Code: [Select]
            Rock:
                maxHealth = 240;
                selectable = true;
                neverMultiSelect = true;
                desc = "Divides and encloses rooms. Mine to remove.";
                rotatable = false;
                naturalBuilding = true;
                mineable = true;
                makeFog = true;
                leaveTerrain = TerrainDefDatabase.TerrainWithLabel("Rough stone");
                filthLeavings.Add("RockRubble", 2);
                holdsRoof = true;
                isBarrier = true;
 
            Mineral:
                maxHealth = 1000;
                selectable = true;
                neverMultiSelect = true;
                desc = "Mine this for metal.";
                mineableResource = EntityType.Metal;
                naturalBuilding = true;
                mineable = true;
                makeFog = true;
                leaveTerrain = TerrainDefDatabase.TerrainWithLabel("Rough stone");
                filthLeavings.Add("RockRubble", 2);
                holdsRoof = true;
                isBarrier = true;
 
            Steam geyser:
                destroyable = false;
                useStandardHealth = false;
                selectable = true;
                desc = "Natural steam source.";
                beauty = BeautyCategory.Gorgeous;
                neverBuildFloorsOver = true;

Security Buildings:
Code: [Select]
Auto-turret:
                maxHealth = 140;
                basePowerConsumption = 350f;
                desc = "Automatically fires a machine gun at nearby enemies. Will explode when badly damaged.";
                flammability = 1f;
                costList.Add(new ResourceCost(EntityType.Metal, 160));
                workToBuild = 1000f;
                combatTargetBuilding = true;
                beauty = BeautyCategory.Ugly;
                leavings.Add(new LeavingRecord(EntityType.DebrisSlag, 2));
                filthLeavings.Add("SlagRubble", 1);
 
            Blasting charge:
                maxHealth = 50;
                flammability = 1f;
                desc = "Detonates on command.";
                workToBuild = 30f;
                costList.Add(new ResourceCost(EntityType.Metal, 0x23));
                researchPrerequisite = ResearchType.BlastingCharges;

Building Structures:
Code: [Select]
            Wall:
                maxHealth = 280;
                flammability = 1f;
                desc = "Divides and encloses rooms.";
                workToBuild = 75f;
                costList.Add(new ResourceCost(EntityType.Metal, 3));
                selectable = true;
                neverMultiSelect = true;
                leavings.Add(new LeavingRecord(EntityType.DebrisSlag, 1));
                filthLeavings.Add("SlagRubble", 2);
                holdsRoof = true;
                transmitsPower = true;
                isBarrier = true;
 
            Door:
                maxHealth = 240;
                flammability = 1f;
                selectable = true;
                desc = "Seals rooms apart.";
                workToBuild = 150f;
                isBarrier = true;
                costList.Add(new ResourceCost(EntityType.Metal, 0x19));
                placementRestrictions.Add(PlacementRestriction.NotAdjacentToDoor);
                basePowerConsumption = 50f;
                holdsRoof = true;
                transmitsPower = true;
 
            Power conduit:
                flammability = 1f;
                maxHealth = 80;
                desc = "Transmits power.";
                workToBuild = 10f;
                costList.Add(new ResourceCost(EntityType.Metal, 1));
                selectable = true;
                neverMultiSelect = true;
                transmitsPower = true;
   
            Sandbags:
                pathCost = 60;
                coverPercent = 0.6f;
                maxHealth = 300;
                desc = "Cover from gunfire.";
                workToBuild = 50f;
                costList.Add(new ResourceCost(EntityType.Metal, 3));
                filthLeavings.Add("SandbagRubble", 2);
                selectable = true;
                neverMultiSelect = true;
                beauty = BeautyCategory.UglyTiny;
« Last Edit: November 15, 2013, 10:31:06 AM by Rhodes »
Logged

Galileus

  • Guest
Re: Save file structure
« Reply #22 on: November 15, 2013, 10:32:50 AM »

Beautiful. Wanted to do such a stat-list too in future, but with your code it's way better!
Logged

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12474
    • View Profile
    • Tynan's Blog
Re: Save file structure
« Reply #23 on: November 15, 2013, 11:24:48 AM »

This kind of stuff really would enrich the wiki. And people will actually find it there.
Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Galileus

  • Guest
Re: Save file structure
« Reply #24 on: November 15, 2013, 11:34:39 AM »

I was already contacted by one of wiki contributors. I will do it myself or ask for help in that matter when the whole thing is in a bit better shape - at least 100% noted (red/yellow or green) and perfectly with some holes filled and a little better construction.

People will find it on wiki, true - so better to get it there in best state possible :) Here it's easy to ask and reply and people can see the whole discussion.
Logged

Galileus

  • Guest
Re: Save file structure
« Reply #25 on: November 17, 2013, 08:29:33 AM »

<Thing Class="Building_EquipmentRack">

<Def> ; <ID> ; <Pos> ; <Rot> ; <Team> ; <Health>

<SlotGroup> :
<AcceptAnimalCorpses> Animal corpses on equipment rack?

<Thing Class="Building_Glower">

<Def> ; <ID> ; <Pos> ; <Team> ; <Health>

<PowerOn> ; <DesirePowerOn>

Quote
<GlowOn>True</GlowOn> Defines that this is a lamp-tyle (glowing) object?

<Thing Class="Building_Grave">

<Def> ; <ID> ; <Pos> ; <Rot> ; <Team> ; <Health>

<SlotGroup> :
<AcceptColonistCorpses> ; <AcceptStrangerCorpses> ; <AcceptAnimalCorpses>

<Thing Class="Building_NutrientDispenser">

<Def> ; <ID> ; <Pos> ; <Rot> ; <Team> ; <Health>
<PowerOn> ; <DesirePowerOn>

<Thing Class="Building_PlantGrower">

<Def> ; <ID> ; <Pos> ; <Rot>  ; <Team> ; <Health>

<Thing Class="Building_PowerPlantSolar">

<Def> ; <ID> ; <Pos> ; <Rot>  ; <Team> ; <Health>
<PowerOn> ; <DesirePowerOn>

<Thing Class="Building_PowerPlantSteam">

<Def> ; <ID> ; <Pos> ; <Rot>  ; <Team> ; <Health>
<PowerOn> ; <DesirePowerOn>

<Thing Class="Building_SteamGeyser">

<Def> ; <ID> ; <Pos> ; <Rot>

<Thing Class="Building_Storage">

<Def> ; <ID> ; <Pos> ; <Team>

<SlotGroup> :
<AcceptColonistCorpses> ; <AcceptStrangerCorpses> ; <AcceptAnimalCorpses>

<Thing Class="Corpse">

<Def> ; <ID> ; <Pos> ; <Rot>  ; <Health>

<Forbidden>

Quote
<TimeOfDeath>2084927</TimeOfDeath> Tick in which pawn died
<SourcePawn>...</SourcePawn> Whole <Thing Class="Corpse"> content of the pawn that died

<Thing Class="Equipment">

<Def> ; <ID> ; <Pos> ; <Rot>  ; <Health>

<Forbidden>

<Thing Class="Filth">

<Def> ; <ID> ; <Pos>

Quote
<Thickness>1</Thickness> Amount (density? sprite type?) of filth
<Sources>
   <String>Horton, Oaf</String> If type of filth can have "owner", he's defined here. In this example - Horton's blood.
</Sources>

<Thing Class="Plant">

<Def> ; <ID> ; <Pos> ; <Health>

Quote
<GrowthPercent>0.4075205</GrowthPercent> How close is the plant to full growth, 1=fully grown
<Age>86000</Age> How old is the plant.

<Thing Class="Seed">

<Def> ; <ID> ; <Pos> ; <Rot>  ; <Health>

Quote
<Origin>(196.5, 0.0, 152.5)</Origin> From where the seed travels
<Destination>(191.3, 0.0, 146.3)</Destination> To where the seed travels
<AssignedTarget>null</AssignedTarget> Can be anything other than null?
<TicksToImpact>28</TicksToImpact> How long till it gets to destination? Or how long till it's travel ends even if not reaching the destination?

<Thing Class="ThingResource">

<Def> ; <ID> ; <Pos> ; <Health>

Quote
<StackCount>12</StackCount> Amount of resource in the stack
Logged

Galileus

  • Guest
Re: Save file structure
« Reply #26 on: November 17, 2013, 09:14:52 AM »

<Thing Class="Pawn">

<Def> ; <ID> ; <Pos> ; <Team>

Quote
<Kind>Mercenary</Kind> Description of pawn's role - Colonist, Grenadier, Sniper and so on. Only for human-based pawns.
<CharacterName>Moon</CharacterName> Name. Uses animal type for animals - but I do find it funny to name some muffalos or squirrels ;)
<Age>28</Age> Age of the pawn
<CarriedThing IsNull="True" /> If is carrying anything. Need a save where it does.

Quote
<Drawer>
   <Renderer>
      <BodyName>Gray</BodyName>
      <HeadName>Bob</HeadName>
   </Renderer>
</Drawer> Names of body and head variation. There is only body variation for animals.

Quote
<HealthTracker>
   <PawnHealth>100</PawnHealth> HP
</HealthTracker>

For animals:

Quote
<Mind Class="Pawn_MindAnimal"> Defines the AI type for pawn Need a save with mad animal.
   <MindState>
      <EnemyTarget>null</EnemyTarget> Is in fight with anyone?
   </MindState>
</Mind>

For humans:

Quote
<Mind Class="Pawn_MindHuman"> Defines the AI type for pawn
   <MindState>
      <DutyLocation>(187, 0, 36)</DutyLocation> Where is it's work destination
      <EnemyTarget>null</EnemyTarget> Is in fight with anyone?
   </MindState>
   <WorkSettings>
      <WorkPriorities>
         <KeyList> List of jobs this pawn can take
            <WorkType>Firefighter</WorkType>
            <WorkType>Construction</WorkType>
            <WorkType>Repair</WorkType>
            <WorkType>Growing</WorkType>
            <WorkType>Mining</WorkType>
            <WorkType>PlantCutting</WorkType>
            <WorkType>Hauling</WorkType>
            <WorkType>Cleaning</WorkType>
            <WorkType>Warden</WorkType>
            <WorkType>Doctor</WorkType>
         </KeyList>
         <ValueList> List of priorities for jobs above
            <Int32>4</Int32>
            (...)
            <Int32>4</Int32>
         </ValueList>
      </WorkPriorities>
   </WorkSettings>
</Mind>

Quote
<Jobs>
   <CurJob>
      <JType>Goto</JType> Type of job pawn is currently performing
      <TargetA> Target and location for job
         <TargetThing>null</TargetThing> Job is targeted at that thing
         <TargetLoc>(188, 0, 36)</TargetLoc> Location of the job
      </TargetA>
      <TargetB IsNull="True" /> Secondary target and location for job location Examples?
   </CurJob>
   <CurJobDriver Class="JobDriver_Goto" /> Type of driver that processes the current job. May have sub-sections depending on the driver
</Jobs>

Quote
<Pather>
   <Moving>True</Moving> Is pawn in motion?
   <NextSquare>(187, 0, 35)</NextSquare> Next tile it'll move to
   <TicksUntilMove>5</TicksUntilMove> Tick until start or finish of movement? Not present if <Moving>False</Moving>
   <TotalMoveDuration>40</TotalMoveDuration> How long was it walking?
   <Destination> Destination of the movement, not present if <Moving>False</Moving>
      <TargetThing>null</TargetThing> Thing it moves to - if any
      <TargetLoc>(188, 0, 36)</TargetLoc> Location of the destination
   </Destination>
</Pather>

Quote
<Equipment>
   <Primary IsNull="True" /> No primary equipment - always like that for animals

   OR

   <Primary>
      <Def>Gun_M-24Rifle</Def> Name of equipment
      <ID>Gun_M-24Rifle2259836</ID> ID of equipment
      <Health>100</Health> HP of equipment
   </Primary>
   <Secondaries /> Secondary equipment - not present as of now
</Equipment>

Quote
<Inventory>
   <InventoryList /> For animals and raiders

   OR

   <InventoryList> For colonists
      <Thing Class="ThingWithComponents">
         <Def>DoorKey</Def> Type of inventory - key to pen doors seems to be the only one in there now
         <ID>DoorKey1619941</ID> ID of the item
         <Health>30</Health> HP of the item
      </Thing>
   </InventoryList>
</Inventory>

Quote
<Filth>
   <CarriedFilth> Filth the pawn has on itself (<CarriedFilth /> if no filth)
      <Filth Class="Filth"> Complete <Thing Class="Filth" for the filth carried on pawn
         <Def>FilthSand</Def>
         <ID>FilthSand2259568</ID>
         <Thickness>1</Thickness>
         <Sources />
      </Filth>
   </CarriedFilth>
</Filth>

Quote
<Food>
   <PieceFood>
      <CurLevel>87.49426</CurLevel> Hunger. Lower = more hungry
   </PieceFood>
</Food>

For animals:

Quote
<Rest IsNull="True" />
<Psychology IsNull="True" />
<Prisoner IsNull="True" />
<Ownership IsNull="True" />
<Talker IsNull="True" />
<Skills IsNull="True" />
<Story IsNull="True" />
<Traits>
   <TraitList />
</Traits>

For humans:

Quote
<Rest>
   <PieceRest>
      <CurLevel>81.93433</CurLevel> Rest. Lower = more exhausted
   </PieceRest>
</Rest>

Quote
<Psychology>
   <LoyaltyBase>
      <CurLevel>49.77994</CurLevel> Loyalty level
   </LoyaltyBase>
   <PieceHappiness>
      <CurLevel>49.77755</CurLevel> Happiness level
   </PieceHappiness>
   <PieceFear>
      <CurLevel>47.75155</CurLevel> Fear level
   </PieceFear>
   <PieceEnvironment>
      <CurLevel>35</CurLevel> How much it likes current environement
   </PieceEnvironment>
   <PieceOpenness>
      <CurLevel>52.5</CurLevel> How claustrophobic it gets (it's cramped thoughts)
   </PieceOpenness>
   <ThoughtHandler>
      <ThoughtList> List of thoughts it currently has
         <Thought Class="Thought">
            <ThoughtType>EnvironmentUgly</ThoughtType> Thought type
         </Thought>
      </ThoughtList>
   </ThoughtHandler>
</Psychology>

Quote
<Prisoner IsNull="True" /> Is prisoner? Need save with a prisoner

Quote
<Ownership>
   <OwnedBed>Bed1734551</OwnedBed> ID of bed it owns
</Ownership>

Quote
<Talker>
   <LastTalkTime>2168790</LastTalkTime> Tick in which pawn had last social talk
</Talker>

Quote
<Skills>
   <Level_Construction>10</Level_Construction> Level of a skill
   <XpSinceLastLevel_Construction>9428.652</XpSinceLastLevel_Construction> XP gained since last level-up
   <Level_Growing>7</Level_Growing>
   <XpSinceLastLevel_Growing>6737.5</XpSinceLastLevel_Growing>
   <Level_Research>7</Level_Research>
   <XpSinceLastLevel_Research>0</XpSinceLastLevel_Research>
   <Level_Mining>7</Level_Mining>
   <XpSinceLastLevel_Mining>128.7</XpSinceLastLevel_Mining>
   <Level_Shooting>3</Level_Shooting>
   <XpSinceLastLevel_Shooting>2497</XpSinceLastLevel_Shooting>
   <Level_Melee>3</Level_Melee>
   <XpSinceLastLevel_Melee>0</XpSinceLastLevel_Melee>
   <Level_Social>1</Level_Social>
   <XpSinceLastLevel_Social>746.803</XpSinceLastLevel_Social>
   <Level_Cooking>3</Level_Cooking>
   <XpSinceLastLevel_Cooking>0</XpSinceLastLevel_Cooking>
   <Level_Medicine>3</Level_Medicine>
   <XpSinceLastLevel_Medicine>0</XpSinceLastLevel_Medicine>
   <Level_Artistic>3</Level_Artistic>
   <XpSinceLastLevel_Artistic>0</XpSinceLastLevel_Artistic>
   <Level_Crafting>3</Level_Crafting>
   <XpSinceLastLevel_Crafting>0</XpSinceLastLevel_Crafting>
</Skills>

Quote
<Story>
   <StoryItems>
      <Int32>18</Int32>
      <Int32>12</Int32> Backgrounds of the pawn
   </StoryItems>
</Story>

Quote
<Traits>
   <TraitList> List of pawn's traits
      <Trait Class="Trait">
         <DefName>Double-jointed</DefName> Name of pawn's trait
      </Trait>
      <Trait Class="Trait">
         <DefName>Facial scars</DefName>
      </Trait>
   </TraitList>
</Traits>
Logged

Galileus

  • Guest
Re: Save file structure
« Reply #27 on: November 17, 2013, 02:37:52 PM »

Started going through a cheat-game to get some useful saves, ended up loosing yet another 3 hours of my life.

DARN YOU, TYNAN! Why can't you be happy doing shitty games, like everyone else? WHYYY!?

And seriously, gathered some good saves there, so should be able to fill quite a few holes and whole thing will be good to go onto wiki soon.
Logged

ItchyFlea

  • Who's a good kitty?
  • Administrator
  • Planetologist
  • *****
  • Posts: 1918
  • Psychotic Squirrel
    • View Profile
Re: Save file structure
« Reply #28 on: November 25, 2013, 03:25:40 AM »

While figuring out the save file structure myself so I could create my scenarios, I learned some things are aren't written here yet, so I thought it would be best to contribute. I used pink for the notes as my explanation may not be entirely accurate.

The following is taken from a boomrat I modified in an early test.
Quote
<CarriedThing Class="ThingResource">
<Def>Metal</Def> Type of resource carried
<ID>Metal22540</ID> Not entirely sure. Doesn't seem to matter if the ID is used multiple times.
<Pos>(98, 0, 103)</Pos> Position of the resource graphic. Best to use the same <Pos> as the entity.
<StackCount>60</StackCount> How much of the resource is being carried.
</CarriedThing>
Quote
<Sex>Female</Sex> If this tag is present and contains 'Female' the entities gender is female. If this contains anything else, nothing is shown for gender. If this tag doesn't exist, the entities gender is Male.

This is taken from my Pirate Raid Scenario for droppods:

Quote
<Thing Class="DropPodIncoming">
<Def>DropPod(Incoming)</Def>
<ID>DropPod(Incoming)22115</ID>
<Pos>(100, 0, 98)</Pos> Where on the map the drop pod will land.
<TicksToImpact>150</TicksToImpact> How long until it lands. There seems to be a limit to how long this can be. 200?
<Contents>
<ContainedThing Class="Pawn">
Same contents as <Thing Class="Pawn">
</ContainedThing>
</Contents>
</Thing>

Also, for <Thing Class="Building"> Using this: <Team>Raider</Team> prevents the player from interacting with said building. This can be applied to pretty much anything, walls, doors, beds, etc. The player cannot sell Buildings owned by Raiders. (But can target and destroy them with the appropriate weapon.)
If an entity has a doorkey in their <Inventory> they can walk through any door unhindered, regardless of the Team setting.

I hope this helps.  :)
« Last Edit: November 25, 2013, 03:34:11 AM by ItchyFlea »
Logged
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

ItchyFlea

  • Who's a good kitty?
  • Administrator
  • Planetologist
  • *****
  • Posts: 1918
  • Psychotic Squirrel
    • View Profile
Re: Save file structure
« Reply #29 on: January 02, 2014, 11:04:12 PM »

Weapon tags. Each weapon should have a unique number in the <ID> tag. It should also be 6 characters long.
The capitalization of the weapon name matters. If it is wrong, the game will fail to load the save file.

Pistol:
Code: [Select]
<Def>Gun_Pistol</Def>
<ID>Gun_Pistol211111</ID>

Shotgun:
Code: [Select]
<Def>Gun_Pump Shotgun</Def>
<ID>Gun_Pump Shotgun446694</ID>

T9:
Code: [Select]
<Def>Gun_T-9 Incendiary Launcher</Def>
<ID>Gun_T-9 Incendiary Launcher446696</ID>

Uzi:
Code: [Select]
<Def>Gun_Uzi</Def>
<ID>Gun_Uzi446694</ID>

Lee Enfield:
Code: [Select]
<Def>Gun_Lee-Enfield</Def>
<ID>Gun_Lee-Enfield446694</ID>

M16:
Code: [Select]
<Def>Gun_M-16Rifle</Def>
<ID>Gun_M16446694</ID>

R4:
Code: [Select]
<Def>Gun_R-4 charge rifle</Def>
<ID>Gun_R-4 charge rifle446694</ID>

M24:
Code: [Select]
<Def>Gun_M-24Rifle</Def>
<ID>Gun_M-24Rifle446694</ID>

Molotov:
Code: [Select]
<Def>Weapon_GrenadeMolotov</Def>
<ID>Weapon_GrenadeMolotov446694</ID>

Frag Grenade:
Code: [Select]
<Def>Weapon_GrenadeFrag</Def>
<ID>Weapon_GrenadeFrag446694</ID>

Turret Weapon (Extremely Over Powered):
Code: [Select]
<Def>Gun_Minigun</Def>
<ID>Gun_Minigun888111</ID>

Example weapon tag for a colonist holding a pistol. The <Pos> tag for the weapon is the same as the colonist <Pos> tag.
Code: [Select]
<Equipment>
<Primary>
<Def>Gun_Pistol</Def>
<ID>Gun_Pistol21111</ID>
<Pos>(100, 0, 95)</Pos>
<Health>100</Health>
</Primary>
<Secondaries />
</Equipment>
Logged
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created
Pages: 1 [2] 3 4