Psychopomp GOLD

Psychopomp GOLD

Tsu's Mod Loader
 This topic has been pinned, so it's probably important
tsubaki  [developer] 23 Nov, 2024 @ 7:39pm
Detailed Guide: Creating Mods For This Loader
This guide will walk you through the entire process of creating, structuring, and testing mods using this mod loader for Psychopomp Gold. Follow these steps to ensure your mod integrates seamlessly with the loader.




Step 1: Understanding Mod Basics


Mods using Tsu's Mod Loader are stored as `.zip` files or folders. These mods must follow a specific structure to work correctly and include a configuration file (info.cfg) that tells the loader how and when to initialize your mod. This is the same way the base game loads mods, so yes your mod can work via both.

---

Step 2: Setting Up Your Mod Folder

1. Create a new folder with the name of your mod (e.g., YourMod).
2. Inside this folder, create subfolders for organizing your scripts, scenes, and other assets.

The reason you must use your own folder name is due to how mods are mounted, if you don't your mod could interact strangely with other mods or base game scripts. You can still place resources outside of the the folder structure and your mod will still be loaded and overwrite those files. Placing them inside of the 'YourMod' folder won't allow this to happen. But you can go both ways encase your mod needs to overwrite or replace certain things.

Example Folder Structure:
YourMod/ ├── Scripts/ │ └── init.gd ├── Scenes/ │ └── example_scene.tscn ├── Sprites/ │ └── custom_sprite.png

3. Compress this folder into a `.zip` file (e.g., your_mod.zip).

---

Step 3: Writing Your Mod’s Configuration File


The info.cfg file tells the mod loader how to load and trigger your mod.

Create a File Named
info.cfg
Inside Your Mod Folder:
You can also edit or modify an existing mods info.cfg
[info] mod_name = "Your Mod Name" mod_type = 3 mod_description = "A brief description of your mod." mod_directory = "your_mod.zip" mod_init_script = "res://YourMod/Scripts/init.gd" mod_load_nodes = ["player"] mod_load_conditions = ["has_group:player"]

Explanation of Fields:
- mod_name: The name of your mod as displayed in the mod loader logs.
- mod_type: Must be set to
3
to work with the loader.
- mod_description: A short summary of your mod's purpose.
- mod_directory: The name of the `.zip` file containing your mod.
- mod_init_script: The entry point script for your mod.
- mod_load_nodes: (Optional) A list of node names that trigger your mod when added to a scene.
- mod_load_conditions: (Optional) Conditions that trigger your mod (e.g., group membership, scene contents).

---

Step 4: Writing a Initialization Script


Your initialization script (init.gd) is the first script executed when the mod is triggered.

You can use this script to run or load any other existing scripts you wish, you do not need to write your entire mod inside of the init.gd script.

Example Initialization Script (init.gd):
extends Node func _ready(): print("[Your Mod] Mod initialized!") # Add your custom mod logic here.

---

Step 5: Testing Your Mod

1. Place the entire mod folder into the following directory:
AppData/Roaming/Psychopomp/mods/

2. Launch the game with Tsu's Mod Loader active.

3. Trigger your mod by adding nodes or conditions specified in your info.cfg.

4. Check the console logs to verify your mod was loaded and initialized.

---

Step 6: Publishing Your Mod to Steam Workshop


1. Create a Workshop item for your mod using the Workshop uploader or SteamCMD.
2. Set Tsu's Mod Loader as a Required Item:
- In the Workshop settings for your item, find the "Required Items" section.
- Search for Tsu's Mod Loader and add it as a dependency.
- This ensures users are prompted to subscribe to the loader when downloading your mod.

3. Include a detailed description of your mod and its functionality.

---

Step 7: Using Triggers in Your Mod


Node-Based Triggers:
- Trigger your mod when specific nodes (e.g.,
player
) are added to a scene.
- Add to info.cfg:
mod_load_nodes = ["player"]

Condition-Based Triggers:
- Trigger your mod based on conditions like group membership or scene contents.
- Add to info.cfg:
mod_load_conditions = ["has_group:player", "scene_contains:brutetongue"]

---

Need Help?

If you encounter issues or have questions about creating mods, feel free to ask in the comments or refer to the Discord[discord.gg] for additional resources.




Start creating and share your mods with the community! Let’s make Psychopomp Gold awesome!
Last edited by tsubaki; 23 Nov, 2024 @ 7:41pm