mirror of
https://github.com/evennia/evennia.git
synced 2026-03-17 21:36:30 +01:00
Convert master docs to use MyST
This commit is contained in:
parent
6e03216cd9
commit
d229ff024c
359 changed files with 3275 additions and 4567 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Adding Command Tutorial
|
||||
|
||||
This is a quick first-time tutorial expanding on the [Commands](./Commands) documentation.
|
||||
This is a quick first-time tutorial expanding on the [Commands](./Commands.md) documentation.
|
||||
|
||||
Let's assume you have just downloaded Evennia, installed it and created your game folder (let's call
|
||||
it just `mygame` here). Now you want to try to add a new command. This is the fastest way to do it.
|
||||
|
|
@ -16,7 +16,7 @@ example code.
|
|||
1. Give your class a useful _docstring_. A docstring is the string at the very top of a class or
|
||||
function/method. The docstring at the top of the command class is read by Evennia to become the help
|
||||
entry for the Command (see
|
||||
[Command Auto-help](./Help-System#command-auto-help-system)).
|
||||
[Command Auto-help](./Help-System.md#command-auto-help-system)).
|
||||
1. Define a class method `func(self)` that echoes your input back to you.
|
||||
|
||||
Below is an example how this all could look for the echo command:
|
||||
|
|
@ -47,7 +47,7 @@ Below is an example how this all could look for the echo command:
|
|||
|
||||
## Step 2: Adding the Command to a default Cmdset
|
||||
|
||||
The command is not available to use until it is part of a [Command Set](./Command-Sets). In this
|
||||
The command is not available to use until it is part of a [Command Set](./Command-Sets.md). In this
|
||||
example we will go the easiest route and add it to the default Character commandset that already
|
||||
exists.
|
||||
|
||||
|
|
@ -87,13 +87,13 @@ your command definition).
|
|||
by
|
||||
its argument `test` (which will end up in `self.args). To change this behavior, you can add the
|
||||
`arg_regex` property alongside `key`, `help_category` etc. [See the arg_regex
|
||||
documentation](Commands#on-arg_regex) for more info.
|
||||
documentation](./Commands.md#on-arg_regex) for more info.
|
||||
|
||||
If you want to overload existing default commands (such as `look` or `get`), just add your new
|
||||
command with the same key as the old one - it will then replace it. Just remember that you must use
|
||||
`@reload` to see any changes.
|
||||
|
||||
See [Commands](./Commands) for many more details and possibilities when defining Commands and using
|
||||
See [Commands](./Commands.md) for many more details and possibilities when defining Commands and using
|
||||
Cmdsets in various ways.
|
||||
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ Cmdsets in various ways.
|
|||
Adding your Command to the `CharacterCmdSet` is just one easy exapmple. The cmdset system is very
|
||||
generic. You can create your own cmdsets (let's say in a module `mycmdsets.py`) and add them to
|
||||
objects as you please (how to control their merging is described in detail in the [Command Set
|
||||
documentation](Command-Sets)).
|
||||
documentation](./Command-Sets.md)).
|
||||
|
||||
```python
|
||||
# file mygame/commands/mycmdsets.py
|
||||
|
|
@ -131,7 +131,7 @@ only make the new merged cmdset permanent on that *single* object. Often you wan
|
|||
this particular class to have this cmdset.
|
||||
|
||||
To make sure all new created objects get your new merged set, put the `cmdset.add` call in your
|
||||
custom [Typeclasses](./Typeclasses)' `at_object_creation` method:
|
||||
custom [Typeclasses](./Typeclasses.md)' `at_object_creation` method:
|
||||
|
||||
```python
|
||||
# e.g. in mygame/typeclasses/objects.py
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue