diff --git a/docs/source/Contribs/XYZGrid.md b/docs/source/Contribs/XYZGrid.md index 9639774d7d..fb89b4e8e6 100644 --- a/docs/source/Contribs/XYZGrid.md +++ b/docs/source/Contribs/XYZGrid.md @@ -867,6 +867,13 @@ LEGEND = { } +XYMAP_DATA = { + # ... + "map": MAPSTR, + "legend": LEGEND + # ... +} + ``` Moving west from `(1,0)` will bring you to `(1,4)` of MapA, and moving east from @@ -966,6 +973,7 @@ PROTOTYPES = { XYMAP_DATA = { # ... + "map": MAPSTR, "prototypes": PROTOTYPES # ... } @@ -997,6 +1005,12 @@ grid? You can, by adding the following to your `mygame/server/conf/settings.py`: XYZROOM_PARENT_PROTOTYPE_OVERRIDE = {"typeclass": "myxyzroom.MyXYZRoom"} XYZEXIT_PARENT_PROTOTYPE_OVERRIDE = {...} + +> If you override the typeclass in your prototypes, the typeclass used **MUST** +> inherit from `XYZRoom` and/or `XYZExit`. The `BASE_ROOM_TYPECLASS` and +> `BASE_EXIT_TYPECLASS` settings will not help - these are still useful for +> non-xyzgrid rooms/exits though. + Only add what you want to change - these dicts will _extend_ the default parent prototypes rather than replace them. As long as you define your map's prototypes to use a `prototype_parent` of `"xyz_room"` and/or `"xyz_exit"`, your changes diff --git a/evennia/contrib/rpsystem.py b/evennia/contrib/rpsystem.py index f50e5d1c37..e551d55006 100644 --- a/evennia/contrib/rpsystem.py +++ b/evennia/contrib/rpsystem.py @@ -98,9 +98,11 @@ import re from re import escape as re_escape import itertools from django.conf import settings -from evennia import DefaultObject, DefaultCharacter, ObjectDB -from evennia import Command, CmdSet -from evennia import ansi +from evennia.objects.objects import DefaultObject, DefaultCharacter +from evennia.objects.models import ObjectDB +from evennia.commands.command import Command +from evennia.commands.cmdset import CmdSet +from evennia.utils import ansi from evennia.utils.utils import lazy_property, make_iter, variable_from_module _REGEX_TUPLE_CACHE = {} @@ -451,7 +453,7 @@ def parse_sdescs_and_recogs(sender, candidates, string, search_mode=False): errors.append(_EMOTE_NOMATCH_ERROR.format(ref=marker_match.group())) elif nmatches == 1: key = "#%i" % obj.id - string = string[:istart0] + "{%s}" % key + string[istart + maxscore :] + string = string[:istart0] + "{%s}" % key + string[istart + maxscore:] mapping[key] = obj else: refname = marker_match.group()