Replacing Base Game Text & Images - Alchyr/ModTemplate-StS2 GitHub Wiki
Before following any guide on this page, make sure you have gone through the steps in Setup first.
Replacing Card Images
- Open up your project folder in the godot editor
- If using rider, you can click this button in the top right (If it doesn't appear, make sure your godot path in
Directory.Build.propsis correct)
- If using rider, you can click this button in the top right (If it doesn't appear, make sure your godot path in
-
Place your custom image somewhere in your project folder (somewhere in
ModName/imagesprobably makes the most sense) -
Recreate the same folder structure as the base game card you want to replace the art of
- Example:
images/atlases/card_atlas.sprites/ironclad/strike_ironclad.tres - Look at Extracting Assets and Text to see the base game folder structure for yourself
- Example:
-
In the godot editor, right click >
Create New>Resource> selectCompressedTexture2D
- Find your custom image in the File Editor pane of the godot editor and double click it to open it up in the inspector panel on the right. Find and copy the
Load Pathfield
- Double click on the resource (
.tresfile) you created in a previous step, and paste the copied path into itsLoad Pathfield
- Finally, publish your project, and your changes should appear in-game
Troubleshooting
The newest template version tries to minimize build/publish time by checking if there are any changes in the ModName folder and only creates the pck if there are. You don't want this because you need to place these files outside of that folder. To change this open your .csproj file (the file with the green icon that says C# in it), scroll to the bottom and in the line that says
<Target Name="GodotPublish"...
remove the following:
and '$(IsInnerGodotExport)' != 'true'" Inputs="@(GodotResourceFiles)" Outputs="$(ModsPath)$(MSBuildProjectName)/$(MSBuildProjectName).pck
Replacing Card Text
Since mods are loaded after the base game, using the same localization keys as the base game will cause your mod to replace base game localization.
For example, creating a file at ModName/localization/eng/cards.json with the following contents will change the title and description of ironclad's starter strike:
{
"STRIKE_IRONCLAD.title": "Strike 2",
"STRIKE_IRONCLAD.description": "Electric Boogaloo"
}
The same pattern can be used to change any text in the base-game, look at Extracting Assets and Text to get a reference of the existing localization.