SelfReviveUpgrade

版本 v1.0.0·更新於 2026-04-09

Adds a self revive upgrade to the shop

模組介紹 作者原文

Self Revive Upgrade

A simple mod that adds self-revival upgrade. You buy this expensive upgrade in the shop, and then use it. You get a stack of SELF REVIVE. Once you die, and you have more than one SELF REVIVE stacks, that stack decreases and respawns you with all of the items in your inventory in the truck.

This mod relies on REPOLib to add the upgrade and the item upgrade.

How to make new upgrades

It's been a quite complicated journey, so I'd like to share how I achieved adding an upgrade in REPO with REPOLib.

  • I started with setting up Unity project with REPOLib. Install dotnet 9.*, install Unity Hub, and follow this and this tutorials to get Unity project working.
  • Create a new folder in the Assets/ for your mod name.
  • Create a new REPOLib > Mod in your mod folder.
  • Follow this tutorial to create ItemContent, Item Prefab and Item. See below for more information on how to setup that.
  • Export the mod like instructed here.
  • In your.csproj include the bundle like ``.
  • In your repoharmony mod, you can load the bundle from embedded bundle, see SelfReviveUpgrade.RegisterBundledItemAndUpgrade() for more information.
  • Register your upgrade and item with REPOLib as well.

And that should be it! The rest is up to you what you are going to do with the logic.

Setting up Item prefab

While creating ItemContent and Item is covered by the wiki, it was a bit tricky to setup the item prefab (the object itself), so here is a breakdown:

  • Copy over following resources from REPO to your mod:
  • Assets/REPO/Game/Prefabs/Item Upgrae Player Grab Strength.prefab
  • Assets/REPO/Game/Materials/upgrade_strength.mat
  • Assets/REPO/Game/Textures/Texture2Ds/Upgrade_Grab-Strength_Albedo.png
  • Use albedo as a reference for your own upgrade. I drew mine in Krita.
  • Open the material (.mat) and drag and drop albedo into Albedo in the sidebar.
  • Open (double click) the prefab.prefab, and find in the Hierarchy Mesh. Expand Materials and drag and drop over your.mat copy (it took me a while to make my prefab display the correct texture).
  • While stile being in the.prefab, click the root element in Hierarchy (in my case it was Item Prefab, and in Inspector you should see Photon View, Item Upgrade (Script), Item Toggle (Script) and other components).
  • Remove Item Upgrade Player Grab Strength (Script).
  • Add a component named REPO Lib Item Upgrade (Script), and in Upgrade Id specify the ID of an upgrade you'll register with REPOLib.
  • In Item Upgrade (Script) component, under Upgrade Event (), drag and drop into the field under Runtime Only the recently added REPO Lib Item Upgrade (Script) component.
  • Select No Function > REPOLibItemUpgrade > Upgrade () one row above.

That should be it. No need to implement your own class for incrementing your own upgrade stat or creating a patch for it. Congratulations on creating your own upgrade! 🎉

Улучшение на самовоскрешение

Простой мод, который добавляет улучшение самовоскрешения. Вы покупаете это дорогое улучшение в магазине, а затем используете его. Вы получаете стопку SELF REVIVE. Когда вы умираете и у вас больше одной стопки SELF REVIVE, одна стопка расходуется, и вы возрождаетесь со всеми предметами из вашего инвентаря в грузовике.

Этот мод использует REPOLib для добавления улучшения и его предмета.

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

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

BepInEx-BepInExPackZehs-REPOLib

檔案與校驗

檔案名稱
SelfReviveUpgrade-1.0.0.zip
檔案大小
460.7 KiB