evennia.game_template.commands package

Submodules

evennia.game_template.commands.command module

Commands

Commands describe the input the account can do to the game.

class evennia.game_template.commands.command.Command(**kwargs)[source]

Bases: evennia.commands.command.Command

Inherit from this if you want to create your own command styles from scratch. Note that Evennia’s default commands inherits from MuxCommand instead.

Note that the class’s __doc__ string (this text) is used by Evennia to create the automatic help entry for the command, so make sure to document consistently here.

Each Command implements the following methods, called in this order (only func() is actually required):

  • at_pre_cmd(): If this returns anything truthy, execution is aborted.

  • parse(): Should perform any extra parsing needed on self.args

    and store the result on self.

  • func(): Performs the actual work.

  • at_post_cmd(): Extra actions, often things done after

    every command, like prompts.

_keyaliases = ('command',)
_matchset = {'command'}
aliases = []
help_category = 'general'
key = 'command'
lock_storage = 'cmd:all();'
search_index_entry = {'aliases': '', 'category': 'general', 'key': 'command', 'tags': '', 'text': "\n Inherit from this if you want to create your own command styles\n from scratch. Note that Evennia's default commands inherits from\n MuxCommand instead.\n\n Note that the class's `__doc__` string (this text) is\n used by Evennia to create the automatic help entry for\n the command, so make sure to document consistently here.\n\n Each Command implements the following methods, called\n in this order (only func() is actually required):\n - at_pre_cmd(): If this returns anything truthy, execution is aborted.\n - parse(): Should perform any extra parsing needed on self.args\n and store the result on self.\n - func(): Performs the actual work.\n - at_post_cmd(): Extra actions, often things done after\n every command, like prompts.\n\n "}

evennia.game_template.commands.default_cmdsets module

Command sets

All commands in the game must be grouped in a cmdset. A given command can be part of any number of cmdsets and cmdsets can be added/removed and merged onto entities at runtime.

To create new commands to populate the cmdset, see commands/command.py.

This module wraps the default command sets of Evennia; overloads them to add/remove commands from the default lineup. You can create your own cmdsets by inheriting from them or directly from evennia.CmdSet.

class evennia.game_template.commands.default_cmdsets.AccountCmdSet(cmdsetobj=None, key=None)[source]

Bases: evennia.commands.default.cmdset_account.AccountCmdSet

This is the cmdset available to the Account at all times. It is combined with the CharacterCmdSet when the Account puppets a Character. It holds game-account-specific commands, channel commands, etc.

at_cmdset_creation()[source]

Populates the cmdset

key = 'DefaultAccount'
path = 'evennia.game_template.commands.default_cmdsets.AccountCmdSet'
class evennia.game_template.commands.default_cmdsets.CharacterCmdSet(cmdsetobj=None, key=None)[source]

Bases: evennia.commands.default.cmdset_character.CharacterCmdSet

The CharacterCmdSet contains general in-game commands like look, get, etc available on in-game Character objects. It is merged with the AccountCmdSet when an Account puppets a Character.

at_cmdset_creation()[source]

Populates the cmdset

key = 'DefaultCharacter'
path = 'evennia.game_template.commands.default_cmdsets.CharacterCmdSet'
class evennia.game_template.commands.default_cmdsets.SessionCmdSet(cmdsetobj=None, key=None)[source]

Bases: evennia.commands.default.cmdset_session.SessionCmdSet

This cmdset is made available on Session level once logged in. It is empty by default.

at_cmdset_creation()[source]

This is the only method defined in a cmdset, called during its creation. It should populate the set with command instances.

As and example we just add the empty base Command object. It prints some info.

key = 'DefaultSession'
path = 'evennia.game_template.commands.default_cmdsets.SessionCmdSet'
class evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet(cmdsetobj=None, key=None)[source]

Bases: evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet

Command set available to the Session before being logged in. This holds commands like creating a new account, logging in, etc.

at_cmdset_creation()[source]

Populates the cmdset

key = 'DefaultUnloggedin'
path = 'evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet'