R.E.P.O.

Details

Last Updated
3 weeks ago
First Uploaded
3 weeks ago
Downloads
110
Likes
0
Size
14KB
Dependency string
CoolChair-REPOSdk-1.0.0
Dependants

Categories

REPOSdk Documentation

REPOSdk is a lightweight modding helper library for the game REPO, built using BepInEx and Harmony. It provides utilities for interacting with core gameplay elements such as the player controller, health system, camera, and UI. This documentation covers all publicly accessible methods in the Sdk static class.

🧰 Core API: Sdk Class

All functionality is exposed via static methods in the Sdk class. No instantiation is required.

🕹️ Player & Avatar Interaction

GetControllerObject() → GameObject Returns the primary Controller GameObject that manages player input and state.

⚠️ Ensure the player is loaded before calling this method.

GetController() → PlayerController

Retrieves the PlayerController component attached to the controller object.

GetAvatarController() → GameObject

Returns the in-game player avatar GameObject (the visible character model controlled by the player).

GetHealthComponent() → PlayerHealth

Fetches the PlayerHealth component from the player avatar, allowing access to health-related functionality.

Damage(int amount)

Inflicts damage on the player by the specified amount.

Parameters: amount (int): The number of health points to subtract. Behavior: Calls Hurt(amount, false) on the player’s health component. Safety: If the player avatar is not found (e.g., during loading screens), logs a warning: "Failed to take damage! Player not in game!" 📷 Camera Control 🟡 Beta Warning: Camera manipulation features are marked as !BETA! and may be unstable in future game updates.

GetGameCamera() → Camera

Returns the main gameplay camera (Camera Main).

UnlockGameCamera()

Disables the game’s built-in camera control scripts:

Disables CameraPosition on the "Position" GameObject. Disables CameraAim on the "Aim" GameObject. Use this to freely manipulate the main camera via external mods or custom logic.

FixGameCamera()

Re-enables the game’s native camera control systems, restoring default behavior.

InitNewCamera(string name = "NewCamera", Transform parent = null)

Creates a new GameObject with a Camera component.

Parameters: name: Name of the new camera GameObject (default: "NewCamera"). parent: Optional parent Transform to attach the camera to. Side Effect: Automatically registers the new camera in the internal camera list via InsertCameraToList(). ⚠️ This camera is not automatically activated. Use SetupCamera() to switch to it.

SetupCamera(Camera camera)

Activates a custom camera and hides the default UI render layer.

Effects: Enables the provided camera. Deactivates the "Canvas" GameObject (GetGameRenderObject().SetActive(false)), which typically contains HUD elements. Use Case: Full-screen custom camera views (e.g., cutscenes, debug views).

ResetGameCamera()

Restores the original game camera and UI:

Reactivates the "Canvas" GameObject (restoring HUD). Disables all cameras previously added via InitNewCamera(). InsertCameraToList(Camera camera) Registers a Camera instance into the internal tracking list.

Used internally by InitNewCamera(), but exposed for advanced use.

RemoveCameraFromList(Camera camera) Removes a camera from the internal list.

Useful for cleanup (e.g., when destroying custom cameras).

🖼️ UI & Rendering

GetHUD() → GameObject

Returns the root HUD GameObject, typically containing health bars, ammo counters, etc.

GetGameRenderObject() → GameObject

Returns the "Canvas" GameObject — the root UI render layer in Unity.

This is the object toggled on/off when switching to a custom camera via SetupCamera().

📌 Usage Notes

All GameObject.Find(...) calls assume standard scene structure. If the game updates object names, these methods may fail. Camera-related methods do not adjust culling masks, layers, or post-processing by default — handle those separately if needed. The internal cameras collection is not thread-safe. Avoid concurrent access from multiple threads. Always verify object existence (e.g., GetAvatarController() != null) before performing critical operations. ✅ Example: Custom Camera Cutscene csharp

// Create and switch to a new camera
Sdk.InitNewCamera("CutsceneCam");
var cam = GameObject.Find("CutsceneCam").GetComponent<Camera>();
cam.transform.position = new Vector3(10, 5, 0);
cam.transform.LookAt(Sdk.GetAvatarController().transform);

Sdk.SetupCamera(cam);

// ... wait for cutscene ...

// Restore normal view
Sdk.ResetGameCamera();
GameObject.Destroy(GameObject.Find("CutsceneCam"));

Developed for REPO modders — use responsibly. REPOSdk v1.0.0.0 • Compatible with BepInEx 5+

WARN! This SDK in beta and can have changes!(but i will use old sdk compability)

Good luck, modders!

You can chat with me on my steam profile: https://steamcommunity.com/profiles/76561199502193277/

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.