You are viewing a potentially older version of this package. View all versions.
REPO_JP-ExtractionAutoRevive-0.1.1 icon

ExtractionAutoRevive

Host-only mod that automatically revives dead players on extraction completion.抽出完了時に死亡したプレイヤーを自動で蘇生するホスト専用MOD

By REPO_JP
Date uploaded a month ago
Version 0.1.1
Download link REPO_JP-ExtractionAutoRevive-0.1.1.zip
Downloads 7628
Dependency string REPO_JP-ExtractionAutoRevive-0.1.1

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2304 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2304

README

ExtractionAutoRevive

  • Host-only automatic revive for all players when the extraction point completes

Overview

  • What this mod does

    • Automatically revives all players when ExtractionPoint.StateSet reaches Complete
    • Runs after a 1-frame delay to avoid timing issues during the state transition
  • Who it is for

    • Hosts who want dead players to be revived automatically at extraction completion without manual commands
  • What changes after installation

    • When the extraction point completes, the host triggers a revive for all detected PlayerAvatar instances

Features

  • Event-driven trigger

    • Hooks ExtractionPoint.StateSet via Harmony and reacts only on state changes
  • Host-only execution

    • Runs only when you are in a Photon room and you are the Master Client (host)
    • Does not run in singleplayer or when you are a non-host client
  • Stage filtering

    • Runs only while SemiFunc.RunIsLevel() is true
    • Excludes lobby and wildcard-style level names based on Unity log "Changed level to:"
  • Safe execution / cancellation

    • Uses an internal token to cancel pending revive actions when levels change or new events arrive
    • Schedules the revive after one frame and skips if the token changed
  • Revive implementation

    • Enumerates PlayerAvatar objects via Resources.FindObjectsOfTypeAll<PlayerAvatar>() and filters to loaded scenes
    • Calls PlayerActions.Revive(PlayerAvatar) via reflection
    • If PlayerActions.Revive(PlayerAvatar) cannot be resolved, the revive is skipped
  • Logging

    • Writes logs to both Unity console and BepInEx log with [ExtractionAutoRevive] prefix
    • Logs level changes, state transitions, target counts, and per-player revive results

Usage

  • Minimal steps

    • Install the mod on the host
    • Start a multiplayer session as the Master Client (host)
    • Complete the extraction point
    • All detected players are revived automatically
  • Notes

    • Works only for the host (Master Client)

Contact


ExtractionAutoRevive

  • 納品完了ごとに全員を自動蘇生するホスト専用MOD

概要

  • このMODが何をするか

    • ExtractionPoint.StateSetComplete になったタイミングで全員を自動蘇生
    • 状態遷移中のタイミング問題を避けるため 1フレーム遅延で実行
  • どんな人向けか

    • 手動コマンドなしで 抽出完了時に死亡者を自動で蘇生したいホスト向け
  • 導入で何が変わるか

    • 抽出地点が完了すると ホストが検出された全 PlayerAvatar に対して蘇生を実行

特徴

  • イベント駆動トリガー

    • Harmonyで ExtractionPoint.StateSet をフックし 状態変化時のみ処理
  • ホスト専用動作

    • Photonルーム内 かつ マスタークライアント(ホスト)の場合のみ動作
    • シングルプレイ および 非ホスト参加者では動作しない
  • ステージフィルター

    • SemiFunc.RunIsLevel() が true の間のみ動作
    • Unityログの "Changed level to:" を基に ロビーやワイルドカード風のレベル名を除外
  • 安全実行 / キャンセル

    • レベル切替や新規イベント到着時に 保留中の蘇生を無効化するトークンを使用
    • 1フレーム遅延後に実行し トークンが変化していればスキップ
  • 蘇生処理の実装

    • Resources.FindObjectsOfTypeAll<PlayerAvatar>()PlayerAvatar を列挙し ロード済みシーンのみ対象化
    • リフレクションで PlayerActions.Revive(PlayerAvatar) を呼び出し
    • PlayerActions.Revive(PlayerAvatar) を解決できない場合 蘇生をスキップ
  • ログ

    • UnityコンソールとBepInExログに [ExtractionAutoRevive] 付きで出力
    • レベル変更 状態遷移 対象数 各プレイヤーの蘇生結果を記録

使い方

  • 最短手順

    • ホストにMODを導入
    • マスタークライアント(ホスト)としてマルチプレイを開始
    • 抽出地点を完了
    • 検出された全員が自動で蘇生される
  • 注意点

    • 動作するのはホスト(マスタークライアント)のみ

連絡先

CHANGELOG

Changelog

[0.1.0] - Initial Release

Added

  • Host-only automatic revive triggered by extraction completion

    • Hooks ExtractionPoint.StateSet and reacts when state becomes Complete
    • Executes revive after a 1-frame delay to avoid timing issues during state transitions
  • Event-driven design (no polling / interval checks)

  • Host-only guard

    • Runs only when PhotonNetwork.InRoom is true and PhotonNetwork.IsMasterClient is true
    • Skips in singleplayer and for non-host clients
  • Stage filter to avoid lobby / non-level contexts

    • Requires SemiFunc.RunIsLevel() to be true
    • Tracks Unity log "Changed level to:" to maintain a display-level name
    • Excludes Lobby and Level - *
  • Safe cancellation for rapid state changes / level transitions

    • Uses an internal token to cancel a pending revive if the token changes before execution
  • Revive execution pipeline

    • Enumerates PlayerAvatar via Resources.FindObjectsOfTypeAll<PlayerAvatar>()
    • Filters targets to loaded scenes only
    • Resolves PlayerActions.Revive(PlayerAvatar) via reflection and invokes it for each target
    • Skips revive when PlayerActions.Revive(PlayerAvatar) cannot be resolved
  • Detailed logging

    • Logs state transitions, host checks, stage filter results, target counts, and per-player revive results

[0.1.1] - Updated

Changed

  • Refactoring based on received cleanup advice (no behavior change)

    • Replaced player enumeration from Resources.FindObjectsOfTypeAll<PlayerAvatar>() to GameDirector.instance.PlayerList
    • Replaced health checks from reflection (GetField / GetValue) to direct access player.playerHealth.health
    • Replaced revive invocation from reflection (MethodInfo.Invoke) to direct call player.Revive(true)
    • Replaced extraction flag updates from reflection (SetValue) to direct assignment player.playerDeathHead.inExtractionPoint = true and player.playerDeathHead.inTruck = true