Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.39 KB

README.md

File metadata and controls

39 lines (25 loc) · 1.39 KB

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