Skip to content

Commit

Permalink
Update docs, support catchRate and captureRate aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
adefee committed Feb 11, 2024
1 parent 3cb25c5 commit 6ccd364
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ This is probably not what we usually want, right? No problem - we calculate the
{
"handle": "Ghostpixel",
"statusPoints": {
"catchRate": 9001,
"captureRate": 9001,
},
}
]
Expand All @@ -145,7 +145,7 @@ Before we continue, let's talk about names real quick. There are two fields we u

> Pro Tip: If you have multiple players with the same name, Paver will tell you it's indeterminate and will not make any changes to your save - we don't want to modify the wrong player! In such cases, you'll want to specify the `guid` field of the target player.
Oh, and Ghost's capture rate? *It's OVER 9000!* Fun fact: We tried 5000 once and he had 100% capture rate with basic spheres on endgame bosses! On a more serious note, astute observers may have noticed that `catchRate` is inside of Status Points, where we also put HP, weight, stamina, etc. We were surprised, too, but this is how the save file organizes it. In cases like this, we've tried to keep our structure as close to that of the save file as possible so.
Oh, and Ghost's capture rate? *It's OVER 9000!* Fun fact: We tried 5000 once and he had 100% capture rate with basic spheres on endgame bosses! On a more serious note, astute observers may have noticed that `captureRate` is inside of Status Points, where we also put HP, weight, stamina, etc. We were surprised, too, but this is how the save file organizes it. In cases like this, we've tried to keep our structure as close to that of the save file as possible so.

## Config Options
Below is a list of all currently available options for the `config.json` file. All fields other than `gameSaveDirectoryPath` are optional; the values you see below are the defaults (by us or Palword). Below is an example with all currently possible options specified; look below that for a table/list that dives into the purpose of each.
Expand Down Expand Up @@ -205,7 +205,7 @@ Below is a list of all currently available options for the `config.json` file. A
"stamina": 0,
"attack": 0,
"weight": 0,
"catchRate": 0,
"captureRate": 0,
"workSpeed": 0,
},
"appearance": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adefee/palworld-save-editor",
"version": "2.0.13",
"version": "2.0.14",
"description": "Comprehensive and extensible save editor and reporting tool for Palworld",
"main": "dist/index.js",
"type": "commonjs",
Expand Down
Binary file renamed paver-v2.0.13.zip → paver-v2.0.14.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const saveEditorMain = async () => {
// We have our valid config now, make sure it isn't just the dummy one we created earlier.
if (appConfig?.gameSaveDirectoryPath === '<path to your game save directory>') {
criticalErrors.push('Your config.json file is still using the default example content we created for you. Please update your config.json file with your game save directory. See Paver documentation for a list of all available options.');
} else {
} else if (criticalErrors?.length < 1) {
console.info(`Found a valid config file at "${configLocation}", and it appears to be in working order.`);
}
}
Expand Down
25 changes: 14 additions & 11 deletions src/lib/getFieldMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface IFieldMapEntry {
info?: string,
parameterId: string | null, // This will be the parameterId of the field, if it has one (amost never).
targetKey: string,
targetFilteredKey?: string,
type: string,
validate?: (val: any) => boolean,
validationError?: string,
Expand Down Expand Up @@ -187,6 +188,17 @@ export const getPlayerFieldMapByFile = (filename: string, enableGuardrails = tru
validationError: 'Effigy count should be an integer >= 0',
whatDoesThiDo: true,
},
captureRate: {
paverId: 'statusPoints.captureRate',
parameterId: null,
targetKey: 'GotStatusPointList.value.values',
targetFilteredKey: 'StatusPoint.value',
findWithFilter: (spObj) => ['\u6355\u7372\u7387', '捕獲率'].includes(spObj.StatusName.value),
type: 'IntProperty',
info: "This is stored in your SAV file underneath Status Points, but it's actually your capture rate (e.g. from Effigy Captures)! This bumps up your minimum capture rate. Have confirmed a value of 5000 here guarantees a basic blue sphere can 100% first try capture Jetragon, lol. Default is 0.",
validate: (val) => Number.isInteger(val) && val >= 0,
validationError: 'statusPoints.captureRate should be an integer greater than 0.',
},
}

switch (filename) {
Expand Down Expand Up @@ -287,17 +299,8 @@ export const getPlayerFieldMapByFile = (filename: string, enableGuardrails = tru
validate: (val) => Number.isInteger(val) && val >= 0,
validationError: 'statusPoints.weight should be an integer greater than 0.',
},
captureRate: {
paverId: 'statusPoints.captureRate',
parameterId: null,
targetKey: 'GotStatusPointList.value.values',
targetFilteredKey: 'StatusPoint.value',
findWithFilter: (spObj) => ['\u6355\u7372\u7387', '捕獲率'].includes(spObj.StatusName.value),
type: 'IntProperty',
info: "This is stored in your SAV file underneath Status Points, but it's actually your capture rate (e.g. from Effigy Captures)! This bumps up your minimum capture rate. Have confirmed a value of 5000 here guarantees a basic blue sphere can 100% first try capture Jetragon, lol. Default is 0.",
validate: (val) => Number.isInteger(val) && val >= 0,
validationError: 'statusPoints.captureRate should be an integer greater than 0.',
},
captureRate: fieldMapAliasedValues.captureRate,
catchRate: fieldMapAliasedValues.captureRate,
workSpeed: {
paverId: 'statusPoints.workSpeed',
parameterId: null,
Expand Down

0 comments on commit 6ccd364

Please sign in to comment.