Skip to main content

Hot Reloading

How to use Atlan Mod Loader and Kaibz Mod to reload modded entities files without restarting the game.

This is an experimental feature. It may or may not be broken on Linux. If you attempt this procedure, please report whether it's successful or not.

The biggest problem with editing level mods is iteration time. Each time you want to test new changes, you must re-install the mod and restart the game. It's a time-consuming process that grinds down development. But with the power of Kaibz Mod and Atlan Mod Loader, this convenience can be eliminated!

Install Kaibz Mod

You must install Kaibz Mod to perform hot reloading! It is recommended you enable it's Mod Interface while developing level mods. See Connecting EntitySlayer to Kaibz Mod to learn how to enable the mod interface. 

Before Launching the Game

Atlan Mod Loader will engage "Hot Reload Mode" under the following conditions:

  1. An unzipped and unpackaged .mapentities file exists in your mods folder.
  2. No other mod files exist in your mods folder.

Let's say you want to edit the mission Hebeth. Your mods folder should look like this. Do not add any files besides the mapentities.

hotreloadmodsfolder_2.PNG

Once this is setup, run Atlan Mod Loader and launch the game.

Reloading the File

Let's say you've made some changes to the Hebeth mapentities file and you're ready to reload it. Run the console command k_hotReload to reload the map!

Notes:

  1. This may alt-tab you out of the game for several seconds. The alt-tabbing is most severe when running the game in Full Screen mode. If it gets annoying, try changing to Borderless Windowed mode.
  2. You may notice a command prompt briefly pop up and close. This is Atlan Mod Loader running due to Kaibz Mod.

Quick Test

The first time you attempt hot reloading, you should do something simple to verify it works on your system. The following code snippet will place a floating text entity at the start of Hebeth. 

  1. Paste this into Hebeth's mapentities file. Make sure you paste it somewhere AFTER submap 0's world entity.
  2. Edit the entity's edit/headerText/text  property.
  3. Trigger a hot reloading using the above procedure.
  4. Verify that the text you see in-game has changed to reflect your edits.
entity 0 {
	entityDef hot_reload_test {
		inherit = "entityDef/gui/text";
		expandInheritance = false;
		editorVars = {
			placeable = false;
		}
		systemVars = {
			entityType = "idGuiEntity_Text";
		}
		edit = {
			headerText = {
				text = "Hot Reload Test!";
			}
			canvasFile = "ui/shapes/worldgui_text";
			useSWFTransform = true;
			swfScale = 0.016667;
			spawnPosition = {
				x = -1245.702881;
				y = -1230.202271;
				z = -77.942009;
			}
			spawnOrientation = {
				mat = {
					mat[0] = {
						x = -0.000000;
						y = -1.000000;
					}
					mat[1] = {
						x = 1.000000;
						y = -0.000000;
					}
				}
			}
			flags = {
				noknockback = false;
			}
			renderModelInfo = {
				model = "editors/models/gui_text.lwo";
				scale = {
					y = 15.000000;
				}
			}
			clipModelInfo = {
				type = "CLIPMODEL_NONE";
			}
		}
	}
}

Reloading the File (Without Kaibz Mod)

Hot Reloading without Kaibz Mod is NOT RECOMMENDED! This section is here purely for documentation purposes! Please use the above method instead of this one!

To Hot Reload without using Kaibz Mod, perform the following steps:

  1. Alt-Tab out of the game.
  2. Run Atlan Mod Loader and wait for it to complete
  3. Quit out to main menu, then load back into Hebeth using Mission Select.
  4. The changes you've made to the file should be reflected in-game.