Skip to content

Commit

Permalink
Merge pull request #4 from guillaumearm/fika
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Aug 9, 2024
2 parents 1547647 + b3f24a1 commit bd6f6b6
Show file tree
Hide file tree
Showing 46 changed files with 4,439 additions and 1,152 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build-and-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build and Lint
on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- run: npm ci
- run: npm run test:ci
- run: bash scripts/check-git-status.sh
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"arrowParens": "avoid"
}
50 changes: 34 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Path to Tarkov

Connect all available maps through the extracts points, bring a multi-stash system and lock traders according to the player offraid position.

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

## Description

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.

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

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

## Features

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

## The Default configuration
![PathToTarkov mermaid image](./config/PathToTarkov-1.png)

![PathToTarkov mermaid image](./config/PathToTarkov.png)

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

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

## Available Exfiltrations

Here is [the complete list of available exfiltrations points](./ALL_EXFILS.md)

## How to edit the current offraid position

The offraid position is stored in your profile in a dedicated field `PathToTarkov`, you can edit it with a regular text editor.

## UnInstallation

Before deleting the mod, you can set the `enabled` props to `false` in `config.json` and start the server once.

It does 2 things in all existing profiles:
It does 2 things in all existing profiles:

1. Ensure the main stash is selected
2. Unlock all traders listed in the config (Please note Jaeger will be unlocked only if the Introduction quest has been already completed)

## More tweaks

Check the [Path To Tarkov Additions](https://github.com/guillaumearm/PathToTarkovAdditions) mod to setup additional restrictions.

## Modding API
Example:

⚠️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.

If you still want to play with it, you can add an option `enable_legacy_ptt_api` in your ptt config set to `true`.

I'll try soon to provide a new better way to change a config dynamically.

Example:

```js
if (!globalThis.PathToTarkovAPI) {
Logger.error(`=> ${this.modName}: PathToTarkovAPI not found, are you sure a version of PathToTarkov >= 2.5.0 is installed ?`);
return;
Logger.error(
`=> ${this.modName}: PathToTarkovAPI not found, are you sure a version of PathToTarkov >= 2.5.0 is installed ?`,
);
return;
}

PathToTarkovAPI.onStart((sessionId) => {
const config = PathToTarkovAPI.getConfig();
const spawnConfig = PathToTarkovAPI.getSpawnConfig();
PathToTarkovAPI.onStart(sessionId => {
const config = PathToTarkovAPI.getConfig();
const spawnConfig = PathToTarkovAPI.getSpawnConfig();

// make some config changes
config.player_scav_move_offraid_position = false;
// make some config changes
config.reset_offraid_position_on_player_die = false;

PathToTarkovAPI.setConfig(config);
PathToTarkovAPI.setSpawnConfig(spawnConfig); // not needed if not changed, it's just for the example
PathToTarkovAPI.setConfig(config);
PathToTarkovAPI.setSpawnConfig(spawnConfig); // not needed if not changed, it's just for the example

// should be called after setting new configs
PathToTarkovAPI.refresh(sessionId);
})
// should be called after setting new configs
PathToTarkovAPI.refresh(sessionId);
});
```

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

Binary file modified config/PathToTarkov-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/PathToTarkov.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bd6f6b6

Please sign in to comment.