You must be 18+ to view this content

Ero Dungeons may contain content you must be 18+ to view.

Are you 18 years of age or older?

or Return to itch.io

Modding Guide Part 2: Scripting


If you followed the first part of the modding guide, you now know how to create your own equipment and have it show up in the game. Of course, you also want your equipment to do stuff, and that's where scripts come in. Here I'll give you an overview of all scripts that exist, what they do, and how they work.

Note that, while the previous guide only covered equipment, you can mod pretty much everything which is included in the Data folder of the project. You can add new crests, new classes, new moves, new hypnotic suggestions, and so on. The only exceptions are creating new script commands themselves, since those need to be implemented in the editor.

To get started, know that you can find a list of all scripts in the git of the project, in Excels/Scripts, all of these have a short description of what they do.

Default Scripts

Gear, tokens, crests, quirks... all use the same set of scripts. We'll first cover all these default scripts and then move on to the particulars later. These scripts also have a small syntax, which we'll also cover here.

Scriptablescript

The basic scripts are under Scriptablescript, these just do stuff and don't need any extra help. This goes from the basics, like adding Damage (DMG,PARAM) to changing the wearer's haircolor, to adding or removing moves, to hiding parts of their puppet, and so on. The effects of each of the scripts is explained in the Excel file.

ConditionalScript

Then we move on to the more complex behavior. Starting with Conditionalscript. These are conditions under which the other scripts function. For example, if you write IF:LUST,60, all scripts below that will only work if the girl's lust is above 60. You can also combine this with ELSE:, which means the scripts will only function if the earlier IF wasn't true, and ELIF: which is a combination of ELSE and IF. You can end your IF statements with ENDIF if you want to do some other stuff afterwards, but it isn't needed. For example:

IF:LUST,60
set_haircolor,pink_hair
ELIF:LUST,40
set_haircolor,purple_hair
ELSE
set_haircolor,red_hair
ENDIF
DMG,10

This will turn the girl's hair pink if her lust is above 60. It will turn it purple if the lust is between 60 and 40, and will turn it red otherwise. It will always give her a 10% damage boost. (You can view all haircolors in Excels/Boiler.xlsm under the colors tab.

Counterscript

Use this type of script if you want an effect to trigger for each copy you have of something. These scripts have to start with FOR:, and you can optionally end them with ENDFOR. For example:

FOR:token,block
REC,50

This will mean the girl takes 50% more damage for every block token (or blockplus, or blockminus) that she has.

Temporalscript/Whenscript

This type of script exists for actions that happen at specific moments in time. For example, receiving tokens at the start of your turn. To do this, you combine the temporalscript with whenscripts. You write WHEN:<temporalscript> and then follow up with whenscripts (since the actions that can be done in such moments are very specific. For example:

WHEN:combat_start
IF:chance,5
die
ENDWHEN
WHEN:turn
FOR:token_type,positive
add_lust,10

This script means the girl has a 5% chance to die at the start of combat, and at the start of each turn she will gain 10 lust for each positive token she has.

Note that the ENDWHEN is very much needed here, since otherwise the second WHEN wouldn't trigger, since it would only be valid at the start of combat AND at the start of a turn.

Movescripts

Moves use their own set of scripts, namely movescripts. It's pretty straightforward, except that moves have both scripts and selfscripts. The former affects the target of the move, while the latter affects the user of the move.

Specific Scripts

Some items have very specific scripts, tailor made for their situation. We cover them here:

Aiscript

By default, the AI uses a random move from all moves that are valid. These scripts can change that. For example:

first,move_a

This means that the enemy will always use move_a during its first turn. Obviously, these are only relevant if you're modding enemies.

Moveaiscript

This sets the conditions under which a move can be used. Despite having AI in the title, these can also be used as requirements for playermoves. For example:

min_boobs,60
min_lust,60

This means the girl requires to have sufficiently large boobs and be sufficiently lusty to use the move. Since enemies don't have boobs or lust, enemies will never be able to use this move.

Usagescript

These scripts exist for tokens, they define their lifetime and how they interact with other tokens. For example, this sets that Incubate stays until the end of a dungeon, or that blockminus is the same as block for goals or moves.

Commandscript

These are the commands you can use in the Noble subscriber-only debug console. 

Buildingscript

These are the scripts that define the effects of building upgrades. Modding in your own buildings is possible, but they won't have an actual building in the guild, nor a merchant that gets slowly corrupted. You can of course also mod existing buildings.

Actionscript

This will be used for the curio system later on. But currently it doesn't do anything.

Reqscript

This defines the requirements for equipping gear. It's rather barebones for now though.

Goalscripts

These are the scripts that are used for goals (both development goals and uncursing goals). Each goal needs exactly one of these scripts.

Tutorialscript

This triggers specific tutorials

Voicescript

This triggers voicelines by the narrator.

Conclusion

That's it. Happy modding!

Remember that if you have questions, you can always ask them on the Discord. You can also check out other mods there. There's already a class overhaul mod, and some very neat equipment mods (such as a full body latex suit one). Some mods have even been added to the base game!

Get Ero Dungeons

Comments

Log in with itch.io to leave a comment.

Can we get an example for every type of script? Not all of them have an example.

(+1)

For more examples it's best to look at the game data. Starting from 2.82 you can view all the data the game itself uses which contains more than enough examples.