User:Cherman0/Modding:C Sharp Scripting

Revision as of 13:51, 18 July 2024 by Cherman0 (talk | contribs) (Initial commit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

Caves of Qud is programmed in the C Sharp v9.0 language (commonly abbreviated to "C#" or "cs"). Caves of Qud loads a majority of its content via reflection. You may add new files to its database of reflectable objects by including .cs files in your mod. These files are compiled at runtime into an assembly, meaning that adding new C# code is technically as simple as including .cs files somewhere in your mod directory.

C Sharp mods run with the full privileges of the base game. As such, they represent a security risk if any mod were to include malicious code. Whenever a C Sharp mod is changed, users are required to approve the modd to run before it can be loaded. The user will be prompted with a mod approval popup before creating or loading a save file. If the mod is not approved none of its files will be loaded, including files other than .cs files.