GearSwapAPI

版本 v1.0.3·更新於 2023-02-12

Development API for swapping gear in an expedition. Mainly just for my own mods

模組介紹 作者原文

Gear Swap API

A bepinex plugin API that allows for swapping your local player's gear whilst in an expedition

Note: this is an API for plugin developers and does not have any effect on game play on its own

Methods and Properties

GearSwapManager#RequestToEquip(GearId id)

GearSwapManager#SwappableGearSlots

GearSwapManager#SetPickUpSentryOnToolChange

Everything needed to use this API is exposed via the GearSwapManager class

  • GearSwapManager#RequestToEquip(GearId id): Requests to equip the given GearId (you can find GearIds through methods like GearManager#GetAllGearForSlot(InventorySlot slot)). As the name suggests this does not equip the gear right away. The swap will be postponed until certain conditions are met to avoid a plethora of issues surrounding change of weapons and tools (see Blocking Operations below for more details).
  • GearSwapManager#SwappableGearSlots: List of InventorySlot that this API can swap. Currently it can swap GearMelee, GearStandard, GearSpecial, and GearClass.
  • GearSwapManager#SetPickUpSentryOnToolChange(bool pickUp): Sets whether to pick up any sentry guns deployed by the player when tool is swapped (default false). If set to true, any sentry gun deployed by the player will be picked up and have its tool ammo refunded to the player. Otherwise it will leave the sentry deployed even if different tool is given.

Blocking Operations

Gear can not be swapped while these conditions are true to avoid issues and annoyances surrounding changing weapons

  • Gear is Aimed or is Firing (counts bio charging and c-foam firing)
  • Player is hacking
  • Melee not in idle
  • Player is interacting with world (pick up item, climb ladder, etc)
  • Player is carrying level items (cell, turbine, etc)

Things To Note About Gear Swapping

  • Ammo is kept consistent by the % value not by the hidden ammo value in player ammo storage
  • 1% ammo is given to the player to compensate for precision errors causing players to slowly lose ammo
  • Sentry guns hold the player's tool ammo and the player will have 0 tool ammo on them selves
  • Deployed sentries can be picked up by the owner to recover tool ammo (even if you no longer have the sentry in your inventory)
  • Picking up mines whilst holding another tool will only refund a single clip of tool and not the % amount the mine is worth

Patches

1.0.3

  • Updated for Alt R2

1.0.2

  • Updated for R7

1.0.1

  • Fixed issue where level items some times disappeared when changing weapons while interacting

Developed by Cookie_K

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack_GTFO

檔案與校驗

檔案名稱
GearSwapAPI-1.0.3.zip
檔案大小
19.6 KiB