Clarify the rplanguage docstring a bit
This commit is contained in:
parent
10952ae47b
commit
ca6456b134
1 changed files with 101 additions and 78 deletions
|
|
@ -17,7 +17,7 @@ in the game in various ways:
|
|||
overhear (for example "s" sounds tend to be audible even when no other
|
||||
meaning can be determined).
|
||||
|
||||
Usage:
|
||||
## Usage
|
||||
|
||||
```python
|
||||
from evennia.contrib import rplanguage
|
||||
|
|
@ -48,15 +48,38 @@ Usage:
|
|||
|
||||
```
|
||||
|
||||
To set up new languages, import and use the `add_language()`
|
||||
helper method in this module. This allows you to customize the
|
||||
"feel" of the semi-random language you are creating. Especially
|
||||
## Custom languages
|
||||
|
||||
To set up new languages, you need to run `add_language()`
|
||||
helper function in this module. The arguments of this function (see below)
|
||||
are used to store the new language in the database (in the LanguageHandler,
|
||||
which is a type of Script).
|
||||
|
||||
If you want to remember the language definitions, you could put them all
|
||||
in a module along with the `add_language` call as a quick way to
|
||||
rebuild the language on a db reset:
|
||||
|
||||
```python
|
||||
# a stand-alone module somewhere under mygame. Just import this
|
||||
# once to automatically add the language!
|
||||
|
||||
from evennia.contrib.rpg.rpsystem import rplanguage
|
||||
grammar = (...)
|
||||
vowels = "eaouy"
|
||||
# etc
|
||||
|
||||
rplanguage.add_language(grammar=grammar, vowels=vowels, ...)
|
||||
```
|
||||
|
||||
The variables of `add_language` allows you to customize the "feel" of
|
||||
the semi-random language you are creating. Especially
|
||||
the `word_length_variance` helps vary the length of translated
|
||||
words compared to the original and can help change the "feel" for
|
||||
the language you are creating. You can also add your own
|
||||
words compared to the original. You can also add your own
|
||||
dictionary and "fix" random words for a list of input words.
|
||||
|
||||
Below is an example of "elvish", using "rounder" vowels and sounds:
|
||||
## Example
|
||||
|
||||
Below is an example module creating "elvish", using "rounder" vowels and sounds:
|
||||
|
||||
```python
|
||||
# vowel/consonant grammar possibilities
|
||||
|
|
@ -115,12 +138,12 @@ Usage:
|
|||
|
||||
"""
|
||||
import re
|
||||
from random import choice, randint
|
||||
from collections import defaultdict
|
||||
from random import choice, randint
|
||||
|
||||
from evennia import DefaultScript
|
||||
from evennia.utils import logger
|
||||
|
||||
|
||||
# ------------------------------------------------------------
|
||||
#
|
||||
# Obfuscate language
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue