Character Creator¶
Contribution by InspectorCaracal, 2022
Commands for managing and initiating an in-game character-creation menu.
Installation¶
In your game folder commands/default_cmdsets.py
, import and add
ContribChargenCmdSet
to your AccountCmdSet
.
Example:
from evennia.contrib.rpg.character_creator.character_creator import ContribChargenCmdSet
class AccountCmdSet(default_cmds.AccountCmdSet):
def at_cmdset_creation(self):
super().at_cmdset_creation()
self.add(ContribChargenCmdSet)
In your game folder typeclasses/accounts.py
, import and inherit from ContribChargenAccount
on your Account class.
(Alternatively, you can copy the at_look
method directly into your own class.)
Example:¶
from evennia.contrib.rpg.character_creator.character_creator import ContribChargenAccount
class Account(ContribChargenAccount):
# your Account class code
In your settings file server/conf/settings.py
, add the following settings:
AUTO_CREATE_CHARACTER_WITH_ACCOUNT = False
AUTO_PUPPET_ON_LOGIN = False
(If you want to allow players to create more than one character, you can
customize that with the setting MAX_NR_CHARACTERS
.)
By default, the new charcreate
command will reference the example menu
provided by the contrib, so you can test it out before building your own menu.
You can reference
the example menu here for
ideas on how to build your own.
Once you have your own menu, just add it to your settings to use it. e.g. if your menu is in
mygame/word/chargen_menu.py
, you’d add the following to your settings file:
CHARGEN_MENU = "world.chargen_menu"
Usage¶
charcreate
command¶
The contrib overrides the character creation command - charcreate
- to use a
character creator menu, as well as supporting exiting/resuming the process. In
addition, unlike the core command, it’s designed for the character name to be
chosen later on via the menu, so it won’t parse any arguments passed to it.
Changes to Account
¶
The contrib version works mostly the same as core evennia, but modifies ooc_appearance_template
to match the contrib’s command syntax, and the at_look
method to recognize an in-progress
character.
If you’ve modified your own at_look
hook, it’s an easy change to add: just add this section to the
playable character list loop.
# the beginning of the loop starts here
for char in characters:
# ...
# contrib code starts here
if char.db.chargen_step:
# currently in-progress character; don't display placeholder names
result.append(" - |Yin progress|n (|wcharcreate|n to continue)")
continue
# the rest of your code continues here
This document page is generated from evennia/contrib/rpg/character_creator/README.md
. Changes to this
file will be overwritten, so edit that file rather than this one.