0.1.3 • Published 1 year ago

openrct2lib v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

PropertyDescriptionMisc.
authoring.engineE.g. "openrct2 v0.1.2 (Linux)"
authoring.authors
authoring.dateStarted
authoring.dateModified

0x02: Objects

(Not supported yet)

0x03: Scenario

PropertyDescriptionMisc.
scenario.categoryCategory of the scenario
scenario.nameName of the scenario
scenario.parkNamePark name of the scenario
scenario.detailsDescription of the scenario
scenario.objective.typeObjective 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 coasters6: Guests by {guests} with park rating 700 above7: 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.typeTextObjective type in text
scenario.objective.yearYear value of objective
scenario.objective.guestsCount of Guests for objective.type=1RideId for objective.type=4Min. length of coaster for objective.type=8
scenario.objective.currencyMoney value for objective.type=2, 7, 10, 11Min. excitement ratings for objective.type=9
scenario.objective.ratingWarningDays
scenario.objective.completedCompanyValueCompleted company value
scenario.objective.allowEarlyCompletion1 if the scenario early completion is allowed
scenario.objective.scenarioFileNameSeems not accurate?Seems not accurate?

0x04: General

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

PropertyDescriptionMisc.
climate.stateCurrent weather state0: Cool and wet1: Warm2: Hot and dry3: Cold
climate.updateTimer
climate.currentweathertemperatureweatherEffectweatherGloomlevel
climate.next(Same with above)

0x06: Park

PropertyDescriptionMisc.
park.namePark name
park.cashCurrent cash
park.loanCurrent loan
park.maxLoanMaximum loan
park.loanInterestRateInterest rate of loan
park.parkFlags
park.parkEntranceFeeEntrance fee of the park
park.staffHandymanColourColour index of Handymans
park.staffMechanicColourColour index of Mechanics
park.staffSecurityColourColour index of Securities
park.samePriceThroughoutPark
park.numMonths
park.numTypes
park.expenditureTable
park.historicalProfit
park.marketingCampaigns
park.currentAwards
park.parkValueCurrent park value
park.companyValueCurrent company value
park.parkSizeArea of the park
park.numGuestsInParkCount of guests in the park
park.numGuestsHeadingForParkCount of guests heading for the park's entrance
park.parkRatingPark 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.parkRatingHistoryHistory of park rating
park.guestsInParkHistoryHistory of count of guests in the park
park.cashHistoryHistory of cash
park.weeklyProfitHistoryHistory of weekly profit
park.parkValueHistoryHistory of park value

0x08: Research

PropertyDescriptionMisc.
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)

PropertyDescriptionMisc.
tiles.mapXMap width
tiles.mapYMap 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