Skip to content

Commit bd6f6b6

Browse files
guillaumearmTrapNarcoticsRx
authored
Merge pull request #4 from guillaumearm/fika
* chore(experiment): try to override locked maps for a specific user * fix: override of LocationController + custom UI paths * feat: dynamic spawnpoints and locked maps by player (fika support) * refactor: updateSpawnPoints method * feat(fika): new multistash system for fika * fix: lint errors * refactor: StashController * chore: back to default UI paths * feat: enable/disable main hideout according to offraid position * chore: cleanup unused stuff * fix(fika): raidCache indexed by sessionId * 5.2.0-rc.1 * chore: cleanup * fix(fika): handle spawnpoints * 5.2.0-rc.2 * feat: disable run through functionality (#7) * feqt: added Narco alternate config (#9) * added my config * added player_spawnpoints and tooltips .jsons * feat: add heal_always_enabled for in traders config * refactor: added disableRunThrough helper + more logs * fix: missed empty stash during 5.2 profiles migration * style: apply prettier * style: fix lint error * Tooltips (#6) * added tooltip functionality * added Tooltips.json file --------- Co-authored-by: Guillaume ARM <[email protected]> * fix: Tooltips.json is optional (used for PTTR config compat) * chore: add Tooltips.json for PTTR alt config * fix: server error when trying to cleanp an empty profile * 5.2.0-rc.3 * chore: cleanup debug messages when locking/unlocking a map * fix: pttr Tooltips.json crash on missing fields * fix: heal_always_enabled option in traders config * 5.2.0-rc.4 * fix!: deprecate ptt api to avoid issues * chore: add OffraidRegenConfig type * fix(config): rename bypass_disable_run_through into enable_run_through * feat(debug): display sessionId in debug logs * fix: fika support for offraid regen settings * refactor: spawnpoints and exitpoints creation * chore: change access_via to be an array on offraid_regen_config * 5.2.0-rc.5 * chore(cleanup): get rid of unused option for old compat with lua csp * fix: add missing scav extract points when vanilla_exfils_requirements is true * fix: crash of the server caused by repeatable quests * style: prettier * fix: profile corruption zwhen coming from 5.1.0 * 5.2.0-rc.6 * feat: insurance return chance (#16) * feat: defined return_chance_percent for config * feat: added returnChancePercent prop * feat: added return_chance_percent prop to config.json * feat: updated personal config with return chance and heal * fix: added check for undefined props and imported/declared ConfigServer * fix: all the checks * fix: imported/declared configServer in neeeded files * fix: remove fallback for insurance_price_coef Co-authored-by: Guillaume ARM <[email protected]> * fix: corrected syntax error and ts error --------- Co-authored-by: Guillaume ARM <[email protected]> * fix: ground zero is available everywhere * chore: apply prettier * refactor: utils/helpers + introduce isValidSptId helper * chore: fix prettier config * refactor: cleanup modLoader stuff * ci: add test:ci script in package.json * ci: add basic build-and-lint gh workflow * fix(migration): try to get back the main stash id searching in all items * fix: auto-migration of broken mainStashId * chore(debug): print a message in the console when ptt api is disabled * 5.2.0-rc.7 * build: check git status when build a release * chore(check-git-status): print error message at the end of the script * fix: server crash due to the last update * 5.2.0-rc.8 * style: eslint error on rename-zip.js * chore: update generated PathToTarkov-1.png * build: fix prepare-files for windows usage * build: prepare-files.js compat windows * build: rename-zip.js compat windows * fix: broken build * chore: update image * fix: ground zero accessible everywhere (again because of the fika migration) * 5.2.0-rc.9 * refactor: event-watcher don't use getProfile method anymore * refactor: get rid of getInventory in StashController * fix(multistash): items and moneys consumed from incorrect stash * 5.2.0-rc.10 * fix: bug with quest items caused by the new multistash implementation * 5.2.0-rc.11 * fix(config) add heal_always_enabled in alternate configs * build(mdmc): use a better resolution for image generation * feat: add more connectivity in the default config * chore: remove PathToTarkov-1.png * chore: re-add PTT image * chore: prepare ru locale in configs * feat: Ref trader added * refactor: rename NarcoConfig to NarcoticsConfig * feat: add new PathToTarkov drawio + image * feat: do not display maps in the UI when locked * chore: rename alternate config OriginalPathToTarkov into LegacyPathToTarkovV4 * fix: add terminal in MAPLIST in order to hide it like the rest of other maps * feat: draw UI path for connected maps * chore: add terminal to ByMap type * feat: introduce new config field override_by_profiles * fix: remove duplicated ui paths + edge case UI with factory4_night * 5.2.0-rc.12 * fix: override_by_profiles should be optional * 5.2.0-rc.13 * feat: add hideout_main_stash_access_via profile override * feat: add map to config and change vanilla exfil reqs to true for Narco config (#20) * change vanilla exfil reqs for Narco config * added map * perf: convert NarcoticsConfig/TarkovMapV2 to jpg * fix: another try to fix repeatable quests issues * 5.2.0-rc.14 * chore: add dev:install script in package.json * fix: exfils are not mutated in db anymore this can be useful for some compats with other mods * fix: ignore unimplemented maps in updateLocationBaseExits * 5.2.0-rc.15 --------- Co-authored-by: Trap <[email protected]> Co-authored-by: NarcoticsRx <[email protected]>
2 parents 1547647 + b3f24a1 commit bd6f6b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4439
-1152
lines changed

.github/workflows/build-and-lint.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Build and Lint
2+
on: [push]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Use Node.js
10+
uses: actions/setup-node@v4
11+
with:
12+
node-version: '20.x'
13+
- run: npm ci
14+
- run: npm run test:ci
15+
- run: bash scripts/check-git-status.sh

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"arrowParens": "avoid"
8+
}

