Skip to content
direwolf420 edited this page Jan 27, 2023 · 19 revisions

Welcome to the ClickerClassExampleMod wiki!

This is the Example Mod for the Clicker Class mod. It serves as an up-to-date hub for cross-mod interaction with Clicker Class. Check the sidebar for relevant pages!

You can clone this repo into your ModSources folder (here is the tModLoader modding guide if you haven't got that yet) and explore the possibilities.

If you mod on 1.3, checkout/switch to the 1.3 branch and use the Mod Sources folder instead.

First Steps

Clicker Class Compatibility

NOTE
Not familiar with cross-mod concepts in tModLoader? Please read this guide!

To start working with Clicker Class, please download ClickerCompat.cs, place the file into your mod's root folder (where the build.txt is), and change the namespace from ClickerClassExampleMod to your mod's internal name. This file contains everything you need to start working with Clicker Class, so be sure to read all the comments!

Dependencies

Hard Dependencies

If you want to make a mod that will not work without Clicker Class enabled, add the following line to your build.txt:

modReference = ClickerClass

Soft Dependencies

If you want to make a mod that will work by itself, but will have additional content when players use Clicker Class with it, consider doing the following for added content (items, projectiles etc):

  • Override the IsLoadingEnabled hook, and return true/false depending on if ClickerCompat.ClickerClass is null
    • That will make that content not load if Clicker Class is not loaded
    • You can still use the other calls just fine but they won't do anything (i.e. IsClickerWeapon will always return false since Clicker Class isn't loaded)
  • Add the following line to your build.txt:
sortAfter = ClickerClass

This will ensure your mod loads after it, making your logic always follow after Clicker Class and preventing potential value mismatches.

Troubleshooting

If you come across something that doesn't work correctly:

  1. Check that you are using it the same way the examples do.
  2. Make sure Clicker Class is actually enabled.
  3. Ensure there are no exceptions in the logs. You find them in the logs folder. Look for client.log. (NOT the .zip file, the file named client or client.log)

[1.3]

Windows Logs: %UserProfile%\Documents\My Games\Terraria\ModLoader\Logs (This is typically found in C:\Documents)
Linux Logs: ~/.local/share/Terraria/ModLoader/Logs/ or $XDG_DATA_HOME/Terraria/ModLoader/Logs/
Mac Logs: ~/Library/Application support/Terraria/ModLoader/Logs/

[1.4]

For startup issues: Install Directory/tModLoader-Logs/Launch.log
For client issues: Install Directory/tModLoader-Logs/client.log
For server issues: Install Directory/tModLoader-Logs/server.log

NOTE
To get to your install directory on Steam - right click tModLoader in the library, then hover over Manage and click on Browse local files!

  1. If you still have issues, or questions, visit our Discord server (Clicker Class channels are part of the Thorium Mod server)!

That's it, happy modding!