Creating a clean slate

The absolute beginnings
First, install the Homeworld Remastered Toolkit (in the Tools section on Steam). Next navigate to where your Homeworld is installed, in my case its "C:\Program Files (x86)\Steam\steamapps\common\Homeworld". Make a new folder called whatever you want, in my case I am calling it modtesting (or whatever you want). It should look like the image to the right hand side. Then in this folder create another folder called "debug". In this debug folder make an empty text file, called keeper.txt. Then create 2 folders, one called "ai" and another called "scripts".

The ai folder:
This one is nice and easy. Inside the "ai" folder make another folder called "default" and then make a file called "default.lua". In this fine add the following line function oninit end

The scripts folder
The scripts folder is going to contain 3 folders called "races", "rules" and "startingfleets".

Races
First, make a folder called "races". This is where you would tradationally put your races (ie Vaygr). Craete a file called "debug.lua". This would usually be called the name of the race you are making, however in this case we are naming our empty race 'debug'.

Inside this file have the following code Path_Name = "DEBUG" Symbolic_Name = "DEBUG" Display_Name = "DEBUG" Prefix = "DBG_"

ExtFilter = "flag_debug" Tags = "race_debug" Most properties here are self explanatory but the ExtFilter, clarified further down is for the game to identify if this file is necessary to load or not, and the Tags is to identify in the game rules if the race is allowed to be played in this scenario.

Then create another folder and call that "debug". This is for the same reason we named the file above debug. Then make a new folder called "props", and then a new file called "default.lua". Insert the following code. -- DEBUG

Number_Properties_Priority = 1.0

Number_Properties = {

cfg_race_is_playable = 1.0, cfg_race_index_sort = 1.0, cfg_race_select_weight = 1.0, cfg_race_is_random = 0.0,

}

String_Properties_Priority = 1.0 String_Properties = {} Whilst you don't need to populate the properties, for the sake of the purpose of what this guide could be used for I have with the bare-minimum.

Rules
Now go back to \scripts and make a folder called "rules". Inside rules make a file called "debug.lua". The file should look like below --GUID = {} Doesn't seem necessary?

GameRulesName = "DEBUG" Description = "" SaveGameVersion = 1.0 SinglePlayer = 0

ExtFilter = "flag_debug"

Race_Paths = ""

Level_Pass_Tags = "" Race_Pass_Tags = "race_debug"

GameSetupOptions = {}

dofilepath("data:scripts/rules/debug/debug.lua") The game rules name is the name of the gamemode, which you'll see in on the right hand side. You can give it a description of what you want. Setting SinglePlayer to 1 means, quite obviously, you can't play it against CPU. ExtFilter is what's used to identify if the file should be loaded, I will revisit this later. Race_Pass_Tags are the races which you want to allow to play your gamemode. In our case, we on'y want our empty debug race to load.

Next, create a folder called "debug", and inside that folder make a file called "debug.lua". In this file add the following function function OnInit end

Starting Fleets
Finally, go back to \scripts\ and make a folder called "startingfleets". Inside this create a file called "debug00.lua". In this file paste in the following code. PersistantData = { StrikeGroups = {}, Squadrons =	{}, Research = {}, }

Config filters
Go back \scripts\ and create a file called "configfilters.lua". In this file add the following line: PassFilter="flag_debug,levels_dm_hw2" Having PassFilter means only files with these flags (in a variable called ExtFilter) will load. In this case its our debug game rule, and the default homeworld 2 maps (as otherwise there would be no maps!).

To get it running
Navigate to your homeworld remastered directory, in my case its "C:\Program Files (x86)\Steam\steamapps\common\Homeworld\HomeworldRM\Bin\Release". Right click on HomeworldRM.exe and click on Create Shortcut. Name it what you want, and then right click on it and go to Properties. In the target add the following C:\Program Files (x86)\Steam\steamapps\common\Homeworld\HomeworldRM\Bin\Release\HomeworldRM.exe" -moddatapath modtesting\debug -luatrace

The end
Whats the point of this? Well I can only think of 3 reasons. a) You're starting a mod from fresh and are unsure where to start b) You want to learn about the basics of homeworld modding and get a jist for the folder structure c) You want to test code/run a function with no possibility of conflict in a clutter free environment. For example if you put a for loop over globals in the OnInit function located at rules\debug\debug.lua it will display all the globals available. In total it comes to 1291 if you're interested of which 72 (roughly) are lua4 globals.

This folder and file structure should look like the image to the right.