.NET desktop development
moduleDocuments/Roguelands Modding
).Download Code
button, then click Download ZIP
. Then extract the GadgetCore.xml
file inside the Release
folder and copy it to the Roguelands_Data/Managed
folder in your Roguelands install (which is usually somewhere like C:/Program Files (x86)/Steam/steamapps/common/Roguelands
) so it's alongside GadgetCore.dll
.TemplateGadgetMod
and copy it into your modding folder (so for example your path would be Documents/Roguelands Modding/TemplateGadgetMod
.TemplateGadgetMod
folder and the TemplateGadgetMod.cs
and TemplateGadgetMod.csproj
within, and edit the contents of Manifest.ini
to something more appropriate for your mod (e.g. BugFixMod
, BugFixMod.cs
, BugFixMod.csproj
, BugFixMod
, BugFixMod.dll
).README.txt
file inside your mod's folder to set up GamePaths.xml
. The ManagedFolder
field should be Roguelands_Data/Managed/
Create a new project
and select Blank Solution
. The Location
will be one folder above where you store your mods (e.g. Documents
). The Solution Name
will be the name for where you store your mods (e.g. Roguelands Modding
). This should have the same spelling and capitalization so your solution file appears inside your modding folder. Click Create
.Solution Explorer
on the right side of the window (if not, go to View
-> Solution Explorer
). Right click on the solution you just made in the Solution Explorer and go to Add
-> Existing Project...
and direct it to the .csproj file in your mod's folder (e.g. Documents/Roguelands Modding/BugFixMod/BugFixMod.csproj
).Replace in Files
, set the Find
text to TemplateGadgetMod
and the Replace
text to your mod's name without spaces (e.g. BugFixMod
), then click Replace All
. Then change the Find
text to Template Gadget Mod
and the Replace
text to your mod's name (with or without spaces, e.g. BugFixMod
or Bug Fix Mod
).Properties
folder and double-click AssemblyInfo.cs
to edit it. Change all the template stuff.Assets
in your mod's folder (e.g. BugFixMod/Assets
) and dropping .png files in there, then selecting them in the Solution Explorer in Visual Studio and setting Copy To Output Directory
to Copy always
or Copy if newer
. You can then load these textures with GadgetCoreAPI.LoadTexture2D("FileName");
Most "normal" content can be added to the game via GadgetCore without needing to patch, by using GadgetCore's specific methods in your mod's Initialize
method. See the examples below.
Items:
You can change the ItemType
to create emblems, usables, armor, etc. swordUseTex
here is the item texture that shows in your hand when equipped. The image itself is 64x64px but you mostly want to use the top right of the image; the image is centered on the player's hand. swordInventoryTex
is the item texture in your inventory. The image itself is 32x32px but you should generally only use the middle 14x14 to fit in an inventory slot.
protected override void Initialize()
{
Texture2D swordUseTex = GadgetCoreAPI.LoadTexture2D("SwordUse.png"); // equipped
Texture2D swordInventoryTex = GadgetCoreAPI.LoadTexture2D("SwordInventory.png");
var sword = new ItemInfo(ItemType.WEAPON, "Sword", "Scales with STR + FTH/2", swordInventoryTex, 20, new EquipStats(3, 2, 0, 0, 0, 2), HeldTex: swordUseTex);
sword.SetWeaponInfo(new float[6] { 0, 1, 0, 0, 0, 0.5f }, (AudioClip)Resources.Load("au/i/i300")); // scaling and sound
sword.Register("Sword");
sword.OnAttack += sword.SwingSword; // you can replace this with your own attack coroutine
}
Combat Chips:
This code goes in the initialize method like in the previous example.
ChipInfo myChip = new ChipInfo(ChipType.ACTIVE, "Example Chip", "Description here", 8, exampleTexture);
myChip.Register("Example Chip");
myChip.OnUse += MyChip_OnUse;
Ship Tiles:
Enemies:
Planets: