best way to update maps on different versions on BfW

The place to post your WML questions and answers.

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.
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

best way to update maps on different versions on BfW

Post by hermestrismi »

Hi,
I don't know if this is on topic or off topic.
if it isn't, I , really sorry
So, is there a way to update maps (and scenarios if ever possible) between different releases of wesnoth?
I mean instead of redesigning them hex by hex and line by line :cry:
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2364
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: best way to update maps on different versions on BfW

Post by Lord-Knightmare »

...
Most maps from 1.12 still work on 1.17 so I dont really see your point here.
Also, if you can run wmllint, you can avoid some removed terrain type errors or most other errors. Most other errors can be wrapped up with a code text editor such as Atom/SublimeText3/VSCode/Notepad++.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: best way to update maps on different versions on BfW

Post by hermestrismi »

I am speaking about BfW 1.2 and 1.8 for example.
I manged to upload RotL from 1.2 to the server of 1.16 but I had to redesign maps
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2364
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: best way to update maps on different versions on BfW

Post by Lord-Knightmare »

https://wiki.wesnoth.org/TerrainCodesWML
The first line here
Note: the old (1.2) terrain system is no longer documented here. If you have 1.2 maps you will need to convert them using wmllint.
Thus, I think wmllint might be able to do the trick.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: best way to update maps on different versions on BfW

Post by hermestrismi »

Lord-Knightmare wrote: April 30th, 2022, 6:46 am https://wiki.wesnoth.org/TerrainCodesWML
The first line here
Note: the old (1.2) terrain system is no longer documented here. If you have 1.2 maps you will need to convert them using wmllint.
Thus, I think wmllint might be able to do the trick.
Thank you very much. I didn't found this wikipage before.
Now, can you go step by step with me (if it is possible) ? I am almost a novice with coding,
I install Python then what exactly?
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2364
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: best way to update maps on different versions on BfW

Post by Lord-Knightmare »

after installing python, I guess you have to open a cmd prompt/terminal/git bash and then navigate to the wesnoth directory (application)
after that cd data/tools/
and python GUI.pyw
which will open the GUI of the tools wmllint, wmlindent, wmlscope and wmlxgettext
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: best way to update maps on different versions on BfW

Post by hermestrismi »

Lord-Knightmare wrote: April 30th, 2022, 8:16 am after installing python, I guess you have to open a cmd prompt/terminal/git bash and then navigate to the wesnoth directory (application)
after that cd data/tools/
and python GUI.pyw
which will open the GUI of the tools wmllint, wmlindent, wmlscope and wmlxgettext
Thank you
So, I installed Python (v 2.7.7), then I opened it and taped the adress of directory

Code: Select all

 C:\Program Files (x86)\Battle for Wesnoth 1.16.2\data 
it gave me kinda

Code: Select all

 error syntax 
I tried other combination including adress to wesnoth 1.2, and my addons files. the same.
I returned to my desktop and opened a windows terminal aka cmd.exe and did the same and I get no valid cmd
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: best way to update maps on different versions on BfW

Post by hermestrismi »

I get the directory instruction from [wiki] https://wiki.wesnoth.org/Editingwesnoth#Windows [/wiki] and [wiki] https://wiki.wesnoth.org/Maintenance_tools#wmllint [/wiki] but it is kinda complicated both
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: best way to update maps on different versions on BfW

Post by hermestrismi »

I m stupid :) I get it
oh no, no stupid. I learn by mistakes.
now I get it
I enter to my directory and then to the data then tools then Gui/pyw then I run it
not via cmd.exe
hhhhhh
thank for teaching me that
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: best way to update maps on different versions on BfW

Post by hermestrismi »

It works. thank you.
but which option do I need for checking about maps ? wmllint, scope or indent? or other?
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2364
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: best way to update maps on different versions on BfW

Post by Lord-Knightmare »

but which option do I need for checking about maps ? wmllint, scope or indent? or other?
just wmllint for that...do normal and then a clean run for it.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: best way to update maps on different versions on BfW

Post by hermestrismi »

wmllint didn't work for the maps even after installing python-enchant (which kept give me the error code

Code: Select all

 WindowsError: [Error 193] 
at the output
This is the beginning of the report

Code: Select all

[C:\Python27\pythonw.exe "C:\Program Files (x86)\Battle for Wesnoth 1.12.5\data\tools\wmllint" --clean "C:\Program Files (x86)\Battle for Wesnoth 1.12.5\data\core"
C:\Python27\pythonw.exe "C:\Program Files (x86)\Battle for Wesnoth 1.12.5\data\tools\wmllint" --dryrun "C:\Program Files (x86)\Battle for Wesnoth 1.12.5\data\core" "C:\Users\aa\Desktop\Nouveau dossier (2)\the_tribe"
C:\Users\aa\Desktop\Nouveau dossier (2)\the_tribe\scenarios\Belmont.cfg, line 45: description=Welt -> id=Welt/
etc,
where Nouveau dossier (2)\the_tribe is the directory I want to transform
then, the check begun successfully (which mean tht all files were corrected) except for maps.
I dont know if it s related to my PC (windows 7 and Trisquel as OS) (since the python ench. didnt work and produce the error msg) or smthg else.
Anyway, I dont want to waste your time more than that so if y didn't encontre the same problem before, don't bother yrself
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2364
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: best way to update maps on different versions on BfW

Post by Lord-Knightmare »

hmm...this is the note on Error 193
If you have received this warning on your PC, it means that there was a malfunction in your system operation. Error code "error 193" is one of the issues that users may get as a result of incorrect or failed installation or uninstallation of software that may have left invalid entries in system elements.
I think Windows 7 is very outdated at this point (since I see windows subtlety hinting me to update to Windows 11) so that might be a reason.

Also, `python-enchant` has nothing to do with this. It's a library for "checking the spellings" of words.
then, the check begun successfully (which mean tht all files were corrected) except for maps.
Actually, I think I found a helpful post for you:
viewtopic.php?p=670297#p670297
which is related to updating maps from 1.2 campaigns/scenarios.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Celtic_Minstrel
Developer
Posts: 2222
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: best way to update maps on different versions on BfW

Post by Celtic_Minstrel »

I don't think wmllint can convert old maps, or at least, not through GUI.pyw. If you can figure out how to use the command line, I believe there's a special version of wmllint that does convert old maps (wmllint-1.4), but it's not available through the GUI since this is an uncommon use-case.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Atreides
Posts: 1075
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: best way to update maps on different versions on BfW

Post by Atreides »

hermestrismi wrote: April 30th, 2022, 9:06 am I m stupid :) I get it
oh no, no stupid. I learn by mistakes.
now I get it
I enter to my directory and then to the data then tools then Gui/pyw then I run it
not via cmd.exe
hhhhhh
thank for teaching me that
DOS has something called a PATH. All it means is that you can run a program that is "in the path" from anywhere else. Otherwise you have to be in the exact directory where the program is to run it.

Without the path I'd have to

D:\GAMES\HARPOON> c:\dos\attrib -a instead of attrib -a
Post Reply