Coder Social home page Coder Social logo

openrct2lib's Introduction

OpenRCT2Lib

OpenRCT2Lib parses OpenRCT2's New Savefile format (*.park).
This offers *.park file's informations, such as Park's name, Scenario's objective and etc.

Install

npm install --save openrct2lib

Example

const OpenRCT2Lib = require('openrct2lib');

let parkData = new OpenRCT2Lib(__dirname + '/Example.park');
console.log(parkData.park.name);      // Park's name
console.log(parkData.park.cash);      // Park's cash
console.log(parkData.scenario.name);  // Scenario's name

Header

Header is not compressed even if the save file is compressed with gzip.

Property Description Misc.
header.magic
header.targetVersion
header.minVersion
header.numChunks Count of chunks
header.uncompressedSize uncompressed size
header.compression 0: uncompressed, 1: gzip
header.compressedSize compressed size
header.FNV1a FNV1a hash (Offers array of integers yet due to my skill)
header.padding It is just a padding, which is filled with 0

Chunk

0x01: Authoring

Property Description Misc.
authoring.engine E.g. "openrct2 v0.1.2 (Linux)"
authoring.authors
authoring.dateStarted
authoring.dateModified

0x02: Objects

(Not supported yet)

0x03: Scenario

Property Description Misc.
scenario.category Category of the scenario
scenario.name Name of the scenario
scenario.parkName Park name of the scenario
scenario.details Description of the scenario
scenario.objective.type Objective type in number.
1: Guests by {guests}
2: Park value by {currency}
3: Have Fun!
4: Build the best {guest} you can!
5: To have 10 different types of roller coasters
6: Guests by {guests} with park rating 700 above
7: Monthly ride income at least {currency}
8: To have 10 roller coasters with min. length {guests}
9: To finish 5 coasters with excitement ratings of at least {currency}
10: Repay loans and park value with {currency}
11: Monthly profit from food/drink/sales of at least {currency}
* {guests} = objective.guests, {currency} = objective.currency
scenario.objective.typeText Objective type in text
scenario.objective.year Year value of objective
scenario.objective.guests Count of Guests for objective.type=1
RideId for objective.type=4
Min. length of coaster for objective.type=8
scenario.objective.currency Money value for objective.type=2, 7, 10, 11
Min. excitement ratings for objective.type=9
scenario.objective.ratingWarningDays
scenario.objective.completedCompanyValue Completed company value
scenario.objective.allowEarlyCompletion 1 if the scenario early completion is allowed
scenario.objective.scenarioFileName Seems not accurate?

0x04: General

Property Description Misc.
general.gamePaused
general.currentTicks
general.dateMonthTicks
general.dateMonthsElapsed
general.rand
general.guestInitialHappiness
general.guestInitialCash
general.guestInitialHunger
general.guestInitialThirst
general.peepSpawns (Not supported yet)

0x05: Climate

Property Description Misc.
climate.state Current weather state
0: Cool and wet
1: Warm
2: Hot and dry
3: Cold
climate.updateTimer
climate.current weather
temperature
weatherEffect
weatherGloom
level
climate.next (Same with above)

0x06: Park

Property Description Misc.
park.name Park name
park.cash Current cash
park.loan Current loan
park.maxLoan Maximum loan
park.loanInterestRate Interest rate of loan
park.parkFlags
park.parkEntranceFee Entrance fee of the park
park.staffHandymanColour Colour index of Handymans
park.staffMechanicColour Colour index of Mechanics
park.staffSecurityColour Colour index of Securities
park.samePriceThroughoutPark
park.numMonths
park.numTypes
park.expenditureTable
park.historicalProfit
park.marketingCampaigns
park.currentAwards
park.parkValue Current park value
park.companyValue Current company value
park.parkSize Area of the park
park.numGuestsInPark Count of guests in the park
park.numGuestsHeadingForPark Count of guests heading for the park's entrance
park.parkRating Park rating
park.parkRatingCasualtyPenalty
park.currentEpenditure
park.currentProfit
park.weeklyProfitAverageDividend
park.weeklyProfitAverageDivisor
park.totalAdmissions
park.totalIncomeFromAdmissions
park.totalRideValueForMoney
park.numGuestsInParkLastWeek
park.guestChangeModifier
park.guestGenerationProbability
park.suggestedGuestMaximum
park.peepWarningThrottle
park.parkRatingHistory History of park rating
park.guestsInParkHistory History of count of guests in the park
park.cashHistory History of cash
park.weeklyProfitHistory History of weekly profit
park.parkValueHistory History of park value

0x08: Research

Property Description Misc.
research.fundinglevel
research.priorities
research.progressStage
research.progress
research.expectMonth
research.expectDay
research.lastItem
research.nextItem
research.itemsUninvented
research.itemsInvented

0x09: Notifications

(Not supported yet)

0x20: Interface

(Not supported yet)

0x30: Tiles

(Not fully supported yet)

Property Description Misc.
tiles.mapX Map width
tiles.mapY Map height

0x31: Entities

(Not supported yet)

0x33: Banners

(Not supported yet)

0x36: Cheats

(Not supported yet)

0x37: Restricted objects

(Not supported yet)

0x80: Packed objects

(Not supported yet)

References

openrct2lib's People

Contributors

telk5093 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.