WML files automated modifications

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
pancho
Posts: 9
Joined: September 18th, 2009, 4:05 pm

WML files automated modifications

Post by pancho »

Hello, community!

While was working on my mod for Wesnoth, realized that it will be great if I can perform simple modifications on many WML (units descriptions) files. Can't find anything similar within standard Wesnoth bundle, so created utility named wml_action for this. It can add/replace attributes/macros to tags, add/remove/selective_merge tags.
Example:
Written in ruby. To install:

Code: Select all

gem install wml_action
pancho
Posts: 9
Joined: September 18th, 2009, 4:05 pm

Re: WML files automated modifications

Post by pancho »

Updated with attribute expressions feature.
For example if one want to add 1 to number of attacks of all chaotic units in the game, and prepend their name with Chaotic. One can simply apply this file:

Code: Select all

[unit_type]
  / alignment=chaotic
  name=`"Chaotic ".name`
  [attack]
    number=`number+1`
  [/attack]
[/unit_type]
to all units in the game. And enjoys one's new chaotic Wesnoth.
Post Reply