README.md

+34-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# Path to Tarkov
2+
23
Connect all available maps through the extracts points, bring a multi-stash system and lock traders according to the player offraid position.
34

45
![PTT LOGO](./LOGO.jpg)
56

67
## Description
8+
79
This mod bring the notion of "offraid position" for the player, it locks certains maps according to this offraid position, change all player spawn points to reflect this positions, change the hideout stash and lock/unlock traders according to the config file.
810

911
All corresponding offraid positions, extracts and spawn points can be configured via `config.json` file.
1012

1113
New spawn points can be added in `player_spawnpoints.json`
1214

1315
## Features
16+
1417
- Maps are locked/unlocked according to the offraid position
1518
- Several hideout stash according to your offraid position (disabled in default config)
1619
- Hideout features disabled when player is not on the main stash position
@@ -20,7 +23,8 @@ New spawn points can be added in `player_spawnpoints.json`
2023
- Certains offraid locations enable/disable the hydration/energy/health restoration (according to config)
2124

2225
## The Default configuration
23-
![PathToTarkov mermaid image](./config/PathToTarkov-1.png)
26+
27+
![PathToTarkov mermaid image](./config/PathToTarkov.png)
2428

2529
By default, you are on `MechanicStash` offraid position. It means you can spawn on Customs or Factory maps only.
2630

@@ -31,43 +35,57 @@ When player die, the position is reset to the `MechanicStash` position.
3135
Everything is configurable.
3236

3337
## Available Exfiltrations
38+
3439
Here is [the complete list of available exfiltrations points](./ALL_EXFILS.md)
3540

3641
## How to edit the current offraid position
42+
3743
The offraid position is stored in your profile in a dedicated field `PathToTarkov`, you can edit it with a regular text editor.
3844

3945
## UnInstallation
46+
4047
Before deleting the mod, you can set the `enabled` props to `false` in `config.json` and start the server once.
4148

42-
It does 2 things in all existing profiles:
49+
It does 2 things in all existing profiles:
50+
4351
1. Ensure the main stash is selected
4452
2. Unlock all traders listed in the config (Please note Jaeger will be unlocked only if the Introduction quest has been already completed)
4553

4654
## More tweaks
55+
4756
Check the [Path To Tarkov Additions](https://github.com/guillaumearm/PathToTarkovAdditions) mod to setup additional restrictions.
4857

4958
## Modding API
50-
Example:
59+
60+
⚠️Since PTT 5.2.0 the modding api is deprecated and disabled by default because any usage of `setConfig`, `setSpawnConfig` or `refresh` will not be guaranteed to work due to the rewrite for Fika.
61+
62+
If you still want to play with it, you can add an option `enable_legacy_ptt_api` in your ptt config set to `true`.
63+
64+
I'll try soon to provide a new better way to change a config dynamically.
65+
66+
Example:
67+
5168
```js
5269
if (!globalThis.PathToTarkovAPI) {
53-
Logger.error(`=> ${this.modName}: PathToTarkovAPI not found, are you sure a version of PathToTarkov >= 2.5.0 is installed ?`);
54-
return;
70+
Logger.error(
71+
`=> ${this.modName}: PathToTarkovAPI not found, are you sure a version of PathToTarkov >= 2.5.0 is installed ?`,
72+
);
73+
return;
5574
}
5675

57-
PathToTarkovAPI.onStart((sessionId) => {
58-
const config = PathToTarkovAPI.getConfig();
59-
const spawnConfig = PathToTarkovAPI.getSpawnConfig();
76+
PathToTarkovAPI.onStart(sessionId => {
77+
const config = PathToTarkovAPI.getConfig();
78+
const spawnConfig = PathToTarkovAPI.getSpawnConfig();
6079

61-
// make some config changes
62-
config.player_scav_move_offraid_position = false;
80+
// make some config changes
81+
config.reset_offraid_position_on_player_die = false;
6382

64-
PathToTarkovAPI.setConfig(config);
65-
PathToTarkovAPI.setSpawnConfig(spawnConfig); // not needed if not changed, it's just for the example
83+
PathToTarkovAPI.setConfig(config);
84+
PathToTarkovAPI.setSpawnConfig(spawnConfig); // not needed if not changed, it's just for the example
6685

67-
// should be called after setting new configs
68-
PathToTarkovAPI.refresh(sessionId);
69-
})
86+
// should be called after setting new configs
87+
PathToTarkovAPI.refresh(sessionId);
88+
});
7089
```
7190

7291
Full example usage in [Path To Tarkov Additions source code](https://github.com/guillaumearm/PathToTarkovAdditions/blob/master/package.js).
73-

config/PathToTarkov-1.png

47.9 KB
Loading

config/PathToTarkov.png

568 KB
Loading

0 commit comments

Comments
 (0)