0

Updated documentation

* Added paragraph and example about returning tuples from a filter
  (Issue #859)

* Added section about manualpois
  (Issue #858, Issue #869, Issue #598)

* Fixed a typo in the FAQ

* Added logging to file to the FAQ
  (Issue #871)
This commit is contained in:
Nicolas Frattaroli
2013-01-21 18:13:50 +01:00
parent a5ee1b68ba
commit ae5e146eff
2 changed files with 84 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ of the following:
Map expansions double the width and height of the map, so you will eventually
hit a map size that is unlikely to need another level.
You've added a few feature or changed textures, but it's not showing up on my map!
You've added a new feature or changed textures, but it's not showing up on my map!
----------------------------------------------------------------------------------
Some new features will only show up in newly-rendered areas. Use the
@@ -91,6 +91,21 @@ If you are seeing exorbitant memory usage, then it is likely either a bug or a
subtly corrupted world. Please file an issue or come talk to us on IRC so we can
take a look! See :ref:`help`.
How can I log The Overviewer's output to a file?
------------------------------------------------
If you are on a UNIX-like system like MacOSX or Linux, you can use shell redirection
to write the output into a file::
overviewer.py --config=myconfig.py > renderlog.log 2>&1
What this does is redirect the previous commands standard output to the file "renderlog.log",
and redirect the standard error to the standard output. The file will be overwritten each time
you run this command line; to simply append the output to the file, use two greater than signs::
overviewer.py --config=myconfig.py >> renderlog.log 2>&1
.. _cropping_faq:
I've deleted some sections of my world but they still appear in the map

View File

@@ -47,6 +47,13 @@ A more complicated filter function can construct a more customized display text:
if poi['id'] == "Chest":
return "Chest with %d items" % len(poi['Items'])
It is also possible to return a tuple from the filter function to specify a hovertext
different from the text displayed in the info window. The first entry of the tuple will
be used as the hover text, the second will be used as the info window content::
def chestFilter(poi):
if poi['id'] == "Chest":
return ("Chest", "Chest with %d items" % len(poi['Items']))
Since writing these filters can be a little tedious, a set of predefined filters
functions are provided. See the :ref:`predefined_filter_functions` section for
@@ -81,6 +88,67 @@ Here's an example that displays icons for each player::
Note how each POI can get a different icon by setting ``poi['icon']``
Manual POIs
-----------
It is also possible to manually define markers. Each render can have a render dictionary key
called ``manualpois``, which is a list of dicts. Each dict represents a marker, and is required
to have at least the attributes ``x``, ``y``, ``z`` and ``id``, with the coordinates being Minecraft
world coordinates. (i.e. what you see in-game when you press F3)
An example which adds two POIs with the id "town", and then uses a filter function to filter for them::
def townFilter(poi):
if poi['id'] == 'Town':
return poi['name']
renders['myrender'] = {
'world':'myworld',
'title':'Example',
'manualpois':[
{'id':'Town',
'x':200,
'y':64,
'z':200,
'name':'Foo'},
{'id':'Town',
'x':-300,
'y':85,
'z':-234,
'name':'Bar'}],
'markers': [dict(name="Towns", filterFunction=townFilter, icon="town.png")],
}
Here is a more complex example where not every marker of a certain id has a certain key::
def townFilter(poi):
if poi['id'] == 'Town':
try:
return (poi['name'], poi['description'])
except KeyError:
return poi['name'] + '\n'
renders['myrender'] = {
'world':'myworld',
'title':'Example',
'manualpois':[
{'id':'Town',
'x':200,
'y':64,
'z':200,
'name':'Foo',
'description':'Best place to eat hamburgers'},
{'id':'Town',
'x':-300,
'y':85,
'z':-234,
'name':'Bar'}],
'markers': [dict(name="Towns", filterFunction=townFilter, icon="town.png")],
}
Render Dictionary Key
---------------------