Complete reshuffling of contribs. Not moved tests
This commit is contained in:
parent
0ab1c30716
commit
a6cb94056c
27 changed files with 552 additions and 29 deletions
35
evennia/contrib/tutorials/batchprocessor/README.md
Normal file
35
evennia/contrib/tutorials/batchprocessor/README.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# Batch processor examples
|
||||
|
||||
Contibution - Griatch 2012
|
||||
|
||||
The batch processor is used for generating in-game content from one or more
|
||||
static files. Files can be stored with version control and then 'applied'
|
||||
to the game to create content.
|
||||
|
||||
There are two batch processor types:
|
||||
|
||||
- Batch-cmd processor: A list of `#`-separated Evennia commands being executed
|
||||
in sequence, such as `create`, `dig`, `north` etc. When running a script
|
||||
of this type (filename ending with `.ev`), the caller of the script will be
|
||||
the one performing the script's actions.
|
||||
- Batch-code processor: A full Python script (filename ending with `.py` that
|
||||
executes Evennia api calls to build, such as `evennia.create_object` or
|
||||
`evennia.search_object` etc. It can be divided up into comment-separated
|
||||
chunks so one can execute only parts of the script at a time (in this way it's
|
||||
a little different than a normal Python file).
|
||||
|
||||
## Usage
|
||||
|
||||
To test the two example batch files, you need `Developer` or `superuser`
|
||||
permissions, be logged into the game and run of
|
||||
|
||||
> batchcommand/interactive tutorials.batchprocessor.example_batch_cmds
|
||||
> batchcode/interactive tutorials.batchprocessor.example_batch_code
|
||||
|
||||
The `/interactive` drops you in interactive mode so you can follow along what
|
||||
the scripts do. Skip it to build it all at once.
|
||||
|
||||
Both commands produce the same results - they create a red-button object,
|
||||
a table and a chair. If you run either with the `/debug` switch, the objects will
|
||||
be deleted afterwards (for quick tests of syntax that you don't want to spam new
|
||||
objects, for example).
|
||||
4
evennia/contrib/tutorials/batchprocessor/__init__.py
Normal file
4
evennia/contrib/tutorials/batchprocessor/__init__.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
"""
|
||||
Batch processing examples - Griatch 2012
|
||||
|
||||
"""
|
||||
16
evennia/contrib/tutorials/bodyfunctions/README.md
Normal file
16
evennia/contrib/tutorials/bodyfunctions/README.md
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Script example
|
||||
|
||||
Griatch - 2012
|
||||
|
||||
Example script for testing. This adds a simple timer that has your
|
||||
character make observations and notices at irregular intervals.
|
||||
|
||||
To test, use (in game)
|
||||
|
||||
> script me = contrib.tutorials.bodyfunctions.BodyFunctions
|
||||
|
||||
## Notes
|
||||
|
||||
Use `scripts me` to see the script running on you. Note that even though
|
||||
the timer ticks down to 0, you will _not_ see an echo every tick (it's
|
||||
random if an echo is given on a tick or not).
|
||||
6
evennia/contrib/tutorials/bodyfunctions/__init__.py
Normal file
6
evennia/contrib/tutorials/bodyfunctions/__init__.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
"""
|
||||
Bodyfunctions example script - Griatch, 2012
|
||||
|
||||
"""
|
||||
|
||||
from .bodyfunctions import BodyFunctions # noqa
|
||||
|
|
@ -1,9 +1,13 @@
|
|||
"""
|
||||
Script example
|
||||
|
||||
Griatch - 2012
|
||||
|
||||
Example script for testing. This adds a simple timer that has your
|
||||
character make observations and notices at irregular intervals.
|
||||
|
||||
To test, use
|
||||
@script me = tutorial_examples.bodyfunctions.BodyFunctions
|
||||
script me = tutorial_examples.bodyfunctions.BodyFunctions
|
||||
|
||||
The script will only send messages to the object it is stored on, so
|
||||
make sure to put it on yourself or you won't see any messages!
|
||||
|
|
@ -16,6 +20,7 @@ from evennia import DefaultScript
|
|||
class BodyFunctions(DefaultScript):
|
||||
"""
|
||||
This class defines the script itself
|
||||
|
||||
"""
|
||||
|
||||
def at_script_creation(self):
|
||||
34
evennia/contrib/tutorials/red_button/README.md
Normal file
34
evennia/contrib/tutorials/red_button/README.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Red Button example
|
||||
|
||||
Griatch - 2011
|
||||
|
||||
This is a more advanced example object with its own functionality (commands)
|
||||
on it.
|
||||
|
||||
Create the button with
|
||||
|
||||
create/drop button:tutorials.red_button.RedButton
|
||||
|
||||
Note that you must drop the button before you can see its messages! It's
|
||||
imperative that you press the red button. You know you want to.
|
||||
|
||||
Use `del button` to destroy/stop the button when you are done playing.
|
||||
|
||||
## Technical
|
||||
|
||||
The button's functionality is controlled by CmdSets that gets added and removed
|
||||
depending on the 'state' the button is in.
|
||||
|
||||
- Lid-closed state: In this state the button is covered by a glass cover and
|
||||
trying to 'push' it will fail. You can 'nudge', 'smash' or 'open' the lid.
|
||||
- Lid-open state: In this state the lid is open but will close again after a
|
||||
certain time. Using 'push' now will press the button and trigger the
|
||||
Blind-state.
|
||||
- Blind-state: In this mode you are blinded by a bright flash. This will affect
|
||||
your normal commands like 'look' and help until the blindness wears off after
|
||||
a certain time.
|
||||
|
||||
Timers are handled by persistent delays on the button. These are examples of
|
||||
`evennia.utils.utils.delay` calls that wait a certain time before calling a
|
||||
method - such as when closing the lid and un-blinding a character.
|
||||
|
||||
6
evennia/contrib/tutorials/red_button/__init__.py
Normal file
6
evennia/contrib/tutorials/red_button/__init__.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
"""
|
||||
Tutorial Red Button Object - Griatch 2011
|
||||
|
||||
"""
|
||||
|
||||
from .red_button import RedButton # noqa
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
"""
|
||||
Red Button
|
||||
|
||||
Griatch - 2011
|
||||
|
||||
This is a more advanced example object. It combines functions from
|
||||
script.examples as well as commands.examples to make an interactive
|
||||
|
|
@ -6,14 +9,14 @@ button typeclass.
|
|||
|
||||
Create this button with
|
||||
|
||||
create/drop red_button.RedButton
|
||||
create/drop tutorials.red_button.RedButton
|
||||
|
||||
Note that you must drop the button before you can see its messages!
|
||||
|
||||
## Technical
|
||||
|
||||
The button's functionality is controlled by CmdSets that gets added and removed
|
||||
depending on the 'state' the button is in.
|
||||
depending on the 'state' the button is in.
|
||||
|
||||
- Lid-closed state: In this state the button is covered by a glass cover and trying
|
||||
to 'push' it will fail. You can 'nudge', 'smash' or 'open' the lid.
|
||||
21
evennia/contrib/tutorials/talking_npc/README.md
Normal file
21
evennia/contrib/tutorials/talking_npc/README.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Talkative NPC example
|
||||
|
||||
Contribution - Griatch 2011, grungies1138, 2016
|
||||
|
||||
This is a static NPC object capable of holding a simple menu-driven
|
||||
conversation. It's just meant as an example.
|
||||
|
||||
## Installation
|
||||
|
||||
Create the NPC by creating an object of typeclass `contrib.tutorials.talking_npc.TalkingNPC`,
|
||||
For example:
|
||||
|
||||
create/drop John : contrib.tutorials.talking_npc.TalkingNPC
|
||||
|
||||
Use `talk` in the same room as the NPC to start a conversation.
|
||||
|
||||
If there are many talkative npcs in the same room you will get to choose which
|
||||
one's talk command to call (Evennia handles this automatically).
|
||||
|
||||
This use of EvMenu is very simplistic; See EvMenu for a lot more complex
|
||||
possibilities.
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Evennia Tutorial World
|
||||
|
||||
Griatch 2011, 2015
|
||||
|
|
@ -10,30 +9,33 @@ herein are designed to show off features of the engine, not to be a
|
|||
very challenging (nor long) gaming experience. As such it's of course
|
||||
only skimming the surface of what is possible.
|
||||
|
||||
The tutorial world also includes a game tutor menu example, exemplifying
|
||||
Evmenu.
|
||||
|
||||
## Install
|
||||
## Installation
|
||||
|
||||
Log in as superuser (#1), then run
|
||||
|
||||
@batchcommand tutorial_world.build
|
||||
batchcommand tutorials.tutorial_world.build
|
||||
|
||||
Wait a little while for building to complete and don't run the command
|
||||
again. This should build the world and connect it to Limbo.
|
||||
again even if it's slow. This builds the world and connect it to Limbo
|
||||
and creates a new exit `tutorial`.
|
||||
|
||||
If you are a superuser (User `#1`), use the `@quell` command to play
|
||||
the tutorial as intended.
|
||||
If you are a superuser (User `#1`), use the `quell` command to play
|
||||
the tutorial as intended.
|
||||
|
||||
|
||||
## Comments
|
||||
|
||||
The tutorial world is intended for your playing around with the engine.
|
||||
It will help you learn how to accomplish some more advanced effects
|
||||
and might give some good ideas along the way.
|
||||
The tutorial world is intended to be explored and analyzed. It will help you
|
||||
learn how to accomplish some more advanced effects and might give some good
|
||||
ideas along the way.
|
||||
|
||||
It's suggested you play it through (as a normal user, NOT as
|
||||
Superuser!) and explore it a bit, then come back here and start
|
||||
looking into the (heavily documented) build/source code to find out
|
||||
how things tick - that's the "tutorial" in Tutorial world after all.
|
||||
It's suggested you play it through (as a normal user, NOT as Superuser!) and
|
||||
explore it a bit, then come back here and start looking into the (heavily
|
||||
documented) build/source code to find out how things tick - that's the
|
||||
"tutorial" in Tutorial world after all.
|
||||
|
||||
Please report bugs in the tutorial to the Evennia issue tracker.
|
||||
|
||||
|
|
@ -50,6 +52,7 @@ tutorial game**
|
|||
|
||||
|
||||
|
||||
|
||||
## Tutorial World Room map
|
||||
|
||||
?
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
This package holds the demo game of Evennia.
|
||||
Tutorial world - Griatch, 2011, 2015
|
||||
|
||||
"""
|
||||
|
||||
|
||||
from . import mob, objects, rooms
|
||||
from . import mob, objects, rooms # noqa
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
# To load this file, place yourself in Limbo (room #2) and load the
|
||||
# file as user #1 with
|
||||
#
|
||||
# @batchcommand contrib.tutorial_world.build
|
||||
# batchcommand contrib.tutorials.tutorial_world.build
|
||||
#
|
||||
# If you give the /interactive switch you can step through the
|
||||
# build process command for command.
|
||||
|
|
@ -285,7 +285,7 @@ start
|
|||
#
|
||||
@set sign/tutorial_info =
|
||||
This is a readable object, of the Typeclass
|
||||
evennia.contrib.tutorial_world.objects.TutorialReadable. The sign has a cmdset
|
||||
evennia.contrib.tutorials.tutorial_world.objects.TutorialReadable. The sign has a cmdset
|
||||
defined on itself, containing only one command, namely 'read'. This
|
||||
command is what allows you to 'read sign'. Doing so returns the
|
||||
contents of the Attribute 'readable_sign', containing the information
|
||||
|
|
@ -488,7 +488,7 @@ north
|
|||
#
|
||||
bridge
|
||||
#
|
||||
# Set up properties on bridge room (see contrib.tutorial_world.rooms.BridgeRoom)
|
||||
# Set up properties on bridge room (see contrib.tutorials.tutorial_world.rooms.BridgeRoom)
|
||||
#
|
||||
# connect west edge to cliff
|
||||
#
|
||||
|
|
@ -1363,7 +1363,7 @@ The prize you have been looking for!
|
|||
what can be done with Evennia. The tutorial focuses more on showing
|
||||
various techniques than to supply any sort of novel storytelling or
|
||||
gaming challenge. The full README and source code for the tutorial
|
||||
world can be found under |wcontrib/tutorial_world|g.
|
||||
world can be found under |wcontrib/tutorials/tutorial_world|g.
|
||||
|
||||
|
||||
If you went through the tutorial quest once, it can be interesting to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue