From 472d36cce1bf88e59e79ab673c3160d042bd8d52 Mon Sep 17 00:00:00 2001 From: InspectorCaracal Date: Wed, 28 Sep 2022 12:25:03 -0600 Subject: [PATCH] update for new settings --- evennia/contrib/rpg/character_creator/README.md | 10 ++++++++-- .../contrib/rpg/character_creator/character_creator.py | 9 +++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/evennia/contrib/rpg/character_creator/README.md b/evennia/contrib/rpg/character_creator/README.md index 612e19aa5c..7b3bcede04 100644 --- a/evennia/contrib/rpg/character_creator/README.md +++ b/evennia/contrib/rpg/character_creator/README.md @@ -1,8 +1,6 @@ # Character Creator contrib by InspectorCaracal -This contrib is designed to be used in MULTISESSION_MODE = 2 or higher, where characters are not automatically created to match the account. To use this with lower modes, you'll need to implement your own solution for preventing the built-in automatic character creation. - ## Installation In your game folder `commands/default_cmdsets.py`, import and add `ContribCmdCharCreate` to your `AccountCmdSet`. @@ -30,6 +28,14 @@ class Account(ContribChargenAccount): # your Account class code ``` +In your settings file `server/conf/settings.py`, add the following settings: +```python +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](/evennia/contrib/rpg/character_creator/example_menu.py) for ideas on how to build your own. diff --git a/evennia/contrib/rpg/character_creator/character_creator.py b/evennia/contrib/rpg/character_creator/character_creator.py index 4a8328f3cb..a2888a789e 100644 --- a/evennia/contrib/rpg/character_creator/character_creator.py +++ b/evennia/contrib/rpg/character_creator/character_creator.py @@ -1,9 +1,6 @@ """ Character Creator contrib, by InspectorCaracal -This contrib is designed to be used in MULTISESSION_MODE = 2 or higher, -where characters are not automatically created to match the account. - # Features The primary feature of this contrib is defining the name and attributes @@ -29,9 +26,9 @@ from evennia.utils.evmenu import EvMenu _CHARACTER_TYPECLASS = settings.BASE_CHARACTER_TYPECLASS try: - _CHARGEN_MENU = settings.CHARGEN_MENU + _CHARGEN_MENU = settings.CHARGEN_MENU except AttributeError: - _CHARGEN_MENU = "evennia.contrib.rpg.character_creator.example_menu" + _CHARGEN_MENU = "evennia.contrib.rpg.character_creator.example_menu" class ContribCmdCharCreate(MuxAccountCommand): """ @@ -60,7 +57,7 @@ class ContribCmdCharCreate(MuxAccountCommand): new_character = in_progress[0] else: # we're making a new character - charmax = settings.MAX_NR_CHARACTERS if settings.MULTISESSION_MODE > 1 else 1 + charmax = settings.MAX_NR_CHARACTERS if not account.is_superuser and ( account.db._playable_characters and len(account.db._playable_characters) >= charmax