Complete Construction Set Tutorial and Important Links [WIP]
Posted: Thu Mar 22, 2012 12:33 am
Hello everyone, after doing some work on the wiki page for the construction set I decided to start making a full step-by-step tutorial for making a modification for Kenshi. I will try to explain everything I know about its use, and try to answer all questions. I will also maintain a list of important modding-related FAQs and other guides, this way we'll have a central starting place for aspiring new modders.
I'll try to cover as much as possible, but I'm just one person, if you think something is missing from the guide, or you would like to add something, feel free to help. It would be especially great if someone were to make a guide to changing models/textures, as that's something I'm not really that good at.
Important Links:
Wiki entry for the Construction Set
Wiki entry for adding new towns
Quick Mod Guide -- by Chris
Tutorial - Adding Ronin Faction(Mod included!)(IMAGE HEAVY) -- by nate9090
Town Creation guide[May not always work] -- by omegamarcel
[TOOL] Kenshi Mod & Save Manager -- by Hellhound1
EDIT:
Dialog system documentation
Skinned character templates (Max 2010)
Tutorial:
During the course of this tutorial, I will walk you through the steps to make a small "Star Wars"-themed mod for Kenshi. This tutorial will handle adding new weapons, armor, characters and factions. It may be added to or extended in scope over time, but these are the subjects that will certainly be included.
1: Creating and opening your mod
First you'll have to create a "blank" .mod file for your mod. To do so go into the construction set and press "new", then you have to enter the name of your mod. Try to use something descriptive and unique, like "StarWars.mod" instead of "myMod.mod" (in the rest of this tutorial, I will refer to the mod as "StarWars.mod").
In order to begin editing your files press "open", make sure to select both gamedata.base and StarWars.mod. If you select only gamedata.base you will directly overwrite the core game files, which means all your changes will be gone next time you run the autoupdater, and you won't be able to share your mod with anyone. Once your mod has loaded you may notice that the window labeled "Game World" has been filled with a list of names and ID-tags, these are called Items. Double-clicking an Item will open an additional window with more details, but more about that later.
Attention: Make sure to press the "save" button before closing the construction set, there is no "Exit without saving?" reminder when you quit, and you may lose all progress.
2: Adding and Removing Items
Before we make the new weapon, I'd like to dedicate one section to the different actions available in the construction set regarding adding and removing items. When you right-click on an item, a menu with three choices will pop up. There are two ways to add a new entry: "New Item", which will create a blank template of an item corresponding to the current category, and "Duplicate Item", which will make an exact copy of the selected item, with a unique ID. Try either of these now, take you time, I'll wait.
Okay, time's up. You'll notice that the new item's name is in red, this marks that the item has been edited and will override the basic gamedata.base settings for that item when the mod is loaded. Now we'll move on to deleting the entry, but be careful not to delete any items you did not make yourself. Simply right-click the item and select "Delete Item", you'll notice nothing has happened. This is a known glitch in the Construction Set, the item has been deleted but the Game World window doesn't refresh, simply select any other category and then go back to the one where you deleted the item. You'll notice it's gone now.
3: Making a Lightsaber
Let's begin our mod in earnest by adding a lightsaber, shall we? We'll start by copying the "Katana-straight" item (located in the category Items->Weapons (mesh)), that way we'll already have all the animations linked to the correct positions and such. Now, open the copied item's details window (double click the item), and scroll all the way up to the field labelled Name, and change its contents to "Lightsaber". Next we'll change the damage modifiers, set blunt damage multiplier to zero, and cut, min cut and pierce damage multipliers to 1,5 (use a komma, not a decimal point!).
This may seem overpowered, but hey, when have lightsabers ever not been overpowered?
Now we'll adjust the price accordingly, scroll down to "value" and change it to 5000, a nice price for such a deadly tool (note, this is not necessarily the buying/selling price, as all merchants have been programmed to completely rip you off). If you scroll down a little more you can also change the description of the item, use your imagination!
4: Return of the Jedi
We've got our lightsaber finished now, but there's no way for us to actually acquire it in the game yet. Therefore we'll now create a new custom character that will wield a lightsaber. Let's make a copy of "Citizen" (under Character), open the copy and rename it to "Jedi". First thing we'll want to do is change his stats, at the right-hand side of the Jedi properties menu you will find a list of entries grouped under different things like "clothing" and "stats", these refer to the items and stat packages used by the Jedi. Right-click the entry under stats labeled "10" and select "remove from list" (the stat package where all stats are 10 is also named "10", so simply renaming it to "20" won't change any stats, you have to add a new stat package if you want custom stats). Now from the drop-down menu next to the "Add" button, select "stats" and press "Add", then double-click "40", this will give our Jedi the all-40 stat package, meaning all his skills are 40, you may want to add some randomization to these stats by changing the value in "stats randomise". Now from the drop-down menu select "weapons", and add the lightsaber we made. Now, simply adding a "lightsaber" entry won't actually add one to the inventory, for that we'll have to change the number next to "Lightsaber" to the amount we want the character to carry, in this case: 1.
There, we've now added a jedi with a lightsaber to the game. If you want you can give him some different clothes, a cloak perhaps. He won't actually spawn yet, but you can manually place him in the game if you enter edit mode while playing and place him in the world, and then you could get the lightsaber by killing him (that'll take quite a bit of skill though). Though this can be quite buggy and I recommend not saving your game after doing so.
Note: in the Item editor, on the right hand side (where a character's inventory is), underneath the dropdown menu, there are three buttons "1", "2" and "3". These are used to switch between displayed values, usually the first is used to determine the amount of a certain item, the second one to indicate a percentage for AI goals (how important is this task?), and the third I have not yet found a use for. I will refer to these values as val1, val2 and val3 respectively. So if I say "change the Wooden sandals val1 to 6", that means I want you to make sure the "1" option is selected, and then change the value next to "Wooden sandals" to 6.
5: On Factions, Divisions, and Spawn-areas
Ok guys, this is gonna be a big one, this chapter is about making your newly created character(s) spawn into the world. This includes creating a new faction, creating a new squad, assigning AI goals, and working with spawn-areas. I'll be splitting this one up into multiple parts, but I'll start by just giving you the general outlines and then we'll treat each step of the process in greater detail.
To have your custom character be part of the world, it will need to be spawned into the world (note: the following process is for "random" spawns, not for, say, shopkeepers). So first you'll have to create your character, then you add this character to a division, then you add this division to a faction and to a spawn-area. It's the divisions (squads) that are spawned, and determine AI goals for the character in it, whilst the faction relations determine how they interact with others. Note: One character can be used in multiple divisions, and I think one division can be used by multiple factions (though there a few ways in which that would make sense).
So remember: Character < Division < Faction
I'll also be assuming that you've read the previous parts of the tutorial and know how the basic parts like copying items and changing Item properties, so I won't be going over every single click/button press, if something's unclear just let me know.
5a: Divisions
We've already made a Jedi, so let's now make them run around by copying the Bandit squad (under Faction->Divisions) and renaming it to "Jedi patrol". Now you will notice on the right, where previously the inventory was listed there is now a list containing "AI Goals", "leader", "Leader AI Goals", etc.
Most of these are self-explanatory, "AI Goals" determine the behavior of the entire squad, so "Protect allies" means the squad will assist any squads in the same faction, and their own squad members (allies). The "leader" tab is for selecting the squad leader, his behavior is controlled by both "AI Goals" and "Leader AI Goals", you could add more than one leader in a squad, but I will come over and slap you if you do. Then there's the "squad" and "Squad AI Goals", these are for the non-leader squad members, usually these will only have the additional goal of "Follow leader", which will cause them to follow their leader where ever he goes.
Since we merely want our Jedi to run around through the desert the Bandit Squad already contains the AI packages we need, so now remove the bandits from the leader and squad tabs (note: currently there is a bug in the Construction set that if one Character is listed mutltiple times in a division, and you remove one mention ALL mentions in that division to that character are removed). Now add a Jedi as leader and as squad member, you can change how many of these will appear in a division by changing the value next to it (val1). Set both the leader Jedi and squad Jedi val1 to 1, if you wish you could also make two different characters, a Jedi Master and Padawan, with different stats, and use these as leader and follower. Basically your squad is now finished. You could add the self preservation goal to their AI list, which theoretically should make them think twice about taking on groups 40x their size, theoretically.
5b: Factions
As you may have noticed, nowhere in the previous segment did we tell the squad to not be like bandits, that's because relations with other instances of the squad is determined by the faction that spawned them. We will now create a Jedi faction, again we will start from a copy of the Dust Bandits faction, renamed to Jedi.
First thing we gotta do is make sure the Jedi don't act like bandits, after all, they're called Jedi not Sith. So go to the "relation" part and set "default relation" to 20, this will make them positive-neutral on all other factions. The other relations are pretty much standard, they will hate you if you attack them, like them if you help them, and attack you if they hate you. Now you'll want to remove the bandit mob and bandit squad from the squads list and replace them by the Jedi patrol. If you wish you can change the faction color as well.
Now to make those Jedi attack bandits and other evil-doers by adding some specific faction relations. Under the "relations" option select the Dust Bandits faction and set it to -50 (val1), other evil factions you might want to include are Raiders, Sand ninjas, Slavers and Starving Bandits.
5c: Spawn areas
At last, we have come to the topic on spawn areas, this one is fairly simple, just select the spawn area(s) you want the Jedi to appear in, and add the Jedi Patrol to the spawn list and set their val1 to 2 or 3. Val1 is the maximum number of squads of that type in the area at once, the spawns min and spawns max indicate the minimum and maximum number of squads spawned in a zone (each area consists of multiple zones), setting this number to a higher amount will increase the number of people runnning around at once (too high might negatively affect performance!). Add these Jedi Patrols to every single spawn area and they can appear anywhere in the world.
You should now be able to encounter your Jedi everywhere in the world, and if you're lucky you might be able to loot a lightsaber from one of them (good luck with that!).
Yours sincerely,
~~ArcaneSaint
I'll try to cover as much as possible, but I'm just one person, if you think something is missing from the guide, or you would like to add something, feel free to help. It would be especially great if someone were to make a guide to changing models/textures, as that's something I'm not really that good at.
Important Links:
Wiki entry for the Construction Set
Wiki entry for adding new towns
Quick Mod Guide -- by Chris
Tutorial - Adding Ronin Faction(Mod included!)(IMAGE HEAVY) -- by nate9090
Town Creation guide[May not always work] -- by omegamarcel
[TOOL] Kenshi Mod & Save Manager -- by Hellhound1
EDIT:
Dialog system documentation
Skinned character templates (Max 2010)
Tutorial:
During the course of this tutorial, I will walk you through the steps to make a small "Star Wars"-themed mod for Kenshi. This tutorial will handle adding new weapons, armor, characters and factions. It may be added to or extended in scope over time, but these are the subjects that will certainly be included.
1: Creating and opening your mod
First you'll have to create a "blank" .mod file for your mod. To do so go into the construction set and press "new", then you have to enter the name of your mod. Try to use something descriptive and unique, like "StarWars.mod" instead of "myMod.mod" (in the rest of this tutorial, I will refer to the mod as "StarWars.mod").
In order to begin editing your files press "open", make sure to select both gamedata.base and StarWars.mod. If you select only gamedata.base you will directly overwrite the core game files, which means all your changes will be gone next time you run the autoupdater, and you won't be able to share your mod with anyone. Once your mod has loaded you may notice that the window labeled "Game World" has been filled with a list of names and ID-tags, these are called Items. Double-clicking an Item will open an additional window with more details, but more about that later.
Attention: Make sure to press the "save" button before closing the construction set, there is no "Exit without saving?" reminder when you quit, and you may lose all progress.
2: Adding and Removing Items
Before we make the new weapon, I'd like to dedicate one section to the different actions available in the construction set regarding adding and removing items. When you right-click on an item, a menu with three choices will pop up. There are two ways to add a new entry: "New Item", which will create a blank template of an item corresponding to the current category, and "Duplicate Item", which will make an exact copy of the selected item, with a unique ID. Try either of these now, take you time, I'll wait.
Okay, time's up. You'll notice that the new item's name is in red, this marks that the item has been edited and will override the basic gamedata.base settings for that item when the mod is loaded. Now we'll move on to deleting the entry, but be careful not to delete any items you did not make yourself. Simply right-click the item and select "Delete Item", you'll notice nothing has happened. This is a known glitch in the Construction Set, the item has been deleted but the Game World window doesn't refresh, simply select any other category and then go back to the one where you deleted the item. You'll notice it's gone now.
3: Making a Lightsaber
Let's begin our mod in earnest by adding a lightsaber, shall we? We'll start by copying the "Katana-straight" item (located in the category Items->Weapons (mesh)), that way we'll already have all the animations linked to the correct positions and such. Now, open the copied item's details window (double click the item), and scroll all the way up to the field labelled Name, and change its contents to "Lightsaber". Next we'll change the damage modifiers, set blunt damage multiplier to zero, and cut, min cut and pierce damage multipliers to 1,5 (use a komma, not a decimal point!).
This may seem overpowered, but hey, when have lightsabers ever not been overpowered?
Now we'll adjust the price accordingly, scroll down to "value" and change it to 5000, a nice price for such a deadly tool (note, this is not necessarily the buying/selling price, as all merchants have been programmed to completely rip you off). If you scroll down a little more you can also change the description of the item, use your imagination!
4: Return of the Jedi
We've got our lightsaber finished now, but there's no way for us to actually acquire it in the game yet. Therefore we'll now create a new custom character that will wield a lightsaber. Let's make a copy of "Citizen" (under Character), open the copy and rename it to "Jedi". First thing we'll want to do is change his stats, at the right-hand side of the Jedi properties menu you will find a list of entries grouped under different things like "clothing" and "stats", these refer to the items and stat packages used by the Jedi. Right-click the entry under stats labeled "10" and select "remove from list" (the stat package where all stats are 10 is also named "10", so simply renaming it to "20" won't change any stats, you have to add a new stat package if you want custom stats). Now from the drop-down menu next to the "Add" button, select "stats" and press "Add", then double-click "40", this will give our Jedi the all-40 stat package, meaning all his skills are 40, you may want to add some randomization to these stats by changing the value in "stats randomise". Now from the drop-down menu select "weapons", and add the lightsaber we made. Now, simply adding a "lightsaber" entry won't actually add one to the inventory, for that we'll have to change the number next to "Lightsaber" to the amount we want the character to carry, in this case: 1.
There, we've now added a jedi with a lightsaber to the game. If you want you can give him some different clothes, a cloak perhaps. He won't actually spawn yet, but you can manually place him in the game if you enter edit mode while playing and place him in the world, and then you could get the lightsaber by killing him (that'll take quite a bit of skill though). Though this can be quite buggy and I recommend not saving your game after doing so.
Note: in the Item editor, on the right hand side (where a character's inventory is), underneath the dropdown menu, there are three buttons "1", "2" and "3". These are used to switch between displayed values, usually the first is used to determine the amount of a certain item, the second one to indicate a percentage for AI goals (how important is this task?), and the third I have not yet found a use for. I will refer to these values as val1, val2 and val3 respectively. So if I say "change the Wooden sandals val1 to 6", that means I want you to make sure the "1" option is selected, and then change the value next to "Wooden sandals" to 6.
5: On Factions, Divisions, and Spawn-areas
Ok guys, this is gonna be a big one, this chapter is about making your newly created character(s) spawn into the world. This includes creating a new faction, creating a new squad, assigning AI goals, and working with spawn-areas. I'll be splitting this one up into multiple parts, but I'll start by just giving you the general outlines and then we'll treat each step of the process in greater detail.
To have your custom character be part of the world, it will need to be spawned into the world (note: the following process is for "random" spawns, not for, say, shopkeepers). So first you'll have to create your character, then you add this character to a division, then you add this division to a faction and to a spawn-area. It's the divisions (squads) that are spawned, and determine AI goals for the character in it, whilst the faction relations determine how they interact with others. Note: One character can be used in multiple divisions, and I think one division can be used by multiple factions (though there a few ways in which that would make sense).
So remember: Character < Division < Faction
I'll also be assuming that you've read the previous parts of the tutorial and know how the basic parts like copying items and changing Item properties, so I won't be going over every single click/button press, if something's unclear just let me know.
5a: Divisions
We've already made a Jedi, so let's now make them run around by copying the Bandit squad (under Faction->Divisions) and renaming it to "Jedi patrol". Now you will notice on the right, where previously the inventory was listed there is now a list containing "AI Goals", "leader", "Leader AI Goals", etc.
Most of these are self-explanatory, "AI Goals" determine the behavior of the entire squad, so "Protect allies" means the squad will assist any squads in the same faction, and their own squad members (allies). The "leader" tab is for selecting the squad leader, his behavior is controlled by both "AI Goals" and "Leader AI Goals", you could add more than one leader in a squad, but I will come over and slap you if you do. Then there's the "squad" and "Squad AI Goals", these are for the non-leader squad members, usually these will only have the additional goal of "Follow leader", which will cause them to follow their leader where ever he goes.
Since we merely want our Jedi to run around through the desert the Bandit Squad already contains the AI packages we need, so now remove the bandits from the leader and squad tabs (note: currently there is a bug in the Construction set that if one Character is listed mutltiple times in a division, and you remove one mention ALL mentions in that division to that character are removed). Now add a Jedi as leader and as squad member, you can change how many of these will appear in a division by changing the value next to it (val1). Set both the leader Jedi and squad Jedi val1 to 1, if you wish you could also make two different characters, a Jedi Master and Padawan, with different stats, and use these as leader and follower. Basically your squad is now finished. You could add the self preservation goal to their AI list, which theoretically should make them think twice about taking on groups 40x their size, theoretically.
5b: Factions
As you may have noticed, nowhere in the previous segment did we tell the squad to not be like bandits, that's because relations with other instances of the squad is determined by the faction that spawned them. We will now create a Jedi faction, again we will start from a copy of the Dust Bandits faction, renamed to Jedi.
First thing we gotta do is make sure the Jedi don't act like bandits, after all, they're called Jedi not Sith. So go to the "relation" part and set "default relation" to 20, this will make them positive-neutral on all other factions. The other relations are pretty much standard, they will hate you if you attack them, like them if you help them, and attack you if they hate you. Now you'll want to remove the bandit mob and bandit squad from the squads list and replace them by the Jedi patrol. If you wish you can change the faction color as well.
Now to make those Jedi attack bandits and other evil-doers by adding some specific faction relations. Under the "relations" option select the Dust Bandits faction and set it to -50 (val1), other evil factions you might want to include are Raiders, Sand ninjas, Slavers and Starving Bandits.
5c: Spawn areas
At last, we have come to the topic on spawn areas, this one is fairly simple, just select the spawn area(s) you want the Jedi to appear in, and add the Jedi Patrol to the spawn list and set their val1 to 2 or 3. Val1 is the maximum number of squads of that type in the area at once, the spawns min and spawns max indicate the minimum and maximum number of squads spawned in a zone (each area consists of multiple zones), setting this number to a higher amount will increase the number of people runnning around at once (too high might negatively affect performance!). Add these Jedi Patrols to every single spawn area and they can appear anywhere in the world.
You should now be able to encounter your Jedi everywhere in the world, and if you're lucky you might be able to loot a lightsaber from one of them (good luck with that!).
Yours sincerely,
~~ArcaneSaint