Page 1 of 1

Texturepack toolkit

Posted: Sat Jul 26, 2014 3:53 pm
by y.petremann
You want to make a texture pack for Factorio, you don't want to edit base files and you'd like to be able to install it easily ? Here is the texturepack toolkit, it permit to make a texture pack inside a mod, no need of programming skill.
Files
Create a texture pack
Use a texture pack

Re: Help for making a texturepack script

Posted: Sat Jul 26, 2014 4:00 pm
by FreeER
y.petremann wrote:Does anyone know how to do that ?
none of these are possible as far as I know. sorry

Re: Help for making a texturepack script

Posted: Sat Jul 26, 2014 4:55 pm
by Dark
Done something like that. You can't guess mod's name that you are not aware of and you can't have any read access to the filesystem from game, and I'm not sure why would you need one.
If need to know what textures you have then simply list them in a constant (table), you can also use external script to generate that list.

If you're making a texture pack for another mod then you must know that mod's name in advance (and input it as optional dependency in info.json ), otherwise your pack can load before the other mod and you would not be able to override anything, because by that moment there is nothing yet exists in data.raw.

Re: Help for making a texturepack script

Posted: Sat Jul 26, 2014 6:05 pm
by y.petremann
Dark wrote:Done something like that. You can't guess mod's name that you are not aware of and you can't have any read access to the filesystem from game, and I'm not sure why would you need one.
For now I think I could put the mod name in a constant, it's only to have __mymod__ easily configurable.
Dark wrote:If need to know what textures you have then simply list them in a constant (table), you can also use external script to generate that list.
One of my aim was to generate the two top tables before aplying them so no problem, that really a problem to not have filesystem access because for my case, I simply put files I'm modifying in the graphics folder and would like to not stop factorio from loading because of a missing file.
Dark wrote:If you're making a texture pack for another mod then you must know that mod's name in advance (and input it as optional dependency in info.json ), otherwise your pack can load before the other mod and you would not be able to override anything, because by that moment there is nothing yet exists in data.raw.
I know that but thanks for the advice.

Re: Help for making a texturepack script

Posted: Fri Feb 20, 2015 12:28 am
by y.petremann
For my factocad and updated graphics mods, I have found a lot of things.

Firstly, finding the current mod name (or more precisely mod prefix) is possible ... throught error handling :

Code: Select all

function findmodname()
  local _,errormsg = pcall(function() _G() end)
  return string.sub(errormsg,3,string.find(errormsg, "__/", 3)-1)
end
Secondly we can't verify if a file is present for now, but with the help of some external script to write in a config file a list of files added by the texture pack, this is quite possible. The only thing to consider is that when developing the texture pack mod, you need to execute this utility script before each factorio start or each release, and that config file need to be bundled with the texture pack mod.