Learn About Characters & Outfits
In the project template, we have added a new outfit for Queen called "MyModOutfit". Character files are required to be
put in a particular location in the file system. You'll find the outfit in
the res://assets/dialogue/character/Queen/MyModOutfit/
folder. Inside the folder you'll see a bunch of files that you
don't have to worry about yet.
Since this outfit's files already exist, all we have to do is let the game know that there is a new outfit.
Open the res://mods/MyMod/init.gd
script file. This file is the root file containing all of your mod's information and
the code that is executed when your mod is enabled.
When you create a new outfit for a character, you must let the game know what the outfit is and how it should handle your outfit. Do you want the outfit to be available in the shop? When should it be available in the shop? How much does it cost?
# Add our outfit for Queen into the game.
QB.character.getCharacter("Queen").addOutfit("MyModOutfit", "My Mod Outfit", "A lovely and totally safe-for-work outfit.", false, "newGame", 100)
In the project template, we have also added a new character into the game called MyCharacter
. You can find that
character's assets in the res://assets/dialogue/character/MyCharacter/Default/
folder. Don't be alarmed, she may look
exactly like Suki, but according to our mod, she totally isn't!
That folder contains the assets for our character, but we need to tell the game that this character exists. Open
the res://characters/MyCharacter.gd
script file to see what's inside.
extends Character
func _init().("MyCharacter", "My Character"):
pass
A very simple script. In the _init()
function you'll see the code needed to initialize the character's ID and the
character's name. Go ahead and change the character's name to the name of your best friend!
extends Character
func _init().("MyCharacter", "My Mom!"):
pass
Looking at the res://mods/MyMod/init.gd
file you will notice that we added this character into the game using this
line:
# Add a new character into the game.
QB.character.addCharacter("res://characters/MyCharacter.gd")
Well, now that we have a new outfit and a new character, let's go throw these into our quest dialogue!