KeeperRL

KeeperRL

Not enough ratings
A32 Modding (WIP)
By Greenie /Taxibutler
A guide for modding in the newest version of KeeperRL, talking about the many differences and general modding tips. WIP Updating to A32, shouldn't be too long
   
Award
Favorite
Favorited
Unfavorite
Player Creatures (Adventurers and Keepers)
Alright, new version new guide. This section refers to adventurer_creatures.txt and keeper_creatures.txt.

For this section, I will talk about adding in your own adventurers and keepers using ingame tiles (if you want custom go to the creatures/furniture section once it's done)

Adventurers

Modding in extra adventurers is pretty simple, you just give it a name in the code to load, a creatureID (aka the creature and its stats), its alignment, and a description. Here's what that would look like:
"1_lawful_adventurer" {{ "ADVENTURER" "ADVENTURER_F" } LAWFUL "Roam the land in search of adventures and loot!" }
The part where it says "1_lawful_adventurer" basically is the name of the entry in the menu. To put it simply, it basically puts it in alphabetical order, so if you put a 1 in front like this one does it would go in front of one with a 2. Other than that, there isn't a particular reason to name it something other than making sure it doesn't conflict with other mods (so don't use something like "1_adventurer" or something simple, use something like "1_mymodname_adventurer").

The parts in quotes under that, aka the "ADVENTURER" "ADVENTURER_F", are the creatureIDs. The reason there are 2 is so that you can switch between male and female. That is what the actual unit you control (and in the menu while choosing) will look like, and have the stats of. You can make your own in creatures.txt (different section) or choose one from the base game.

The part where it says "LAWFUL" basically gives it a list of enemies to fight. You can make the adventurer EVIL or LAWFUL, so the LAWFUL character would have Dwarves as allies while the EVIL character would have something like Harpies as allies, etc.
The last part in quotes is a description, make it as long as you want with whatever you want in there.

This section is entirely done in adventurer_creatures.txt

Keepers

Modding in keepers is generally pretty easy too, you just have to know the layout. I will show an example here and explain each part in detail:
"1_dark_mage" { creatureId = { "KEEPER_MAGE" "KEEPER_MAGE_F" } tribeAlignment = EVIL immigrantGroups = {"imps" "dark_keeper"} technology = { "alchemy" "advanced alchemy" "alchemical conversion" "humanoid mutation" "beast mutation" "pig breeding" "iron working" "jewellery" "two-handed weapons" "traps" "archery" "sorcery" "advanced sorcery" "magical weapons" "master sorcery" "demonology" "distillation" } zLevelGroups = { "basic" "evil" } initialTech = { "sorcery" } buildingGroups = { "structure" "doors" "floors" "storage" "zones" "library" "throne" "beds" "beast_cage" "pigsty" "coffins" "training" "crafting" "laboratory" "jeweller" "poetry" "distillery" "demon_shrine" "prison" "orders" "installations" "minion_statues" "magical_installations" "traps" } workshopGroups = { "basic" "traps" } description = "Build and manage your dream dungeon, defend against raids, and attack your enemies. Be about as evil as a boogieman can be!" specialTraits = { LastingEffect SPEED ExtraTraining MELEE 5 } }
This is the default keeper of the game, the posterboy. Similar to the adventurer creatures, this one has a name in the code which chooses where it pops up in the order, two creatureIDs for male/female and stats, and a tribeAlignment of either LAWFUL or EVIL, as explained earlier.

The immigrant groups determine what units the keeper can recruit. For example, the reason this keeper can get imps is because it has the "imps" immigrant group. The "dark_keeper" group just has the default units like "ORC_SHAMAN" and "GOBLIN_WARRIOR", etc. If you want to add your own immigrant groups that will be in the immigration section.

As one might guess, the technology section determines what the keeper can research. It isn't too hard to add your own, but I think theres another section for that planned, so I will explain it there (if there isn't I will add this later). You basically add the name of the research to this section and it allows it to be researched. You can't change the requirements here, but if you do not have the pre-requisites available to be researched, then you will get an error (aka you can't have master sorcery research if you don't have advanced sorcery due to tech requirements). InitialTech is self explanatory, and can have more than one at a time.

The way zLevelGroups works is similar to immigrant groups, in the way that they have their own levels defined in a different file (zlevels.txt) and added to the keeper to spawn. You can make your own, but that will be in a different section.

buildingGroups is a bit more different in the way it's made, but for the purposes of adding it to a keeper it's pretty much the same as immigration or zLevelGroups. This is also the case for workshopGroups.

Description allows you to make a description, have fun with it.

This last section on specialTraits is stepping into creatures/immigration territory, but basically you can give the keeper a bonus when compared to other creatures of the same type. For example, a vampire might have 7 in spell training at max, but you can add "ExtraTraining SPELL 5" as a specialTraits and it will now be level 12 at max. You can also add effects like levitation or speed. Here's a list of effects you can use:
X(IncreaseAttr, 8)\ X(SpecialAttr, 9)\ X(Lasting, 18)\ X(RemoveLasting, 19)\ X(Permanent, 20)\ X(RemovePermanent, 21)\ X(LoseBodyPart, 25)\ X(AddBodyPart, 27)\ X(MakeHumanoid, 49)\ X(GrantAbility, 50)\ X(RemoveAbility, 51)\ X(Description, 61)\ X(Name, 62)\ X(IncreaseSkill, 64)\ X(IncreaseWorkshopSkill, 65)\ X(SetFlag, 85)\ X(Bleed, 90)\
I'm being a bit lazy here so I left in the number and the X from the source, but these are the different effects you can use. I tried to remove all of the ones that don't work for creatures, but one or two might have been left out or left in. For the different types of LastingEffects (such as flying, bleeding, slowed, etc), go look at the List section under the Spells section.


This section is mostly based in keeper_creatures.txt with references to build_menu.txt, creatures.txt, tiles.txt, technology.txt, zlevels.txt, workshops_menu.txt, immigration.txt, and endless_enemies.txt
Some Extras
I didn't get to go over everything previously, so here's a few other things that you can do. You can add custom endless groups using this: endlessEnemyGroups = { "basic" "yourshere" }

You can also use some of the gnomes' things like these:
minionTraits = { LEADER WORKER NO_LIMIT } maxPopulation = 0 populationString = "automatons" noLeader = true prisoners = false
These are pretty self-explanatory. Minion traits gives your minions those traits (only the ones through immigration), maxPopulation determines max population at the beginning (statues can increase that, and a throne), populationString determines what they are called at the bottom of your UI, noLeader means that you don't have to worry about X guy dying and you immediately losing, but you should use it with the LEADER trait for minions or else it might cause problems (not sure), and the last one just means you can't use prisoners.
WIP Immigration
WIP Tiles (Character/Furniture Art)
WIP Creatures/Names
WIP Z-Levels/Enemies/Endless
Campaign Modding
So, you want to mod in another villain, right? Well, let's talk about that.

As a reference, you should already have two things ready. You should have an Enemy (in enemies.txt) and the campaign_villains.txt open, and ready. The creation of an Enemy will be talked about later, but for now let's use the KNIGHTS as our enemy.

There are 4 different places you can add a villain, either in Evil keepers, Lawful keepers, Evil adventurers, or Lawful adventurers. They all work about the same except that in vanilla the adventurers are stuck with a very small amount of villains and there aren't many adventures to begin with. This falls into the realm of adventurer_creatures.txt.

In there, you can make a new adventurer like the following:
"4_elf_assassin" { "ELF_ASSASSIN" } LAWFUL "Protect nature, and defeat the corruption!"

The part in quotes is the reference name for the adventurer, it is not used anywhere else and is really just there for alphabetical reasons (different orders depending on the numbers/letters). The first part in brackets is the creatureId for the adventurer. For example, if it was switched to { "VAMPIRE" }, then you would be playing as a vampire. You can change the LAWFUL to EVIL to switch which one it pulls from for the villains.

Simple right? Now, as to how to add a new villain to the main map, it is as simple as the template here:
{{ "viewID of what shows on the map" (optional ->) RGB # # # # or ColorId *COLOR* } "EnemyId" "Name of the villain on the main map" MAIN, LESSER or ALLY }
As you can see, you put the ViewId of what the villain looks like on the map, example:
{"unknown_monster" ColorId RED }
this would put a red question mark. Next, you pick an enemyId to spawn as the actual enemies when you spawn on the map. That won't be talked about in this section, but as an example you could just put this:
{ "unknown_monster" ColorId RED } "ELEMENTALIST"
and this would put a red question mark that spawns the elementalist villain. Next is the name. You can name it whatever you so desire, including "Unknown" etc, and that will be what is says on the main map. (Example: The Super Dungeon (Main Villain))

The last part is pretty self explanatory, MAIN means it is a main villain that must be defeated to retire, LESSER means it is a lesser villain (yellow border, not needed for retirement) and ALLY is an ally (green border).

To put your fun filled villain into the default pool of villains, you would use the "modify append" after what you want to add to. Example
LAWFUL_KEEPER modify append { {{ "red_dragon" } "RED_DRAGON" "Red dragon" MAIN} }
Right there, you just added another red dragon into the villain pool for the lawful keeper. For an evil keeper, you just change LAWFUL to EVIL, and for adventurers you change the KEEPER to ADVENTURER.
WIP Workshops/Items
Spells/Spell Schools (With Examples)
First things first, this section will be about adding spells and spell schools. This has a correlation to creatures.txt (since it's similar for effects). The two txt files this section is about are: spells.txt and spell_schools.txt.

Spells

It is pretty simple to add spells. There are a few different fields you can add to a spell, and not all are needed. Here's what that would look like:
"name of spell in code" { upgrade = "name of spell upgraded from" *optional, stuff like advanced healing symbol = "your symbol here (can be text, I usually use emojis or other symbols)" effect = the effects of the spell (usually at least has Name "name of spell") fx = {FXID ColorId XXX} *ColorId is optional, so is FX itself, will be a list below range = XX *optional (0 = self-cast) targetSelf = true *optional, only needed if has a range and wants to use on self cooldown = XXX *optional endOnly = true *optional, only needed if changed to true sound = SOUND_ID *optional, will be a list below message = "XXXX" "XXXX" *optional, first one is something like "minion learns spell of XXX" and second is "minion XXXXs" (ex: minion learns spell of teleport, minion teleports) }
Most of it is pretty self-explanatory, but I will explain a few of the parts that have multiple different things to them. I will add a list of the FXs and sounds in a separate section to save space, so don't about that right now. As for effects, here is the list of every effect:
X(Escape, 0)\ X(Teleport, 1)\ X(Heal, 2)\ X(Fire, 3)\ X(Ice, 4)\ X(DestroyEquipment, 5)\ X(Enhance, 6)\ X(Suicide, 7)\ X(IncreaseAttr, 8)\ X(SpecialAttr, 9)\ X(CircularBlast, 10)\ X(Deception, 11)\ X(Summon, 12)\ X(SummonElement, 13)\ X(Acid, 14)\ X(Alarm, 15)\ X(Stairs, 16)\ X(DoubleTrouble, 17)\ X(Lasting, 18)\ X(RemoveLasting, 19)\ X(Permanent, 20)\ X(RemovePermanent, 21)\ X(PlaceFurniture, 22)\ X(Damage, 23)\ X(InjureBodyPart, 24)\ X(LoseBodyPart, 25)\ X(RegrowBodyPart, 26)\ X(AddBodyPart, 27)\ X(DestroyWalls, 28)\ X(Area, 29)\ X(CustomArea, 30)\ X(ReviveCorpse, 31)\ X(Blast, 32)\ X(DirectedBlast, 33)\ X(Pull, 34)\ X(Shove, 35)\ X(SwapPosition, 36)\ X(SummonEnemy, 37)\ X(Audience, 38)\ X(Wish, 39)\ X(Chain, 40)\ X(ChainUntilFail, 41)\ X(ChooseRandom, 42)\ X(IncreaseMorale, 43)\ X(Message, 44)\ X(UnseenMessage, 45)\ X(AssembledMinion, 46)\ X(TriggerTrap, 47)\ X(AnimateItems, 48)\ X(MakeHumanoid, 49)\ X(GrantAbility, 50)\ X(RemoveAbility, 51)\ X(CreatureMessage, 52)\ X(SoundEffect, 53)\ X(DropItems, 54)\ X(FirstSuccessful, 55)\ X(PlayerMessage, 56)\ X(ColorVariant, 57)\ X(Jump, 58)\ X(FixedDamage, 59)\ X(Fx, 60)\ X(Description, 61)\ X(Name, 62)\ X(AI, 63)\ X(IncreaseSkill, 64)\ X(IncreaseWorkshopSkill, 65)\ X(AddAutomatonParts, 66)\ X(AddMinionTrait, 67)\ X(RemoveMinionTrait, 68)\ X(SetMinionActivity, 69)\ X(CollectiveMessage, 70)\ X(TakeItems, 71)\ X(Unlock, 72)\ X(Analytics, 73)\ X(ReturnFalse, 74)\ X(Polymorph, 75)\ X(SetCreatureName, 76)\ X(SetViewId, 77)\ X(UI, 78)\ X(AddCompanion, 79)\ X(SetPhylactery, 80)\ X(EmitPoisonGas, 81)\ X(AddTechnology, 82)\ X(Caster, 83)\ X(RemoveFurniture, 84)\ X(SetFlag, 85)\ X(EquipmentType, 86)\ X(NoAutoAssign, 87)\ X(Filter, 88)\ X(Chance, 89)\ X(Bleed, 90)\ X(Price, 91)
I talked about this a bit near the beginning, but these are all the effects you can use for spells. Most of them aren't used, but a few of them can be used quite a bit, like Filter and Area. Do keep in mind this doesn't include effects like POISONED or HALLU (hallucinations), as that will be in a different list (steam doesn't like all the characters in one section).

I will now give an example to show you what you can do. Keep in mind, there are more effects than what I use since I'm not a code demon like GD or Kappa (I call them that in a good way).
"diff slowing vines" { symbol = "🌱" effect = Name "slowing vines" Chain { Area 4 Filter Enemy Lasting SLOWED Area 4 Filter Enemy Lasting ENTANGLED } range = 6 cooldown = 60 sound = SPELL_SPEED_SELF }
Personally, this is one of my favorite spells.

Anyway, let's go over the different parts. The first line is the name in the code, and is named like that (with "diff" added) so that it will almost certainly not conflict with other mods. Next, you can see the symbol I used, which is an emoji I found online. There is probably a way to make your own but I am not savvy enough for that. The next line, starting with "effect", is the line where all of the "magic" happens (ha).

The first thing to notice is the "Name" part, which is what the player would see if they hovered over the spell on the side, or in a minion's spell list. Next is a chain of effects which uses the "Area" and "Filter" code to further specify the spell. While I could've used "Area 4 Filter Enemy Chain {Lasting SLOWED Lasting ENTANGLED)", I just forgot about it, so that isn't something you have to do if you want to chain effects like this. You will always, though, need "Chain" if you want multiple effects to happen at a time. The different parts are pretty self-explanatory, but here is what it would look like as a layout:
effect = Name "something" Area XX Filter ENEMY/ALLY Chain { Area XX Filter ENEMY/ALLY EFFECT Area XX Filter ENEMY/ALLY EFFECT }
Keep in mind that a chain is NOT needed if you just want one effect, even if it has an area or a filter. There are also more filters than what I show it's just that they are the most common. (ex: Filter LastingEffect FLYING)

Then you have range and cooldown, which are pretty obvious, and sound. I just picked a random sound, personally, but there are better ones for whatever you want to do. It is worth noting that while sounds aren't required, if they do something that isn't quite obvious then your player might think the spell doesn't work, so I'd suggest putting an FX or sound on it even if it doesn't work out perfectly.

Spell Schools

This is REALLY easy, don't sweat it. Here's what to do:
"name of school" MELEE/SPELL/ARCHERY { "spell name" XX *level where they learn it "spell name" XX }
The name of the school is A: what shows in a minion's info and B: something that should be named uniquely so it doesn't conflict with other mods. The part where it says MELEE, etc, just determines what type of training will give said spells. A SPELL type school will need you to level up to XX if you want the spell with XX next to it. Here's an example from the code:
"spiritualist" SPELL { "heal spirit" 1 "advanced heal spirit" 4 "heal spirit group" 7 }
It requires SPELL training, and at level 1 they learn "heal spirit", etc. That is pretty much it.
FX, Sounds, and LastingEffects Lists.
Here are the different FXs you can use:
TEST_SIMPLE, TEST_MULTI, WOOD_SPLINTERS, ROCK_SPLINTERS, ROCK_CLOUD, POISON_CLOUD, DESTROY_FURNITURE, RIPPLE, SAND_DUST, WATER_SPLASH, MAGMA_FIRE, FIRE, FIRE_SPHERE, CIRCULAR_SPELL, CIRCULAR_BLAST, AIR_BLAST, MAGIC_MISSILE_OLD, MAGIC_MISSILE, MAGIC_MISSILE_SPLASH, FIREBALL, FIREBALL_SPLASH, FLAMETHROWER, SLEEP, LOVE, LOVE_LOOPED, BLIND, GLITTERING, MAGIC_FIELD, LABORATORY, FORGE, WORKSHOP, JEWELLER, EMBALMENT, FLYING, BUFF, DEBUFF, TELEPORT_OUT, TELEPORT_IN, SPAWN, ENGINE_STEAM, LICH
Here are the different types of Sounds you can use:
BEAST_DEATH, HUMANOID_DEATH, BLUNT_DAMAGE, BLADE_DAMAGE, BLUNT_NO_DAMAGE, BLADE_NO_DAMAGE, MISSED_ATTACK, DIG_MARK, DIG_UNMARK, ADD_CONSTRUCTION, REMOVE_CONSTRUCTION, DIGGING, CONSTRUCTING, TREE_CUTTING, TRAP_ARMING, BANG_DOOR, SHOOT_BOW, WHIP, CREATE_IMP, DYING_PIG, DYING_DONKEY, SPELL_HEALING, SPELL_SUMMON_INSECTS, SPELL_DECEPTION, SPELL_SPEED_SELF, SPELL_STR_BONUS, SPELL_DEX_BONUS, SPELL_FIRE_SPHERE_PET, SPELL_TELEPORT, SPELL_INVISIBILITY, SPELL_WORD_OF_POWER, SPELL_AIR_BLAST, SPELL_SUMMON_SPIRIT, SPELL_PORTAL, SPELL_CURE_POISON, SPELL_METEOR_SHOWER, SPELL_MAGIC_SHIELD, SPELL_BLAST, SPELL_STUN_RAY
Here are the different LastingEffects you can use (stuff like flying or bleeding, etc)
SLEEP, PANIC, RAGE, SLOWED, SPEED, DAM_BONUS, DEF_BONUS, BLEEDING, HALLU, BLIND, INVISIBLE, POISON, ENTANGLED, TIED_UP, IMMOBILE, STUNNED, POISON_RESISTANT, FIRE_RESISTANT, COLD_RESISTANT, ACID_RESISTANT, FLYING, COLLAPSED, INSANITY, PEACEFULNESS, LIGHT_SOURCE, DARKNESS_SOURCE, PREGNANT, PLAGUE, PLAGUE_RESISTANT, SLEEP_RESISTANT, MAGIC_RESISTANCE, MELEE_RESISTANCE, RANGED_RESISTANCE, MAGIC_VULNERABILITY, MELEE_VULNERABILITY, RANGED_VULNERABILITY, MAGIC_CANCELLATION, SPELL_DAMAGE, ELF_VISION, ARCHER_VISION, NIGHT_VISION, REGENERATION, WARNING, TELEPATHY, SUNLIGHT_VULNERABLE, SATIATED, RESTED, SUMMONED, HATE_DWARVES, HATE_UNDEAD, HATE_HUMANS, HATE_GREENSKINS, HATE_ELVES, HATE_DRAGONS, FAST_CRAFTING, FAST_TRAINING, SLOW_CRAFTING, SLOW_TRAINING, ENTERTAINER, BAD_BREATH, ON_FIRE, FROZEN, AMBUSH_SKILL, SWIMMING_SKILL, DISARM_TRAPS_SKILL, CONSUMPTION_SKILL, COPULATION_SKILL, CROPS_SKILL, SPIDER_SKILL, EXPLORE_SKILL, EXPLORE_NOCTURNAL_SKILL, EXPLORE_CAVES_SKILL, BRIDGE_BUILDING_SKILL, DISTILLATION_SKILL, NAVIGATION_DIGGING_SKILL, DISAPPEAR_DURING_DAY, NO_CARRY_LIMIT, SPYING, LIFE_SAVED, UNSTABLE, OIL, SWARMER, PSYCHIATRY, INVULNERABLE, TURNED_OFF, DRUNK, NO_FRIENDLY_FIRE, POLYMORPHED
Some of those (like SUMMONED or POLYMORPHED) don't get used often in actual modding, but have some special cases.
Making Map Layouts
To start off, there is a newer way to make map layouts, but it hasn't been explained too well. Currently, you have 3 ways to make a layout for an enemy: Predefined, Builtin, and RandomLayout. I will mostly talk about doing Predefined, as I'm not up to date with RandomLayout, but I will start with Builtin.

Builtin Layouts

Builtin layouts are basically just the layouts that are in the game's code. They're the things like the Dwarven caves and Elf villages, etc. For example,
"UNICORN_HERD" { settlement = { type = Builtin FOREST "WOOD" <------- inhabitants = { leader = {{"UNICORN_LEADER"}} fighters = { count = {5 8} all = { 1 "UNICORN" } } } tribe = MONSTER race = "unicorns" } config = { immigrantInterval = 200 maxPopulation = 9 } immigrants = { { ids = {"UNICORN"} traits = {FIGHTER} frequency = 1 } } }
I'll explain some of this in another section, but the part we are looking at is almost the first thing on this code snippet. The way Builtin works is that you give it a layout from the code
VILLAGE, SMALL_VILLAGE, FORREST_VILLAGE, FOREST, EMPTY, CASTLE, CASTLE2, COTTAGE, FORREST_COTTAGE, TOWER, TEMPLE, MINETOWN, ANT_NEST, SMALL_MINETOWN, VAULT, CAVE, SPIDER_CAVE, ISLAND_VAULT, ISLAND_VAULT_DOOR, CEMETERY, SWAMP, MOUNTAIN_LAKE
(from the source code) and then you give it the materials it uses. So in this case, it uses the ID of FOREST with the "WOOD" as the material. A better example of materials would be the Ant Nest (enclosed) which uses this as its layout:
type = Builtin ANT_NEST "DUNGEON"
The ANT_NEST is the layout, and the "DUNGEON" is the rock walls.

Predefined Layouts

For this next section, I will talk about Predefined, aka the ones that YOU can add to your mod.
This right here is the colorcode you use by default for maps. To start making a map, you need an editor such as paint.net, photoshop, or whatever you want to use. The map image can be any size, realistically, but you should probably keep it below 35x35 pixels, since the biggest I've used is 32x32 and I'm not sure if there is a limit. To start, you put any colors you may use in the bottom left corner of the picture, then you start coloring. Here's an example from the game's code:
This picture was enlarged a bit since steam doesn't like the small picture, but as you can see, it's not that difficult to do. If you look in the bottom left corner you can see the colors, and in the rest of the image you can see... the map.
The gray color is always used for empty space, and it allows generation of other things like trees or rocks in that space. If you plan on having this be underground, you will want an UP_STAIRS color area, which is where the player will come down from, and if you want to add extra floors to your enemy, you need a DOWN_STAIRS color area. While I don't believe you can change the colors and what they correspond to, you can change the furniture inside by using these:
furniture = "roomFurniture" outsideFeatures = "villageOutside"
these are snippets that you would put in your enemies code, and you can make your own in furniture_lists.txt. I will quickly explain that real quick:
"roomFurniture" { { "BED1" 2 "GROUND_TORCH" 1 "CHEST" 2 } }
The first thing in quotes is the name in the code, ex: furniture = "roomFurniture", and the three on the inside are the furniture tiles themselves, defined in furniture.txt. The numbers to the side of them are the ratios, so there will be 2 beds for every 1 standing torch, and 2 chests for every 2 beds, etc. This furniture will spawn in the layout in either the "INSIDE FLOOR" or "OUTSIDE FLOOR" depending on if it's defined as: furniture = "list" or outsideFeatures = "list".

Random Layouts

This section will be about my limited knowledge on RandomLayouts. For the most part, there are a few different layouts you can use if I'm reading it correctly. There are:
"village", "village1", "village2", "castle", "castle_empty", "adoxie_feet_entry", "adoxie_feet_under", "castle_up_stairs", "guard_post", "guard_post_floor2", "guard_post_floor3", "blacksmith", "blacksmith_cellar", "cottage_cellar", "adoxie_temple", "dungeon1", "dungeon2", "dungeon3", "dungeon4", "dungeon", "z_level_lava", "z_level_water", "z_level_full", "z_level_castle", "lava_cave", "zombie_crypt", "kraken_z_level"
For the most part, the ones you'd use for most enemies would be "village", "castle" or "dungeon". Interestingly enough, these three (and one or two more in particular) choose between a few of the different layouts. For example, the "village" layout chooses between "village1" and "village2", and "castle" chooses between a few parts that aren't layouts. I believe that the way RandomLayout is done in the code goes something like this
type = RandomLayout { "layoutID" { Radius x Radius } "layout_mapping ID" }
The last part of that is for determining extra stuff for the generator. For the most part, it will be default, but for some things like dragon caves you'd want to use something like "dragon" which would replace normal chests with dragon chests (better loot I believe)

Where This Goes in Your Mod

To make your own layout, you need to make a "map_layouts" folder in your mod, similar to how "orig16" and others work (might not have explained that yet). Inside that folder, you will then put the name of the layout in there, such as "elf_thingy". Inside there, you put the image. Not entirely sure if theres a specific way to name it, so I name it the same thing as the folder if it's the only one, and for multiple different layouts I put a _1 or _2, etc. The place you give these layouts to enemies (such as the unicorns on the first section) is in the "enemies.txt".
WIP (Example) Adding a Creature
WIP (Example) Making a new Villain
Changes to Modding in A30 (Old)
There are many differences that could be very jarring for modders who haven't seen the new version.

Immigration/Creatures
First to note, is that every "LastingEffect effect" has changed to "Lasting { effect }". Second, the inventory of every creature is now included in the creatures text file instead of creature_inventory. Third, every SkillId referring to a workshop (or in general) needs to be changed in one of two ways. In immigration, it is now in its own little thing called WorkshopType "NAME". And for creatures, it now needs to be put in its own quotes
Examples Immigration specialTraits = { { 1.0 { WorkshopType "FORGE" WorkshopType "WORKSHOP" }} { 0.1 { AttrBonus DAMAGE 8 ExtraTraining MELEE 4 }} } Creatures skills = { "DIGGING" 0.9 } skills = { "JEWELER" 0.9 "LABORATORY" 0.6 "WORKSHOP" 0.5 } inventory = { { Simple "Sword"} { Simple "LeatherHelm"} { type = Glyph WEAPON LastingEffect ENTERTAINER chance = 0.05 } }
Other than that, not much changed at all.

Campaigns
There are now two things to keep in mind about campaigns. First, there is a new file called "campaign_info" which allows you to change the following:
size = 34 18 mapZoom = 1 maxMainVillains = 6 maxLesserVillains = 8 maxAllies = 3 influenceSize = 3 Not default btw
The
BIGGEST
thing to note is the need for "modify append" or just "modify". Since your mod isn't the entire game anymore, you need to add that to certain spots in order to change vanilla settings. As an example, the code before (in full)
"default" modify { size = 34 18 mapZoom = 1 maxMainVillains = 6 maxLesserVillains = 8 maxAllies = 3 influenceSize = 3 }
One other such spot is in the campaign_villains file, where adding new enemies requires "modify append" or else it will not work (or just modify).
LAWFUL_KEEPER modify append { {{ "red_dragon" } "RED_DRAGON" "Red dragon" MAIN} {{ "green_dragon" } "GREEN_DRAGON" "Green dragon" MAIN}
Ah yes, it also now requires an extra set of brackets, for unknown reasons to me.

Map Layouts
I'll go into further detail later, but for now, just note that in the enemies file you need to use "Builtin MINETOWN" or other such syntax, since you can now make your own map layouts. To do that in the enemies file, you just put MapLayoutId "layout", and the map layouts go into their own folder called map_layouts, similarly to orig24, orig30, etc.

As a side note, enemies didn't change much, just that and also the fact that shop items now need to look like this
shopItems = { "villageShop" }

Furniture
I haven't really touched furniture, but from what I have seen, there are two new good things. First, you can set your own usage type, like the following
usageType = UsageEffect "pray fervently" Chain { CreatureMessage "pray fervently" "prays fervently" RegrowBodyPart 1 }
The other big one is ticktype and with it, destroyedeffect
tickType = Effect Chance 0.08 SummonEnemy "SKELETON" { 2 4 } 100 destroyedEffect = Chain { Message "THAT WAS A BAD IDEA MORTAL!" Area 4 IncreaseAttr DAMAGE 11 SummonEnemy "VAMPIRE" {6 8} none }
The number at the very end of the summon is how long they last (I think), which should be null for creatures with the summoned permanent effect (so the number doesn't matter, but I haven't tested).

Endless Enemies
No change except for the big one (last one).

Z-Levels
Z-Levels are pretty much the same, except for the fact you need the "modify append". As an example, see below
EVIL modify append { { type = FullZLevel { enemy = "DWARF_CITADEL" attackChance = 0.9 } minDepth = 12 width = 50 } }

Newer Files
There are a few new files that haven't been talked about yet. First, automatons text file. I'll be completely honest, I have absolutely no idea what it does, it just has one line of code
- drones, fly and have one slot
Yep, that's it.
The other new file is the biomes file. You can now make your own biome to live in. There are a few in there currently, like snow and forest, and have the ability to be modded for more.

The Biggest Change
As stated earlier, your mod isn't the whole game anymore. Therefore, your mod can't have a single vanilla thing in it, like tech or creatures. Your mod can still use and inherit everything from vanilla, but it no longer needs to be included with the vanilla things.


Anything not talked about was either forgotten or wasn't changed significantly
4 Comments
DirectOrder 2 Feb, 2021 @ 9:27am 
Thank you very much! Between your response and this guide, I'm up and running. I really appreciate your help :)
Greenie /Taxibutler  [author] 2 Feb, 2021 @ 8:18am 
Any TXTs you want to edit you can copy from the game data, and then you take all the code out of the copies (it will overwrite otherwise, and will probably leave out other mod items) and start putting in your own. Some of the stuff is a bit different on the latest version, but I don't do as much modding these days so I'm not up to speed on the new stuff. This guide is mostly just on A30, not A31+. (2/2)
Greenie /Taxibutler  [author] 2 Feb, 2021 @ 8:18am 
If you want to learn modding a bit easier, then it'd probably be a good idea to go on the discord. There are a lot of modders on there that can help you figure out things. As for tools, as of right now the only thing you need is a text editor (probably something like sublime text or NP++) and maybe a pixel editor (you can use paint net). You can create a mod folder in the mods section in KeeperRL at the very bottom, in which you put the TXT files you are editing. They don't automatically overwrite anything, and they have to be enabled in there, but forgetting an Append somewhere might cause you to accidentally overwrite a section of code that could break the game/leave out something. (1/2)
DirectOrder 2 Feb, 2021 @ 7:34am 
Hi Greenie /Taxibutler! Thanks for this guide - this all looks like amazing info. However, while I'm not new to modding, I am new to modding KeeperRL, and I have no idea where to start. Do you know where I go to learn the absolute basics?

Like, are there modding tools? If so where do I download them? Do I just copy the original text files over to a folder called "/mods" in the install directory and then edit them? And they will automatically load and overwrite the base game files? I don't even know how to begin. This guide seems to cover the stuff I'll need once I get my bearings.

Any help would be greatly appreciated!