Update the xyzgrid doc to clarify a few things
This commit is contained in:
parent
bc62588253
commit
3c4419c616
2 changed files with 20 additions and 4 deletions
|
|
@ -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
|
Moving west from `(1,0)` will bring you to `(1,4)` of MapA, and moving east from
|
||||||
|
|
@ -966,6 +973,7 @@ PROTOTYPES = {
|
||||||
|
|
||||||
XYMAP_DATA = {
|
XYMAP_DATA = {
|
||||||
# ...
|
# ...
|
||||||
|
"map": MAPSTR,
|
||||||
"prototypes": PROTOTYPES
|
"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"}
|
XYZROOM_PARENT_PROTOTYPE_OVERRIDE = {"typeclass": "myxyzroom.MyXYZRoom"}
|
||||||
XYZEXIT_PARENT_PROTOTYPE_OVERRIDE = {...}
|
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
|
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
|
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
|
to use a `prototype_parent` of `"xyz_room"` and/or `"xyz_exit"`, your changes
|
||||||
|
|
|
||||||
|
|
@ -98,9 +98,11 @@ import re
|
||||||
from re import escape as re_escape
|
from re import escape as re_escape
|
||||||
import itertools
|
import itertools
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from evennia import DefaultObject, DefaultCharacter, ObjectDB
|
from evennia.objects.objects import DefaultObject, DefaultCharacter
|
||||||
from evennia import Command, CmdSet
|
from evennia.objects.models import ObjectDB
|
||||||
from evennia import ansi
|
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
|
from evennia.utils.utils import lazy_property, make_iter, variable_from_module
|
||||||
|
|
||||||
_REGEX_TUPLE_CACHE = {}
|
_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()))
|
errors.append(_EMOTE_NOMATCH_ERROR.format(ref=marker_match.group()))
|
||||||
elif nmatches == 1:
|
elif nmatches == 1:
|
||||||
key = "#%i" % obj.id
|
key = "#%i" % obj.id
|
||||||
string = string[:istart0] + "{%s}" % key + string[istart + maxscore :]
|
string = string[:istart0] + "{%s}" % key + string[istart + maxscore:]
|
||||||
mapping[key] = obj
|
mapping[key] = obj
|
||||||
else:
|
else:
|
||||||
refname = marker_match.group()
|
refname = marker_match.group()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue