Reading and writing system files with wesnoth
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Reading and writing system files with wesnoth
Is it possible in WML or Lua to make something like ingame WML files editor? I want to make editor that allows to edit/genearte customized addon template. I konw its better to do it in java for example, but then i need to do reverse enginering and rewite WML parser in java, and update it every time game is updated.
Re: Reading and writing system files with wesnoth
You coudl output wml by persitence wml, that is
[set_global_varaible]
and then copy that wml to the file that you want with an editor.Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Reading and writing system files with wesnoth
If only it was possible from java program to order wesnoth to run specyfic script and to reload some data after it was changed (use it just as backgroud WML parser), your solution could work, but if user have to manage working on 2 programs at once it will miss a point. I want to make editor for low/medium expirienced users. It is supposed to be as simple as possible.
Re: Reading and writing system files with wesnoth
Yes, it is possible. You can build a scenario config file (as input), then use a Java Process to run wesnoth in a nogui mode (search forum for "nogui" to see examples), then wait for it to complete, then load the persisted WML variable (output) into your java program. However, this seems like a very convoluted way of doing things.If only it was possible from java program to order wesnoth to run specyfic script
If you wanted to use Python, you could make use of wmlparser2.py in data/tools/python/.
Or, you could take a look at the other efforts that have been done in the past and try to update and improve them ( Wesnoth User Made Content IDE ).
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: Reading and writing system files with wesnoth
Thanks Sapient. This was informations i needed. I will try to make something like UMC IDE in python. I wonder if there is documentation for wmlparser3.py.