Modding:C Sharp Scripting: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
imported>CaptainTechnicality54384
(Created page with "Category:Modding ==Overview== Caves of Qud loads a majority of it's content via reflection. You may add new files to it's database of reflectable objects by including .cs...")
 
imported>CaptainTechnicality54384
No edit summary
Line 9: Line 9:
The XRL.World.Parts namespace contains all the part definitions in the game, so it's a good place to start digging.
The XRL.World.Parts namespace contains all the part definitions in the game, so it's a good place to start digging.
==Detailed Scripting Topics==
==Detailed Scripting Topics==
*<span class="plugin_pagetree_children_span" id="childrenspan25690149-0"> [[Modding: Creating New Mutations|Creating new mutations]] </span>
* [[Modding: Creating New Mutations|Creating new mutations]]
* [[Modding: Activated Abilities|Adding active abilities]]

Revision as of 15:04, 8 June 2019

Overview

Caves of Qud loads a majority of it's content via reflection. You may add new files to it's database of reflectable objects by including .cs files in your mod. These files are compiled at runtime into an assembly and the type resolver will first check for types in the mod assembly before checking the Caves of Qud game assembly, thus you may add new types or override existing types by including classes with the right naming convention in your mod.

Since your mod runs with full privileges, users must approve mods each time they change, to allow any changes in code to be screened before they execute. This approval mechanism is currently only available via the overlay UI so it either must be enabled or mod approval must be disabled for scripting mods to work properly. If your mod scripts are not approved, no files in your mod will be loaded, to prevent definitions from not having the appropriate classes available in the mod's assembly.

Nosing Around

There's no official DLL to assemble against or open source project but if you want to dig around in the source code you can use https://www.jetbrains.com/decompiler/ or some other tool: http://stackoverflow.com/questions/2646707/something-better-than-net-reflector on Caves of Qud\CoQ_Data\Managed\Assembly-CSharp.dll

The XRL.World.Parts namespace contains all the part definitions in the game, so it's a good place to start digging.

Detailed Scripting Topics