Skip to content

shhac/DuskerSave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

DuskerSave

Save parsing for the drones in space game Duskers

Usage

  1. Store save file (universedata.txt) in a variable, e.g. universedata
  2. let loadedSaveFile = new DuskerSave(universedata);
  3. Perform edits
  4. let generatedSaveFile = loadedSaveFile.toString()
  5. Save this string back as universedata.txt

If you only want to parse a specific line, you can use it's own class (e.g. new DuskerDrone('12345', 'FOO=Bar:Fizz=Buzz')) or pass it as the only line into DuskerSave

Navigating save file

Known types are parsed into an Object with it's data in the config property. Each of these Objects can be .toStringd into their universedata line

To help you get around faster, there are some methods to find related items,

e.g. to find the slots on your ship

loadedSaveFile.PLAYER[0]
    .ship(loadedSaveFile) // DuskerObj, your ship
    .owns(loadedSaveFile) // Object of Arrays of the different known types
    .SLOT // Array of DuskerSlot

e.g. to find which drone has an item

loadedSaveFile.INVITMD[0] // some item
    .owner(loadedSaveFile) // Object of Arrays of the different known types
    .DRONE // Array of DuskerDrone, in this case either empty or length 1

Notes

  • Any loss of data caused to your game is your own responsibility. Always keep backups.
  • Pull requests welcome

About

Save file parsing for Duskers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published