Ravenfield

Ravenfield

[EA26+][with MOD TOOLS] Ravensharp : A C# Ravenfield API and Mod loader
 This topic has been pinned, so it's probably important
Gaheris96  [developer] 30 Apr, 2022 @ 3:21pm
IF YOU ARE A MODDER
With the new mod tools, you can easily create your own C# mods.

First of all, you need to have the official ravenfield modding tools installed in a unity project.
You also have to subscribe to this mod and find its folder.

Then, import the unity package called RSTools.unitypackage in your Ravenfield modding project, and copy the RavensharpAPI.dll into your project files (you can copy it anywhere, for example in the RSTools folder newly created).

Once all the compilation ends, you can click on "Ravensharp Tools / Install Ravensharp Tools" in your menu bar. Compilation will happen again, and more options will show up in this menu bar.

You can then create a folder where all your c# project will be stored, click on it and then on "Ravensharp Tools / Create Ravensharp Project". Type in your project informations, and your project will be created in this folder.

Folders will be created to put your scripts/prefabs, and you can compile using the option in the menu bar, while selecting your mod's folder.
A prefab named with your mod name will also be created, this prefab will always be compiled.
It is used to "store prefabs" : all the prefabs you put in the "PrefabList" component can be acessed with "Ravensharp.instance.getPrefab("YourModName", prefabIndex);"
PrefabList compenent can also be used to store references on other prefabs, you just have to uncheck "Register Prefabs".

A main script will also be created, it is the heart of your mod, in which its name, version,... are defined. Three of its methods are also called during mod loading, and you can use them to initialize your mod, like registering events, gamemode, ...
Last edited by Gaheris96; 30 Apr, 2022 @ 3:22pm