Make tutorial parts into separate subfolders for now

This commit is contained in:
Griatch 2020-07-01 21:28:04 +02:00
parent 12602dc09f
commit 221caf5187
14 changed files with 40 additions and 41 deletions

View file

@ -31,9 +31,9 @@ def create_toctree():
"""Get the path relative the source/ dir""" """Get the path relative the source/ dir"""
pathparts = path.split("/") pathparts = path.split("/")
# we allow a max of 4 levels of nesting in the source dir # we allow a max of 4 levels of nesting in the source dir
ind = pathparts[-4:].index(_SOURCEDIR_NAME) ind = pathparts[-5:].index(_SOURCEDIR_NAME)
# get the part after source/ # get the part after source/
pathparts = pathparts[-4 + 1 + ind:] pathparts = pathparts[-5 + 1 + ind:]
url = "/".join(pathparts) url = "/".join(pathparts)
# get the reference, without .md # get the reference, without .md
url = url.rsplit(".", 1)[0] url = url.rsplit(".", 1)[0]

View file

@ -15,7 +15,7 @@ longer-form documentation associated with particular contribs.
## The tutorial-world ## The tutorial-world
- [The tutorial world introduction](../Howto/Starting/Tutorial-World-Introduction) - [The tutorial world introduction](../Howto/Starting/Part1/Tutorial-World-Introduction)
## Menu-builder ## Menu-builder

View file

@ -47,7 +47,7 @@ a [screenshot](Screenshot).
Once you installed Evennia yourself it comes with its own tutorial - this shows off some of the Once you installed Evennia yourself it comes with its own tutorial - this shows off some of the
possibilities _and_ gives you a small single-player quest to play. The tutorial takes only one possibilities _and_ gives you a small single-player quest to play. The tutorial takes only one
single in-game command to install as explained [here](Howto/Starting/Tutorial-World-Introduction). single in-game command to install as explained [here](Howto/Starting/Part1/Tutorial-World-Introduction).
## Brief summary of features ## Brief summary of features

View file

@ -15,8 +15,8 @@ in mind for your own game, this will give you a good start.
### Part 1: What we have ### Part 1: What we have
1. [Introduction & Overview](Starting/Starting-Part1) 1. [Introduction & Overview](Starting/Starting-Part1)
1. [Building stuff](Starting/Building-Quickstart) 1. [Building stuff](Starting/Part1/Building-Quickstart)
1. [Python basics](Starting/Python-basic-introduction) 1. [Python basics](Starting/Part1/Python-basic-introduction)
1. [Python classes](Starting/Python-basic-tutorial-part-two) 1. [Python classes](Starting/Python-basic-tutorial-part-two)
1. [Running Python in- and outside the game](Starting/Execute-Python-Code) 1. [Running Python in- and outside the game](Starting/Execute-Python-Code)
1. [Understanding errors](Understanding-Errors) 1. [Understanding errors](Understanding-Errors)

View file

@ -10,7 +10,7 @@ Here are some pointers to get you going.
Evennia is developed using Python. Even if you are more of a designer than a coder, it is wise to Evennia is developed using Python. Even if you are more of a designer than a coder, it is wise to
learn how to read and understand basic Python code. If you are new to Python, or need a refresher, learn how to read and understand basic Python code. If you are new to Python, or need a refresher,
take a look at our two-part [Python introduction](Python-basic-introduction). take a look at our two-part [Python introduction](Part1/Python-basic-introduction).
### Explore Evennia interactively ### Explore Evennia interactively

View file

