Texturepack toolkit

Place to get help with not working mods / modding interface.
User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 421
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Texturepack toolkit

Post 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
Last edited by y.petremann on Fri Feb 20, 2015 9:05 am, edited 5 times in total.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Help for making a texturepack script

Post by FreeER »

y.petremann wrote:Does anyone know how to do that ?
none of these are possible as far as I know. sorry
Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

Re: Help for making a texturepack script

Post 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.
User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 421
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: Help for making a texturepack script

Post 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.
User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 421
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: Help for making a texturepack script

Post 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.
Post Reply

Return to “Modding help”