Script to extract a map from a save game

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

jbar
Posts: 8
Joined: March 1st, 2006, 5:42 am
Location: France

Script to extract a map from a save game

Post by jbar »

I have make this nice a small but usefull script to extract a map from a saved game.
Specially usefull when u saw a funny map on the wesnoth server : just go in the game (as observatory or player... then save the game and run my script with the name of ur save !)
u can try --help or email me any suggestion (just open the shell script to know who i am).

Have fun, bye.
Attachments
wesnoth_getMapFromSave.gz
gunzip to use my script
(1.1 KiB) Downloaded 307 times
Last edited by jbar on May 5th, 2007, 11:22 am, edited 1 time in total.
jbar
Posts: 8
Joined: March 1st, 2006, 5:42 am
Location: France

here is better version

Post by jbar »

As my script seems to be more usefull than I though I have made some minor improvements and 1 bugs resolving :
-> You don't need to use the -rp option if u like to use the completion to find the saved_game file.
-> The script won't concatenate multiples maps present in the saved_game file.

1 very minor bug is still possible (others data than map at the end of the map), but u are really really unlucky if u meet him.
Attachments
wesnoth_getMapFromSave.gz
version r2 of wesnoth_getMapFromSave script.
(1.15 KiB) Downloaded 367 times
BananaBoat
Posts: 13
Joined: March 5th, 2006, 2:39 pm

Post by BananaBoat »

thank you! it works perfectly, it'd be nice to have this functionality implemented in Wesnoth itself.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Yes, I also thought short about that...
It would be nice if there is a button to start the script in the "load" dialog and then you are asked for a name and it´s saved in the custom maps folder automatically.
First read, then think. Read again, think again. And then post!
WoWHoP
Posts: 2
Joined: April 29th, 2006, 7:36 am

Working Windows Version?

Post by WoWHoP »

Any chance of a working WINDOWS script?
User avatar
Baufo
Inactive Developer
Posts: 1115
Joined: January 29th, 2006, 4:53 pm
Location: Vienna, Austria

Post by Baufo »

WoWHoP wrote:Any chance of a working WINDOWS script?
I've developed one this afternoon.
But it should work everywhere else where you can install Java Runtime Enviroment.

And you will have to install JRE if you have not already done it. Available for free at http://java.sun.com/j2se/1.5.0/download.jsp.

Hope it works (I have tested it on my PC, Windows XP).
Attachments
MapScript.zip
(5.79 KiB) Downloaded 314 times
Last edited by Baufo on June 10th, 2006, 4:51 pm, edited 2 times in total.
I was working on the proof of one of my poems all the morning, and took out a comma. In the afternoon I put it back again. -- Oscar Wilde
User avatar
Baufo
Inactive Developer
Posts: 1115
Joined: January 29th, 2006, 4:53 pm
Location: Vienna, Austria

Post by Baufo »

I have just uploaded an updated version.

Please tell me if the script works. :wink:
I was working on the proof of one of my poems all the morning, and took out a comma. In the afternoon I put it back again. -- Oscar Wilde
kiet
Posts: 155
Joined: February 11th, 2006, 6:56 pm
Location: Sweden,Kungsor
Contact:

Post by kiet »

Sorry to say,but it doesn´t.
It says that Imay have forgotten to turn on the birnary saves in the prefrence menu,which I haven´t.
User avatar
Baufo
Inactive Developer
Posts: 1115
Joined: January 29th, 2006, 4:53 pm
Location: Vienna, Austria

Post by Baufo »

:shock:

Hmm, which System are you using?

And: Have you just turned binary saves off when you read it in the ReadMe file or is the save you tried to load already a text file (Check if you can open it with an ASCII-Editor without seeing confusing Symbols)
I was working on the proof of one of my poems all the morning, and took out a comma. In the afternoon I put it back again. -- Oscar Wilde
User avatar
Baufo
Inactive Developer
Posts: 1115
Joined: January 29th, 2006, 4:53 pm
Location: Vienna, Austria

Post by Baufo »

:oops: :oops: :oops: Oh silly me! :oops: :oops: :oops:
I enterd "enabled" in the Error message!
Of course it should mean "not enabled".

Arrg!
I was working on the proof of one of my poems all the morning, and took out a comma. In the afternoon I put it back again. -- Oscar Wilde
User avatar
Baufo
Inactive Developer
Posts: 1115
Joined: January 29th, 2006, 4:53 pm
Location: Vienna, Austria

Post by Baufo »

Ok I have uploaded a correct version.
Although the old one should (if it was really just the problem that you tried to use a binary file) work correctly.

When I wrote the I coded this in the afternoon I was actually meaning night... :roll:
I was working on the proof of one of my poems all the morning, and took out a comma. In the afternoon I put it back again. -- Oscar Wilde
kiet
Posts: 155
Joined: February 11th, 2006, 6:56 pm
Location: Sweden,Kungsor
Contact:

Post by kiet »

Yep,now it´s working fine.
User avatar
appleide
Posts: 1003
Joined: November 8th, 2003, 10:03 pm
Location: Sydney,OZ

Post by appleide »

Baufo wrote:Ok I have uploaded a correct version.
Although the old one should (if it was really just the problem that you tried to use a binary file) work correctly.

When I wrote the I coded this in the afternoon I was actually meaning night... :roll:
Your script is nice, but seems to be cumbersome... I have to find wesnoth every single time.
Why did the fish laugh? Because the sea weed.
Lord Xerxces
Posts: 13
Joined: July 8th, 2006, 4:16 am
Location: Floyd, VA

This script

Post by Lord Xerxces »

Works perfectly.

Thanks. :lol:
rovanu
Posts: 6
Joined: March 20th, 2006, 5:30 pm

Why do you need a script for?

Post by rovanu »

Why do you need a script for?

If you lookup a save game, you will find the map easily in that file. Just open it with an editor. Than you copy the bits out of the file into a new one. It should look something like:

rrgggggg
ggrrgggg
ggggrrgg
ggggggrr

Copy your new file to userdata/editor/maps/ without restarting Wesnoth you can use the map.

Regards,
Rov.
Post Reply