wesnoth/data/tools
Groggy Dice 746ac09b95 move upconversion of ancient abilities ahead of lifting [frame] to fix problem of weapon specials appearing after [frame] sequence
After my last change, I noticed a puzzling failure by wmllint to convert a weapon special. This special was among some attributes that followed the [frame] sequence. It seems that Python does not wait for the earlier code block to complete before running the new one, and those lines aren't passed through the new block because they've been deleted and stashed in 'postframe'. When they're spewed back out, the new block has already passed those lines by.

I was relieved to find that this was not an issue introduced by my change, but an existing one. When I ran the original wmllint on the file, I found that the special= line got deleted, without being replaced by the [special] tags and macro. The latter is supposed to appear when wmllint hits the [/attack] tag, but never triggers because [/attack] has been changed to [/attack_anim].

Moving this code block up, so that abilities and specials are transformed before the [frame] lift (and 'postframe' stash), appeared to fix the problem. Hopefully, it won't cause a new on to show up.
2013-07-14 21:22:56 -04:00
..
castle-cutter rollback the last wesnoth-optipng commit... 2008-11-02 20:19:45 +00:00
exploder Regularize use of macro formal arguments so we can do better typechecking. 2008-02-10 04:30:18 +00:00
unit_tree another fix needed for the move from gl_ES to gl 2008-06-20 11:06:58 +00:00
wesnoth connect to 1.4 by default 2008-10-04 17:28:12 +00:00
.gitignore adding the macro reference to the ignore list 2007-12-01 11:59:15 +00:00
about_cfg_to_wiki add __NOEDITSECTION__ to credits wiki page, 2007-08-15 13:46:11 +00:00
extractbindings Enrich the editor theme markup for hotkeys by adding a description= attribute. 2008-02-29 21:11:35 +00:00
helpheader.xhtml Typo fix. 2008-02-26 10:29:20 +00:00
helptrailer.xhtml Apply Wesnoth CSS to the generated reference page. 2007-04-18 00:07:13 +00:00
Makefile Use cancrecruit={yes,no} rather than canrecruit={1,0} everywhere, 2008-03-01 08:42:40 +00:00
mk-edges Document mk-edges. 2008-02-09 00:18:30 +00:00
README Add more tools documentation. 2008-02-09 00:24:18 +00:00
scoutDefault.py Add some documentation. 2007-04-06 00:22:22 +00:00
TeamColorizer.pl Move WML-hacking tools from top-level utils directory to data/tools. 2007-04-06 00:02:43 +00:00
terrain2wiki.rb A script to create the "Terrain Table" on the TerrainLettersWML wiki page 2007-08-31 18:28:51 +00:00
wesnoth-mode.el Add Emacs Lisp mode for editing WML. 2007-11-15 13:31:37 +00:00
wmlindent wmllint, wmlscope and wmlindent: fixed bug caused by Windows' command prompt appending double quotes to arguments 2013-06-30 22:02:44 -04:00
wmllint move upconversion of ancient abilities ahead of lifting [frame] to fix problem of weapon specials appearing after [frame] sequence 2013-07-14 21:22:56 -04:00
wmlmove Document a limitation of this script. 2008-02-09 00:07:15 +00:00
wmlscope wmllint, wmlscope and wmlindent: fixed bug caused by Windows' command prompt appending double quotes to arguments 2013-06-30 22:02:44 -04:00

Tools for hacking or generating WML, maps, images, and sounds belong here.
Tools for sanity-checking the mainline campaigns and associated data 
also belong here.

== Scripts ==

=== mk-edges ===

Automatically generate border images for tiles. Works by copying the way in 
which border tiles are done for an existing terrain type.

For instance, if you made a new terrain type, 'lava.png' and you wanted 
to have the same style of edges as snow does, you could run the command

data/tools/mk-edges.pl images/terrain/lava images/terrain/snow

and it will make the edges for you.

=== wmllint ===

This tool lifts WML from older dialects to current and performs sanity checks.
See the header comment of wmllint for a description and invocation options.

=== wmlscope ===

A WML cross-reference checker.  Normally you'll use this to list
unresolved symbols., if any.  See the header comment of wmlscope for a
description and invocation options.

=== wmlmove ===

Use this tool to generate commands that will move a unit between
namespaces; campaign to core, core to campaign, or campaign to
campaign.  See the header comment of wmlmove for a description and
invocation options.

== Python API ==

=== wmltools.py ===

The main facility in this module is a cross-referencer class.  
It also contains utility methods for working with the data tree.
See the header comment of wmtools.py for details

=== wmlparser.py ===

This python module contains code originally developed for CampGen - it contains
a general WML Parser written in Python, just like the Perl one. So if you want
to develop tools in Python instead of Perl and need a WML parser, it may save
some time.

The API currently is very sparsely documented, but I plan to extend this. In
general, wmlparser.py contains the WML Parser, which is used like:

parser = wmlparser.Parser(datapath)

Then:

parser.parse_file(filename)
or
parser.parse_stream(file)
or
parser.parse_text(string)

to set what to parse, and finally:

wmldata = parser.parse()

to read everything into a Python representation of the parsed data.

=== wmldata.py ===

This file has several utility methods defined to access and manipulate
WML data.  Most of them will not be generally useful. An example:

for unit in  wmldata.get_all("unit"):
    print unit.get_text_val("id")

== Standalone use ==

=== wmlparser ===

If called standalone, wmlparser.py will parse whatever you give it and
dump back to stdout. For example:

python wmlparser.py -e {game.cfg} > game.dump

Should produce a nice several 100000 lines file of the complete configuration
with all included files and macros expanded to a single file.