Testing - mariusz-tang/KTaNE-Module-Template GitHub Wiki
The modkit provides access to the Test Harness, which is a tool you can use to test your module in the Unity editor. This is useful for testing changes quickly, without the need to constantly build the module and load up the game. However, you should always test your modules in-game before release.
Using the Test Harness
First, make sure you have the TestHarness
object in your scene. If not, you can get it by going to Assets > TestHarness > TestHarness
.
There are some options you can set in the Test Harness from the inspector. The most notable of these are:
StrikeCount
TimeLimit
BombSize
, which determines the minimum width and height, in modules, of the bombEdgeworkConfiguration
—to set a custom edgework configuration, go toKeep Talking ModKit > Create Edgework Configuration
TwitchPlaysActive
TwitchPlaysMode
Additionally, if you are using the game's audio system to play sound, add any audio clips to the AudioClips
field of the Test Harness.
Then, simply press play to start testing!
IMPORTANT: Test Harness vs In-game testing
There are some key differences to be aware of between testing in the Test Harness and testing in-game:
- the module will not be selectable in Test Harness if there are no child
KMSelectable
s, while this is not the case in-game - selectable colliders will only work from specific angles in the Test Harness, but they will work from any angle in-game
- lighting and shaders (especially ones that support transparency) tend to behave differently in Test Harness than in-game
- global positions may be different in-game. Use local positions instead
In-game testing
Testing in-game is best, as this is the version of the mod that everyone will see and play when it is released.
To get started, first make sure to set your module prefab's AssetBundle
to mod.bundle
. Do the same with any other relevant files that are not already linked to your prefab in some way—usually, this will only be audio files which are played through the game's audio system.
Next, you need to configure your mod by going to Keep Talking ModKit > Configure Mod
; none of these fields really matter for testing, except for the OutputFolder
, which is where the module binaries will be after the module is built—the default is build
.
Now, build the module by going to Keep Talking ModKit > Build AssetBundle
(or by pressing F7
on your keyboard).
Once the module is built, you will need to move it to your mods folder: open your game folder (the default path is C:\Program Files (x86)\Steam\steamapps\common\Keep Talking and Nobody Explodes
), and open the mods
folder (if there is no such folder, create it and then open it). Then, drag the folder, which should now be in the OutputFolder
from before, into your mods folder.
Finally, boot up the game. If you would like to load the game with only your module (and any other mods you have installed locally), open the ktane.exe
executable in your game folder.
Important: to view any exceptions thrown in-game, check the output log
The default paths are:
- on Windows,
%AppData%\..\LocalLow\Steel Crate Games\Keep Talking and Nobody Explodes\output_log.txt
- on Mac,
~/Library/Logs/Unity/Player.log
- on Linux,
~/.config/unity3d/Steel Crate Games/Keep Talking and Nobody Explodes/Player.log