Author Topic: Tileset upate script in Lttp pack  (Read 17985 times)

0 Members and 1 Guest are viewing this topic.

PeterB
  • Newbie
  • *
  • Posts: 37
    • View Profile
Tileset upate script in Lttp pack
« 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>

llamazing

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: Tileset upate script in Lttp pack
« Reply #1 on: August 31, 2019, 02:42:00 PM »
The script gives the following usage example:
Code: [Select]
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.

PeterB
  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Tileset upate script in Lttp pack
« Reply #2 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.

llamazing

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: Tileset upate script in Lttp pack
« Reply #3 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:
Code: [Select]
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:
Code: [Select]
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.

PeterB
  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Tileset upate script in Lttp pack
« Reply #4 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!

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1194
    • View Profile
Re: Tileset upate script in Lttp pack
« Reply #5 on: September 04, 2019, 11:44:38 PM »
The goal of this script is precisely designed to convert all maps easily.

Code: [Select]
lua update_maps_to_rearranged_outside_tilesets maps/*.dat