@ -1,6 +1,6 @@
# Using the game and building stuff # Using the game and building stuff
[prev lesson](Starting-Part1) | [next lesson](Tutorial-World-Introduction) [prev lesson](../Starting-Part1) | [next lesson](Tutorial-World-Introduction)
In this lesson we will test out what we can do in-game out-of-the-box. Evennia ships with In this lesson we will test out what we can do in-game out-of-the-box. Evennia ships with
[~90 default commands](Default-Command-Help), and while you can override those as you please, [~90 default commands](Default-Command-Help), and while you can override those as you please,
@ -9,7 +9,7 @@ they can be quite useful.
Connect and log into your new game and you will end up in the "Limbo" location. This Connect and log into your new game and you will end up in the "Limbo" location. This
is the only room in the game at this point. Let's explore the commands a little. is the only room in the game at this point. Let's explore the commands a little.
The default commands has syntax [similar to MUX](../../Concept/Using-MUX-as-a-Standard): The default commands has syntax [similar to MUX](../../../Concept/Using-MUX-as-a-Standard):
command[/switch/switch...] [arguments ...] command[/switch/switch...] [arguments ...]
@ -127,14 +127,14 @@ dropped in the room, then try this:
lock box = get:false() lock box = get:false()
Locks represent a rather [big topic](../../Component/Locks), but for now that will do what we want. This will lock Locks represent a rather [big topic](../../../Component/Locks), but for now that will do what we want. This will lock
the box so noone can lift it. The exception is superusers, they override all locks and will pick it the box so noone can lift it. The exception is superusers, they override all locks and will pick it
up anyway. Make sure you are quelling your superuser powers and try to get the box now: up anyway. Make sure you are quelling your superuser powers and try to get the box now:
> get box > get box
You can't get that. You can't get that.
Think thís default error message looks dull? The `get` command looks for an [Attribute](../../Component/Attributes) Think thís default error message looks dull? The `get` command looks for an [Attribute](../../../Component/Attributes)
named `get_err_msg` for returning a nicer error message (we just happen to know this, you would need named `get_err_msg` for returning a nicer error message (we just happen to know this, you would need
to peek into the to peek into the
[code](https://github.com/evennia/evennia/blob/master/evennia/commands/default/general.py#L235) for [code](https://github.com/evennia/evennia/blob/master/evennia/commands/default/general.py#L235) for
@ -152,11 +152,11 @@ the raw description of your current room (including color codes), so that you ca
set its description to something else. set its description to something else.
You create new Commands (or modify existing ones) in Python outside the game. We will get to that You create new Commands (or modify existing ones) in Python outside the game. We will get to that
later, in the [Commands tutorial](Adding-Command-Tutorial). later, in the [Commands tutorial](../Adding-Command-Tutorial).
## Get a Personality ## Get a Personality
[Scripts](../../Component/Scripts) are powerful out-of-character objects useful for many "under the hood" things. [Scripts](../../../Component/Scripts) are powerful out-of-character objects useful for many "under the hood" things.
One of their optional abilities is to do things on a timer. To try out a first script, let's put one One of their optional abilities is to do things on a timer. To try out a first script, let's put one
on ourselves. There is an example script in `evennia/contrib/tutorial_examples/bodyfunctions.py` on ourselves. There is an example script in `evennia/contrib/tutorial_examples/bodyfunctions.py`
that is called `BodyFunctions`. To add this to us we will use the `script` command: that is called `BodyFunctions`. To add this to us we will use the `script` command:
@ -185,14 +185,14 @@ When you are tired of your character's "insights", kill the script with
script/stop self = tutorial_examples.bodyfunctions.BodyFunctions script/stop self = tutorial_examples.bodyfunctions.BodyFunctions
You create your own scripts in Python, outside the game; the path you give to `script` is literally You create your own scripts in Python, outside the game; the path you give to `script` is literally
the Python path to your script file. The [Scripts](../../Component/Scripts) page explains more details. the Python path to your script file. The [Scripts](../../../Component/Scripts) page explains more details.
## Pushing Your Buttons ## Pushing Your Buttons
If we get back to the box we made, there is only so much fun you can have with it at this point. It's If we get back to the box we made, there is only so much fun you can have with it at this point. It's
just a dumb generic object. If you renamed it to `stone` and changed its description, noone would be just a dumb generic object. If you renamed it to `stone` and changed its description, noone would be
the wiser. However, with the combined use of custom [Typeclasses](../../Component/Typeclasses), [Scripts](../../Component/Scripts) the wiser. However, with the combined use of custom [Typeclasses](../../../Component/Typeclasses), [Scripts](../../../Component/Scripts)
and object-based [Commands](../../Component/Commands), you could expand it and other items to be as unique, complex and object-based [Commands](../../../Component/Commands), you could expand it and other items to be as unique, complex
and interactive as you want. and interactive as you want.
Let's take an example. So far we have only created objects that use the default object typeclass Let's take an example. So far we have only created objects that use the default object typeclass
@ -208,7 +208,7 @@ The same way we did with the Script Earler, we specify a "Python-path" to the Py
to use for creating the object. There you go - one red button. to use for creating the object. There you go - one red button.
The RedButton is an example object intended to show off a few of Evennia's features. You will find The RedButton is an example object intended to show off a few of Evennia's features. You will find
that the [Typeclass](../../Component/Typeclasses) and [Commands](../../Component/Commands) controlling it are that the [Typeclass](../../../Component/Typeclasses) and [Commands](../../../Component/Commands) controlling it are
inside [evennia/contrib/tutorial_examples](api:evennia.contrib.tutorial_examples) inside [evennia/contrib/tutorial_examples](api:evennia.contrib.tutorial_examples)
If you wait for a while (make sure you dropped it!) the button will blink invitingly. If you wait for a while (make sure you dropped it!) the button will blink invitingly.
@ -313,4 +313,4 @@ You will now find your new `History` entry in the `help` list and read your help
After this brief introduction to building and using in-game commands you may be ready to see a more fleshed-out After this brief introduction to building and using in-game commands you may be ready to see a more fleshed-out
example. Evennia comes with a tutorial world for you to explore. We will try that out in the next section. example. Evennia comes with a tutorial world for you to explore. We will try that out in the next section.
[prev lesson](Starting-Part1) | [next lesson](Tutorial-World-Introduction) [prev lesson](../Starting-Part1) | [next lesson](Tutorial-World-Introduction)

View file

@ -56,7 +56,7 @@ and how you point to it correctly.
## commands/ ## commands/
The `commands/` folder holds Python modules related to creating and extending the [Commands](../../Component/Commands) The `commands/` folder holds Python modules related to creating and extending the [Commands](../../../Component/Commands)
of Evennia. These manifest in game like the server understanding input like `look` or `dig`. of Evennia. These manifest in game like the server understanding input like `look` or `dig`.
```sidebar:: Classes ```sidebar:: Classes
@ -148,28 +148,28 @@ knows where they are and will read them to configure itself at startup.
### typeclasses/ ### typeclasses/
The [Typeclasses](../../Component/Typeclasses) of Evennia are Evennia-specific Python classes whose instances save themselves The [Typeclasses](../../../Component/Typeclasses) of Evennia are Evennia-specific Python classes whose instances save themselves
to the database. This allows a Character to remain in the same place and your updated strength stat to still to the database. This allows a Character to remain in the same place and your updated strength stat to still
be the same after a server reboot. be the same after a server reboot.
- [accounts.py](github:evennia/game_template/typeclasses/accounts.py) (Python-path: `typeclasses.accounts`) - An - [accounts.py](github:evennia/game_template/typeclasses/accounts.py) (Python-path: `typeclasses.accounts`) - An
[Account](../../Component/Accounts) represents the player connecting to the game. It holds information like email, [Account](../../../Component/Accounts) represents the player connecting to the game. It holds information like email,
password and other out-of-character details. password and other out-of-character details.
- [channels.py](github:evennia/game_template/typeclasses/channels.py) (Python-path: `typeclasses.channels`) - - [channels.py](github:evennia/game_template/typeclasses/channels.py) (Python-path: `typeclasses.channels`) -
[Channels](Channels) are used to manage in-game communication between players. [Channels](Channels) are used to manage in-game communication between players.
- [objects.py](github:evennia/game_template/typeclasses/objects.py) (Python-path: `typeclasses.objects`) - - [objects.py](github:evennia/game_template/typeclasses/objects.py) (Python-path: `typeclasses.objects`) -
[Objects](../../Component/Objects) represent all things having a location within the game world. [Objects](../../../Component/Objects) represent all things having a location within the game world.
- [characters.py](github:evennia/game_template/typeclasses/characters.py) (Python-path: `typeclasses.characters`) - - [characters.py](github:evennia/game_template/typeclasses/characters.py) (Python-path: `typeclasses.characters`) -
The [Character](../../Component/Objects#Characers) is a subclass of Objects, controlled by Accounts - they are the player's The [Character](../../../Component/Objects#Characers) is a subclass of Objects, controlled by Accounts - they are the player's
avatars in the game world. avatars in the game world.
- [rooms.py](github:evennia/game_template/typeclasses/rooms.py) (Python-path: `typeclasses.rooms`) - A - [rooms.py](github:evennia/game_template/typeclasses/rooms.py) (Python-path: `typeclasses.rooms`) - A
[Room](../../Component/Objects#Room) is also a subclass of Object; describing discrete locations. While the traditional [Room](../../../Component/Objects#Room) is also a subclass of Object; describing discrete locations. While the traditional
term is 'room', such a location can be anything and on any scale that fits your game, from a forest glade, term is 'room', such a location can be anything and on any scale that fits your game, from a forest glade,
an entire planet or an actual dungeon room. an entire planet or an actual dungeon room.
- [exits.py](github:evennia/game_template/typeclasses/exits.py) (Python-path: `typeclasses.exits`) - - [exits.py](github:evennia/game_template/typeclasses/exits.py) (Python-path: `typeclasses.exits`) -
[Exits](../../Component/Objects#Exit) is another subclass of Object. Exits link one Room to another. [Exits](../../../Component/Objects#Exit) is another subclass of Object. Exits link one Room to another.
- [scripts.py](github:evennia/game_template/typeclasses/scripts.py) (Python-path: `typeclasses.scripts`) - - [scripts.py](github:evennia/game_template/typeclasses/scripts.py) (Python-path: `typeclasses.scripts`) -
[Scripts](../../Component/Scripts) are 'out-of-character' objects. They have no location in-game and can serve as basis for [Scripts](../../../Component/Scripts) are 'out-of-character' objects. They have no location in-game and can serve as basis for
anything that needs database persistence, such as combat, weather, or economic systems. They also anything that needs database persistence, such as combat, weather, or economic systems. They also
have the ability to execute code repeatedly, on a timer. have the ability to execute code repeatedly, on a timer.

View file

@ -7,7 +7,7 @@ is a mature and professional programming language that is very fast to work with
That said, even though Python is widely considered easy to learn, we can only cover the most immediately That said, even though Python is widely considered easy to learn, we can only cover the most immediately
important aspects of Python in this series of starting tutorials. Hopefully we can get you started important aspects of Python in this series of starting tutorials. Hopefully we can get you started
but then you'll need to continue learning from there. See our [link section](../../Links) for finding but then you'll need to continue learning from there. See our [link section](../../../Links) for finding
more reference material and dedicated Python tutorials. more reference material and dedicated Python tutorials.
> While this will be quite basic if you are an experienced developer, you may want to at least > While this will be quite basic if you are an experienced developer, you may want to at least
@ -615,7 +615,6 @@ If `ipython` is installed, `evennia shell` will use it automatically.
... ...
IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help
In [1]: In [1]:
You now have Tab-completion: You now have Tab-completion:
> import evennia > import evennia

View file

@ -1,6 +1,6 @@
# Python basic tutorial part two # Python basic tutorial part two
[In the first part](Python-basic-introduction) of this Python-for-Evennia basic tutorial we learned [In the first part](Part1/Python-basic-introduction) of this Python-for-Evennia basic tutorial we learned
how to run some simple Python code from inside the game. We also made our first new *module* how to run some simple Python code from inside the game. We also made our first new *module*
containing a *function* that we called. Now we're going to start exploring the very important containing a *function* that we called. Now we're going to start exploring the very important
subject of *objects*. subject of *objects*.

View file

@ -1,6 +1,6 @@
# Evennia Starting Tutorial # Evennia Starting Tutorial
[Next lesson](Building-Quickstart) [Next lesson](Part1/Building-Quickstart)
This is a multi-part Tutorial that will gradually take you from first installation to making your This is a multi-part Tutorial that will gradually take you from first installation to making your
own first little game in Evennia. Let's get started! own first little game in Evennia. Let's get started!
@ -22,9 +22,9 @@ own first little game in Evennia. Let's get started!
## Lessons of Part 1 - "What we have" ## Lessons of Part 1 - "What we have"
1. Introduction & Overview (you are here) 1. Introduction & Overview (you are here)
1. [Building stuff](Building-Quickstart) 1. [Building stuff](Part1/Building-Quickstart)
1. [The Tutorial World](Tutorial-World-Introduction) 1. [The Tutorial World](Part1/Tutorial-World-Introduction)
1. [Python basics](Python-basic-introduction) 1. [Python basics](Part1/Python-basic-introduction)
1. [Python classes](Python-basic-tutorial-part-two) 1. [Python classes](Python-basic-tutorial-part-two)
1. [Running Python in- and outside the game](Execute-Python-Code) 1. [Running Python in- and outside the game](Execute-Python-Code)
1. [Understanding errors](Understanding-Errors) 1. [Understanding errors](Understanding-Errors)
@ -102,4 +102,4 @@ first enter that gamedir and run
You should now be good to go! You should now be good to go!
[Next lesson](Building-Quickstart) [Next lesson](Part1/Building-Quickstart)

View file

@ -649,6 +649,6 @@ The simple "Power" game mechanic should be easily expandable to something more f
useful, same is true for the combat score principle. The `+attack` could be made to target a useful, same is true for the combat score principle. The `+attack` could be made to target a
specific player (or npc) and automatically compare their relevant attributes to determine a result. specific player (or npc) and automatically compare their relevant attributes to determine a result.
To continue from here, you can take a look at the [Tutorial World](Tutorial-World-Introduction). For To continue from here, you can take a look at the [Tutorial World](Part1/Tutorial-World-Introduction). For
more specific ideas, see the [other tutorials and hints](Tutorials) as well more specific ideas, see the [other tutorials and hints](Tutorials) as well
as the [Developer Central](Developer-Central). as the [Developer Central](Developer-Central).

View file

@ -438,7 +438,7 @@ logged in, stand in the `Limbo` room and run
@batchcommand tutorial_world.build @batchcommand tutorial_world.build
to build [Evennia's tutorial world](../Howto/Starting/Tutorial-World-Introduction) - it's a small solo quest to to build [Evennia's tutorial world](../Howto/Starting/Part1/Tutorial-World-Introduction) - it's a small solo quest to
explore. Only run the instructed `@batchcommand` once. You'll get a lot of text scrolling by as the explore. Only run the instructed `@batchcommand` once. You'll get a lot of text scrolling by as the
tutorial is built. Once done, the `tutorial` exit will have appeared out of Limbo - just write tutorial is built. Once done, the `tutorial` exit will have appeared out of Limbo - just write
`tutorial` to enter it. `tutorial` to enter it.

View file

@ -94,16 +94,17 @@
- [Howto/Starting/Add a simple new web page](Howto/Starting/Add-a-simple-new-web-page) - [Howto/Starting/Add a simple new web page](Howto/Starting/Add-a-simple-new-web-page)
- [Howto/Starting/Adding Command Tutorial](Howto/Starting/Adding-Command-Tutorial) - [Howto/Starting/Adding Command Tutorial](Howto/Starting/Adding-Command-Tutorial)
- [Howto/Starting/Adding Object Typeclass Tutorial](Howto/Starting/Adding-Object-Typeclass-Tutorial) - [Howto/Starting/Adding Object Typeclass Tutorial](Howto/Starting/Adding-Object-Typeclass-Tutorial)
- [Howto/Starting/Building Quickstart](Howto/Starting/Building-Quickstart)
- [Howto/Starting/Coding Introduction](Howto/Starting/Coding-Introduction) - [Howto/Starting/Coding Introduction](Howto/Starting/Coding-Introduction)
- [Howto/Starting/Coordinates](Howto/Starting/Coordinates) - [Howto/Starting/Coordinates](Howto/Starting/Coordinates)
- [Howto/Starting/Execute Python Code](Howto/Starting/Execute-Python-Code) - [Howto/Starting/Execute Python Code](Howto/Starting/Execute-Python-Code)
- [Howto/Starting/First Steps Coding](Howto/Starting/First-Steps-Coding) - [Howto/Starting/First Steps Coding](Howto/Starting/First-Steps-Coding)
- [Howto/Starting/Game Planning](Howto/Starting/Game-Planning) - [Howto/Starting/Game Planning](Howto/Starting/Game-Planning)
- [Howto/Starting/Gamedir Overview](Howto/Starting/Gamedir-Overview)
- [Howto/Starting/Implementing a game rule system](Howto/Starting/Implementing-a-game-rule-system) - [Howto/Starting/Implementing a game rule system](Howto/Starting/Implementing-a-game-rule-system)
- [Howto/Starting/Parsing command arguments, theory and best practices](Howto/Starting/Parsing-command-arguments,-theory-and-best-practices) - [Howto/Starting/Parsing command arguments, theory and best practices](Howto/Starting/Parsing-command-arguments,-theory-and-best-practices)
- [Howto/Starting/Python basic introduction](Howto/Starting/Python-basic-introduction) - [Howto/Starting/Part1/Building Quickstart](Howto/Starting/Part1/Building-Quickstart)
- [Howto/Starting/Part1/Gamedir Overview](Howto/Starting/Part1/Gamedir-Overview)
- [Howto/Starting/Part1/Python basic introduction](Howto/Starting/Part1/Python-basic-introduction)
- [Howto/Starting/Part1/Tutorial World Introduction](Howto/Starting/Part1/Tutorial-World-Introduction)
- [Howto/Starting/Python basic tutorial part two](Howto/Starting/Python-basic-tutorial-part-two) - [Howto/Starting/Python basic tutorial part two](Howto/Starting/Python-basic-tutorial-part-two)
- [Howto/Starting/Starting Part1](Howto/Starting/Starting-Part1) - [Howto/Starting/Starting Part1](Howto/Starting/Starting-Part1)
- [Howto/Starting/Starting Part2](Howto/Starting/Starting-Part2) - [Howto/Starting/Starting Part2](Howto/Starting/Starting-Part2)
@ -112,7 +113,6 @@
- [Howto/Starting/Starting Part5](Howto/Starting/Starting-Part5) - [Howto/Starting/Starting Part5](Howto/Starting/Starting-Part5)
- [Howto/Starting/Turn based Combat System](Howto/Starting/Turn-based-Combat-System) - [Howto/Starting/Turn based Combat System](Howto/Starting/Turn-based-Combat-System)
- [Howto/Starting/Tutorial Searching For Objects](Howto/Starting/Tutorial-Searching-For-Objects) - [Howto/Starting/Tutorial Searching For Objects](Howto/Starting/Tutorial-Searching-For-Objects)
- [Howto/Starting/Tutorial World Introduction](Howto/Starting/Tutorial-World-Introduction)
- [Howto/Starting/Tutorial for basic MUSH like game](Howto/Starting/Tutorial-for-basic-MUSH-like-game) - [Howto/Starting/Tutorial for basic MUSH like game](Howto/Starting/Tutorial-for-basic-MUSH-like-game)
- [Howto/Starting/Web Tutorial](Howto/Starting/Web-Tutorial) - [Howto/Starting/Web Tutorial](Howto/Starting/Web-Tutorial)
- [Howto/Tutorial Aggressive NPCs](Howto/Tutorial-Aggressive-NPCs) - [Howto/Tutorial Aggressive NPCs](Howto/Tutorial-Aggressive-NPCs)