Solarus-Games English Forum

Solarus => Bugs & Feature requests => Topic started by: PeterB on August 31, 2019, 10:48:45 AM

Title: Tileset upate script in Lttp pack
Post by: PeterB on August 31, 2019, 10:48:45 AM
Hi, does anyone know how to use the update tileset script?

I tried putting the script in the ../data/scripts folder and calling it from the game_manager script but i am getting the below error.

Any ideas, as i can't find any documentation on how to use it?

Error: In on_started: scripts/update_maps_to_rearranged_outside_tilesets.lua:26: attempt to concatenate global 'file_path' (a nil value)
stack traceback:
[C]: in function '__concat'
scripts/update_maps_to_rearranged_outside_tilesets.lua:26: in function 'get_pattern_mapping'
scripts/update_maps_to_rearranged_outside_tilesets.lua:107: in main chunk
[C]: in function 'require'
scripts/game_manager.lua:10: in main chunk
[C]: in function 'require'
scripts/menus/savegames.lua:4: in main chunk
[C]: in function 'require'
main.lua:20: in function <main.lua:9>
Title: Re: Tileset upate script in Lttp pack
Post by: llamazing on August 31, 2019, 02:42:00 PM
The script gives the following usage example:
Usage: lua update_maps_to_rearranged_outside_tilesets.lua quest_path map_file_1.dat ...

I think it is not meant to be run from within Solarus. Try opening a terminal and entering the above line. And definitely make a backup of your files first.
Title: Re: Tileset upate script in Lttp pack
Post by: PeterB on August 31, 2019, 10:36:42 PM
Ok, thanks for the reply. I am struggling to figure out what to put in for "quest_path map_file_1.dat"?

Is quest_path where my data folder is or where my maps folder is??

And do i need to input every map file name here instead of "map_file_1.dat"??

Sorry, just starting on my lua learning journey.
Title: Re: Tileset upate script in Lttp pack
Post by: llamazing on September 01, 2019, 04:37:05 PM
hmm... looking into it some more it seem that the usage example given is wrong. From the code it looks like it just wants:
lua update_maps_to_rearranged_outside_tilesets.lua full_path_to_map_file_1.dat full_path_to_map_file_2.dat

where it is simply calling:
io.open("full_path_to_map_file_1.dat")
io.open("full_path_to_map_file_2.dat")
etc...


So yes, you have to specify the full path to a map (including the map file itself) and you have to input it for ever map you want to convert.
Title: Re: Tileset upate script in Lttp pack
Post by: PeterB on September 04, 2019, 10:46:06 PM
Ok thanks llamazing. Sounds like a bit to much trouble for me as I have over 300 maps in my game.

Perhaps i wont be doing this anytime soon and will stick to my large ffomega tileset!
Title: Re: Tileset upate script in Lttp pack
Post by: Christopho on September 04, 2019, 11:44:38 PM
The goal of this script is precisely designed to convert all maps easily.

lua update_maps_to_rearranged_outside_tilesets maps/*.dat