diff --git a/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Learning-Typeclasses.md b/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Learning-Typeclasses.md index 95e146a3f6..30b8f64aaf 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Learning-Typeclasses.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Learning-Typeclasses.md @@ -2,7 +2,7 @@ Now that we have learned a little about how to find things in the Evennia library, let's use it. -In the [Python classes and objects](./Python-classes-and-objects.md) lesson we created the dragons Fluffy, Cuddly +In the [Python classes and objects](./Beginner-Tutorial-Python-classes-and-objects.md) lesson we created the dragons Fluffy, Cuddly and Smaug and made them fly and breathe fire. So far our dragons are short-lived - whenever we `restart` the server or `quit()` out of python mode they are gone. diff --git a/docs/source/Howtos/Beginner-Tutorial/Part1/Python-classes-and-objects.md b/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Python-classes-and-objects.md similarity index 100% rename from docs/source/Howtos/Beginner-Tutorial/Part1/Python-classes-and-objects.md rename to docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Python-classes-and-objects.md diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Characters.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Characters.md index ff63cd845d..cd5ec75b0a 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Characters.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Characters.md @@ -1,7 +1,7 @@ # Player Characters -In the [previous lesson about rules and dice rolling](Beginner-Gutorial-Rules) we made some assumptions -about the "Player Character" entity: +In the [previous lesson about rules and dice rolling](./Beginner-Tutorial-Rules.md) we made some +assumptions about the "Player Character" entity: - It should store Abilities on itself as `character.strength`, `character.constitution` etc. - It should have a `.heal(amount)` method. @@ -237,7 +237,8 @@ Remember that `self` is the Character instance here. So `self.location.msg_conte message to everything inside my current location". In other words, send a message to everyone in the same place as the character. -The `$You() $conj(collapse)` are [Funcparser inlines](Funcparser). These are functions that execute +The `$You() $conj(collapse)` are [FuncParser inlines](../../../Components/FuncParser.md). These are functions that +execute in the string. The resulting string may look different for different audiences. The `$You()` inline function will use `from_obj` to figure out who 'you' are and either show your name or 'You'. The `$conj()` (verb conjugator) will tweak the (English) verb to match. diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Chargen.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Chargen.md index 6c299684bd..eff9ebd946 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Chargen.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Chargen.md @@ -123,8 +123,8 @@ keep in here. ## Storing state of the menu ```{sidebar} -There is a full implementation of the chargen in [evennia/contrib/tutorials/evadventure/chargen. -py](evennia.contrib.tutorials.evadventure.chargen). +There is a full implementation of the chargen in +[evennia/contrib/tutorials/evadventure/chargen.py](evennia.contrib.tutorials.evadventure.chargen). ``` > create a new module `mygame/evadventure/chargen.py`. diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Commands.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Commands.md index e69de29bb2..7c4ecf4d5a 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Commands.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Commands.md @@ -0,0 +1,5 @@ +# In-game Commands + +```{warning} +This part of the Beginner tutorial is still being developed. +``` diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Dungeon.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Dungeon.md index e69de29bb2..b0854e1c06 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Dungeon.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Dungeon.md @@ -0,0 +1,5 @@ +# Dynamically generated Dungeon + +```{warning} +This part of the Beginner tutorial is still being developed. +``` \ No newline at end of file diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-NPCs.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-NPCs.md index e69de29bb2..9dbbdaca03 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-NPCs.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-NPCs.md @@ -0,0 +1,5 @@ +# Non-Player-Characters (NPCs) + +```{warning} +This part of the Beginner tutorial is still being developed. +``` \ No newline at end of file diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Part3-Intro.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Part3-Intro.md index f3746411c5..bbaac293f8 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Part3-Intro.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Part3-Intro.md @@ -1,5 +1,11 @@ # Part 3: How we get there +```{warning} +The tutorial game is under development and is not yet complete, nor tested. Use the existing +lessons as inspiration and to help get you going, but don't expect out-of-the-box perfection +from it at this time. +``` + ```{eval-rst} .. sidebar:: Beginner Tutorial Parts @@ -36,6 +42,7 @@ Fully coded examples of all code we make in this part can be found in the ## Lessons + ```{toctree} :maxdepth: 1 diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Quests.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Quests.md index e69de29bb2..e74f1578ee 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Quests.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Quests.md @@ -0,0 +1,5 @@ +# Game Quests + +```{warning} +This part of the Beginner tutorial is still being developed. +``` \ No newline at end of file diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Shops.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Shops.md index e69de29bb2..ea3a614c2f 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Shops.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Shops.md @@ -0,0 +1,5 @@ +# In-game Shops + +```{warning} +This part of the Beginner tutorial is still being developed. +``` \ No newline at end of file diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Turnbased-Combat b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Turnbased-Combat index e69de29bb2..dd49ff78a0 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Turnbased-Combat +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Turnbased-Combat @@ -0,0 +1,5 @@ +# Turn-based combat + +```{warning} +This part of the Beginner tutorial is still being developed. +``` \ No newline at end of file diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Utilities.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Utilities.md index 1cded5cc6f..c123455c5f 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Utilities.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Utilities.md @@ -233,7 +233,8 @@ You should get back a nice string about yourself! If that works, great! But you' doing that test when you change this code later. ```{sidebar} -In [evennia/contrib/evadventure/tests/test_utils.py](evennia.contrib.evadventure.tests.test_utils) +In [evennia/contrib/tutorials/evadventure/tests/test_utils.py](evennia.contrib.tutorials. +evadventure.tests.test_utils) is an example of the testing module. To dive deeper into unit testing in Evennia, see the [Unit testing](../../../Coding/Unit-Testing.md) documentation. ``` diff --git a/docs/source/Howtos/Howtos-Overview.md b/docs/source/Howtos/Howtos-Overview.md index 27fc8ec7ad..d0cac98f1a 100644 --- a/docs/source/Howtos/Howtos-Overview.md +++ b/docs/source/Howtos/Howtos-Overview.md @@ -56,6 +56,7 @@ Tutorial-Vehicles.md ```{toctree} :maxdepth: 1 +Tutorial-Persistent-Handler.md Gametime-Tutorial.md Help-System-Tutorial.md Mass-and-weight-for-objects.md @@ -88,4 +89,18 @@ Evennia-for-roleplaying-sessions.md Evennia-for-Diku-Users.md Evennia-for-MUSH-Users.md Tutorial-for-basic-MUSH-like-game.md -``` \ No newline at end of file +``` + +## Old tutorials + +These will be replaced by the Beginner Tutorial, but remain here until that is complete. + +```{toctree} +:maxdepth: 1 + +Implementing-a-game-rule-system.md +Turn-based-Combat-System.md +A-Sittable-Object.md + + +``` diff --git a/docs/source/Howtos/Tutorial-Persistent-Handler.md b/docs/source/Howtos/Tutorial-Persistent-Handler.md index 3b5e4a93f0..826e894e4a 100644 --- a/docs/source/Howtos/Tutorial-Persistent-Handler.md +++ b/docs/source/Howtos/Tutorial-Persistent-Handler.md @@ -231,5 +231,5 @@ character.quests.check_progress() and be sure that quest data is not lost between reloads. You can find a full-fledged quest-handler example as [EvAdventure -quests](evennia.contribs.tutorials.evadventure.quests) contrib in the Evennia +quests](evennia.contrib.tutorials.evadventure.quests) contrib in the Evennia repository. diff --git a/evennia/contrib/utils/name_generator/__init__.py b/evennia/contrib/utils/name_generator/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/evennia/utils/funcparser.py b/evennia/utils/funcparser.py index d725672ce8..71d3160124 100644 --- a/evennia/utils/funcparser.py +++ b/evennia/utils/funcparser.py @@ -46,19 +46,19 @@ The `FuncParser` also accepts a direct dict mapping of `{'name': callable, ...}` import dataclasses import inspect import random + from django.conf import settings -from evennia.utils import logger +from evennia.utils import logger, search from evennia.utils.utils import ( - make_iter, callables_from_module, - variable_from_module, - pad, crop, + int2str, justify, + make_iter, + pad, safe_convert_to_types, - int2str + variable_from_module, ) -from evennia.utils import search from evennia.utils.verb_conjugation.conjugate import verb_actor_stance_components from evennia.utils.verb_conjugation.pronouns import pronoun_to_viewpoints @@ -243,7 +243,7 @@ class FuncParser: if raise_errors: available = ", ".join(f"'{key}'" for key in self.callables) raise ParsingError( - f"Unknown parsed function '{str(parsedfunc)}' " f"(available: {available})" + f"Unknown parsed function '{str(parsedfunc)}' (available: {available})" ) return str(parsedfunc) @@ -679,6 +679,7 @@ def funcparser_callable_toint(*args, **kwargs): except TypeError: return inp + def funcparser_callable_int2str(*args, **kwargs): """ Usage: $int2str(1) -> 'one' etc, up to 12->twelve. @@ -1049,6 +1050,7 @@ def funcparser_callable_clr(*args, **kwargs): endclr = "|" + endclr if endclr else ("|n" if startclr else "") return f"{startclr}{text}{endclr}" + def funcparser_callable_pluralize(*args, **kwargs): """ FuncParser callable. Handles pluralization of a word. @@ -1059,7 +1061,7 @@ def funcparser_callable_pluralize(*args, **kwargs): otherwise use plural form. plural_word (str, optional): If given, this will be used if `number` is greater than one. If not given, we simply add 's' to the end of - `singular_word'. + `singular_word`. Example: - `$pluralize(thing, 2)` -> "things" diff --git a/evennia/utils/gametime.py b/evennia/utils/gametime.py index 9b915b368b..a911280404 100644 --- a/evennia/utils/gametime.py +++ b/evennia/utils/gametime.py @@ -10,8 +10,8 @@ total runtime of the server and the current uptime. import time from datetime import datetime, timedelta -from django.db.utils import OperationalError from django.conf import settings +from django.db.utils import OperationalError from evennia import DefaultScript from evennia.server.models import ServerConfig from evennia.utils.create import create_script @@ -236,7 +236,7 @@ def schedule( Args: callback (function): The callback function that will be called. Note that the callback must be a module-level function, since the script will - be persistent. The callable should be on form `callable(*args, **kwargs)` + be persistent. The callable should be on the form `callable(*args, **kwargs)` where args/kwargs are passed into this schedule. repeat (bool, optional): Defines if the callback should be called regularly at the specified time.