Update the xyzgrid doc to clarify a few things

This commit is contained in:
Griatch 2021-08-08 22:23:21 +02:00
parent f7e947901f
commit 514b1b84d5
2 changed files with 20 additions and 4 deletions

View file

@ -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

View file

@ -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()