SCP: Classified Site Plugin API
  • Quick Start
  • DOCS
    • Folder Structure
    • Creating Plugin Project
    • Creating New Player Class
    • Creating New Item Class
    • Creating New Room Event
    • Creating Additional Networked Class
    • Creating New Admin Panel Menu
    • Abilities
    • Replacing Game Logic
    • Plugin Classes/Game Classes Limitations
  • ID's
    • Inventory Image ID
    • Material ID
    • Team ID
    • Hook ID
  • Game C# Classes
    • ACES
    • AdminPanel
    • Button
    • Config
    • CustomLogger
    • DamageHandler
    • DeadBox
    • DoorManager
    • HitBox
    • HookManager
    • IInteractable
    • InputController
    • ItemPickup
    • Lever
    • NetRoom
    • NetworkedButton
    • NetworkedEvent
    • Player
    • PlayerUtilities
    • ResourcesManager
    • ScriptHelper
    • Trigger
    • UIManager
    • Door
    • SupportManager
    • RoundManager
    • Elevator
  • Another C# Classes
    • Rooms
    • Player Classes
    • Items
    • Admin Panel
Powered by GitBook
On this page
  • Calling methods from base class
  • System/Unity Classes limitations
  • Server/Client Communications
  • Obtaining Player Classes, Items, Room Events
  1. DOCS

Plugin Classes/Game Classes Limitations

PreviousReplacing Game LogicNextInventory Image ID

Last updated 2 months ago

Expect crashes, a lot of errors and etc. This is fine :)

Calling methods from base class

IMPORTANT! Do not call methods from base classes (example: Item, PlayerClass and etc). Like base.Init() and etc. THIS WILL CRASH SERVER/CLIENT WITHOUT ANY MESSAGE

System/Unity Classes limitations

Game use IL2CPP builds, so Classes/Methods/Constructors and etc. that game dont use will not be available in plugins.

If plugin use something, that not available in game, then it will not be loaded and server will not start. You will see error in console, like "Method not implemented" and other like errors.

If you need something, that not available in game, you can contact Game Developer on server or create ticket(better) to ask about implementing this.

Server/Client Communications

Item, Player Classes, Rooms and etc use three functions to communicate between connections:

  • SendToClient

  • SendToServer

  • SendToEveryone

Calling functions must be public, otherwise they will not be called. They can accept most of base value types, like int, float, string and etc, also Unity Vector3 and Quaternion.

Currently send byte, sbyte, bool not supported, we investigating this issue, maybe some another value types too.

SendToServer also pass Mirror.NetworkConnectionToClient as last parameter to function, but this is optionally and not require to be in server function.

Obtaining Player Classes, Items, Room Events

Plugin classes use proxies, so when trying to get class, check its type, otherwise you will get error of incorrect type. Example:

if(player.playerClass.GetType() == typeof(PlayerClassProxy))
{
    PlayerClassProxy proxy = player.playerClass as PlayerClassProxy;
    Debug.Log(proxy.GetName());
}
else
{
    Debug.Log(player.playerClass.GetName());
}

if(player.items[5].GetType() == typeof(ItemProxy))
{
    ItemProxy proxy = player.items[5] as ItemProxy;
    Debug.Log(proxy.GetName());
}
else
{
    Debug.Log(player.items[5].GetName());
}
our Discord