Copy doc tools from develop
This commit is contained in:
parent
ca97c9bda0
commit
c52f505d00
127 changed files with 2927 additions and 1427 deletions
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
|
||||
The *spawner* is a system for defining and creating individual objects from a base template called a
|
||||
*prototype*. It is only designed for use with in-game [Objects](Objects), not any other type of
|
||||
*prototype*. It is only designed for use with in-game [Objects](./Objects), not any other type of
|
||||
entity.
|
||||
|
||||
The normal way to create a custom object in Evennia is to make a [Typeclass](Typeclasses). If you
|
||||
The normal way to create a custom object in Evennia is to make a [Typeclass](./Typeclasses). If you
|
||||
haven't read up on Typeclasses yet, think of them as normal Python classes that save to the database
|
||||
behind the scenes. Say you wanted to create a "Goblin" enemy. A common way to do this would be to
|
||||
first create a `Mobile` typeclass that holds everything common to mobiles in the game, like generic
|
||||
|
|
@ -61,7 +61,7 @@ If you wanted to load it into the spawner in-game you could just put all on one
|
|||
> Note that the prototype dict as given on the command line must be a valid Python structure -
|
||||
so you need to put quotes around strings etc. For security reasons, a dict inserted from-in game cannot have any
|
||||
other advanced Python functionality, such as executable code, `lambda` etc. If builders are supposed
|
||||
to be able to use such features, you need to offer them through [$protfuncs](Spawner-and-Prototypes#protfuncs), embedded runnable functions that you have full control to check and vet before running.
|
||||
to be able to use such features, you need to offer them through [$protfuncs](./Spawner-and-Prototypes#protfuncs), embedded runnable functions that you have full control to check and vet before running.
|
||||
|
||||
### Prototype keys
|
||||
|
||||
|
|
@ -92,11 +92,11 @@ The remaining keys determine actual aspects of the objects to spawn from this pr
|
|||
- `home` - a valid `#dbref`. Defaults to `location` or `settings.DEFAULT_HOME` if location does not exist.
|
||||
- `destination` - a valid `#dbref`. Only used by exits.
|
||||
- `permissions` - list of permission strings, like `["Accounts", "may_use_red_door"]`
|
||||
- `locks` - a [lock-string](Locks) like `"edit:all();control:perm(Builder)"`
|
||||
- `locks` - a [lock-string](./Locks) like `"edit:all();control:perm(Builder)"`
|
||||
- `aliases` - list of strings for use as aliases
|
||||
- `tags` - list [Tags](Tags). These are given as tuples `(tag, category, data)`.
|
||||
- `attrs` - list of [Attributes](Attributes). These are given as tuples `(attrname, value, category, lockstring)`
|
||||
- Any other keywords are interpreted as non-category [Attributes](Attributes) and their values. This is
|
||||
- `tags` - list [Tags](./Tags). These are given as tuples `(tag, category, data)`.
|
||||
- `attrs` - list of [Attributes](./Attributes). These are given as tuples `(attrname, value, category, lockstring)`
|
||||
- Any other keywords are interpreted as non-category [Attributes](./Attributes) and their values. This is
|
||||
convenient for simple Attributes - use `attrs` for full control of Attributes.
|
||||
|
||||
Deprecated as of Evennia 0.8:
|
||||
|
|
@ -104,7 +104,7 @@ Deprecated as of Evennia 0.8:
|
|||
- `ndb_<name>` - sets the value of a non-persistent attribute (`"ndb_"` is stripped from the name).
|
||||
This is simply not useful in a prototype and is deprecated.
|
||||
- `exec` - This accepts a code snippet or a list of code snippets to run. This should not be used -
|
||||
use callables or [$protfuncs](Spawner-and-Prototypes#protfuncs) instead (see below).
|
||||
use callables or [$protfuncs](./Spawner-and-Prototypes#protfuncs) instead (see below).
|
||||
|
||||
### Prototype values
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ Finally, the value can be a *prototype function* (*Protfunc*). These look like s
|
|||
"He has $randint(2,5) skulls in a chain around his neck."}
|
||||
```
|
||||
At execution time, the place of the protfunc will be replaced with the result of that protfunc being called (this is always a string). A protfunc works in much the same way as an
|
||||
[InlineFunc](TextTags#inline-functions) - they are actually
|
||||
[InlineFunc](./TextTags#inline-functions) - they are actually
|
||||
parsed using the same parser - except protfuncs are run every time the prototype is used to spawn a new object (whereas an inlinefunc is called when a text is returned to the user).
|
||||
|
||||
Here is how a protfunc is defined (same as an inlinefunc).
|
||||
|
|
@ -202,7 +202,7 @@ A prototype can be defined and stored in two ways, either in the database or as
|
|||
|
||||
### Database prototypes
|
||||
|
||||
Stored as [Scripts](Scripts) in the database. These are sometimes referred to as *database-prototypes* This is the only way for in-game builders to modify and add prototypes. They have the advantage of being easily modifiable and sharable between builders but you need to work with them using in-game tools.
|
||||
Stored as [Scripts](./Scripts) in the database. These are sometimes referred to as *database-prototypes* This is the only way for in-game builders to modify and add prototypes. They have the advantage of being easily modifiable and sharable between builders but you need to work with them using in-game tools.
|
||||
|
||||
### Module-based prototypes
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue