[Solved]How to get started /w modding? (small graphical mod)
[Solved]How to get started /w modding? (small graphical mod)
Okay, so I have 0 experience with factorio modding. How do I get started?
Seeing as I have no experience with this, I wanted to do a very limited, simple mod... or fail and be very humble about it.
What I want to do?
I want to actually make this underground belt change so it looks visually different and doesn´t block the view of one side of the belt.
viewtopic.php?f=80&t=32665
The behavior of the belts would not change so Im hoping I could do this mostly by just editing sprites.
What do I need to know:
What file contains the graphical elements of underground belts?
what format are the pictures and how to edit these files?
How does the game handle transparency of sprites?
Are the files compressed in some container file that needs to be processed before it can be edited and how to compress them back after editing?
Is there some factorio-specific tools that I will need?
general mod questions
How to implement a dummy mod in simplest way that just changes a few sprites, no behavior/functional changes to the game whatsoever?
Do I just make a new directory and where and put files there?
How do I make the game know that this mod is there?
Do I need to include files other than the edited pictures of the underground belts?
Am I too stupid to do this?
Seeing as I have no experience with this, I wanted to do a very limited, simple mod... or fail and be very humble about it.
What I want to do?
I want to actually make this underground belt change so it looks visually different and doesn´t block the view of one side of the belt.
viewtopic.php?f=80&t=32665
The behavior of the belts would not change so Im hoping I could do this mostly by just editing sprites.
What do I need to know:
What file contains the graphical elements of underground belts?
what format are the pictures and how to edit these files?
How does the game handle transparency of sprites?
Are the files compressed in some container file that needs to be processed before it can be edited and how to compress them back after editing?
Is there some factorio-specific tools that I will need?
general mod questions
How to implement a dummy mod in simplest way that just changes a few sprites, no behavior/functional changes to the game whatsoever?
Do I just make a new directory and where and put files there?
How do I make the game know that this mod is there?
Do I need to include files other than the edited pictures of the underground belts?
Am I too stupid to do this?
Last edited by Mendel on Mon Sep 19, 2016 4:23 am, edited 1 time in total.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: How to get started with modding? (small graphical mod)
You'll need a mod with a `data.lua` that changes the underground belts to use different sprites.
To do that access the relevant underground belt via `data.raw`, for example:
They are all similar structure, this is what the normal belt settings look like:
So you could change the path to the graphics file like so:
Then just provide the revised graphic in that folder. Hope that helps.
To do that access the relevant underground belt via `data.raw`, for example:
Code: Select all
-- in your data.lua
local belts = data.raw['underground-belt']
local normal = belts['underground-belt']
local express = belts['express-underground-belt']
local fast = belts['fast-underground-belt']
Code: Select all
{
animation_speed_coefficient = 32,
belt_horizontal = nil,
belt_vertical = nil,
collision_box = {
{
-0.40000000000000002,
-0.40000000000000002
},
{
0.40000000000000002,
0.40000000000000002
}
},
corpse = "small-remnants",
ending_bottom = nil,
ending_patch = nil,
ending_side = nil,
ending_top = nil,
fast_replaceable_group = "underground-belt",
flags = {
"placeable-neutral",
"player-creation",
"fast-replaceable-no-build-while-moving"
},
icon = "__base__/graphics/icons/underground-belt.png",
max_distance = 5,
max_health = 60,
minable = {
hardness = 0.20000000000000001,
mining_time = 0.5,
result = "underground-belt"
},
name = "underground-belt",
resistances = {
{
percent = 60,
type = "fire"
}
},
selection_box = {
{
-0.5,
-0.5
},
{
0.5,
0.5
}
},
speed = 0.03125,
starting_bottom = nil,
starting_side = nil,
starting_top = nil,
structure = {
direction_in = {
sheet = {
filename = "__base__/graphics/entity/underground-belt/underground-belt-structure.png",
height = 43,
priority = "extra-high",
shift = {
0.26000000000000001,
0
},
width = 57,
y = 43
}
},
direction_out = {
sheet = {
filename = "__base__/graphics/entity/underground-belt/underground-belt-structure.png",
height = 43,
priority = "extra-high",
shift = {
0.26000000000000001,
0
},
width = 57
}
}
},
type = "underground-belt",
underground_sprite = {
filename = "__core__/graphics/arrows/underground-lines.png",
height = 64,
priority = "high",
scale = 0.5,
width = 64,
x = 64
}
}
Code: Select all
-- in your data.lua
normal.structure.direction_out.sheet.filename = '__YourModName__/graphics/underground-belt-structure.png'
Last edited by aubergine18 on Sun Sep 18, 2016 7:49 pm, edited 1 time in total.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: How to get started with modding? (small graphical mod)
There's a modding tutorial here that shows the folder structure, files, etc. All you really need is the info.json, the data.lua and your custom graphic.
Code: Select all
YourMod_0.0.1/
|
+- info.json
+- data.lua
|
+- graphics/
|
+- underground-belt-structure.png
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: How to get started with modding? (small graphical mod)
Thank you so much so far!
However, it just struck me that belts are of course animated. So this is a bit of an added complexity. (animated png makes me scratch head)
That said, if I can even make some kind of visible change, that will be a good start, I will return with more questions once I have any kind of progress
However, it just struck me that belts are of course animated. So this is a bit of an added complexity. (animated png makes me scratch head)
That said, if I can even make some kind of visible change, that will be a good start, I will return with more questions once I have any kind of progress
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: How to get started with modding? (small graphical mod)
forgot link to modding tutorial: https://wiki.factorio.com/index.php?tit ... g_Tutorial
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: How to get started with modding? (small graphical mod)
well I encountered an error I cant seem to figure out:
contents of my data.lua
contents of my info.json
also there is a file C:\Users\Mendel\AppData\Roaming\Factorio\mods\ubeltmagic_0.1.1\Graphics\underground-belt\ubeltmagic.png
Upon trying to start the game I get this: "path __ubeltmagic_0.1.1__/Graphics/underground-belt/ubeltmagic.png does not match any mod"
Maybe I understood this wrong and I need to add that whole belt settings part somewhere too?
contents of my data.lua
Code: Select all
local belts = data.raw['underground-belt']
local normal = belts['underground-belt']
local express = belts['express-underground-belt']
local fast = belts['fast-underground-belt']
normal.structure.direction_out.sheet.filename = '__ubeltmagic_0.1.1__/Graphics/underground-belt/ubeltmagic.png'
Code: Select all
{
"name": "ubeltmagic",
"version": "0.1.1",
"factorio_version": "0.14",
"title": "Underground belt graphical mod",
"author": "Mendel",
"contact": "https://forums.factorio.com/forum/",
"homepage": "https://forums.factorio.com/forum/",
"description": "Mod that makes underground belt visible on one belt side"
}
Upon trying to start the game I get this: "path __ubeltmagic_0.1.1__/Graphics/underground-belt/ubeltmagic.png does not match any mod"
Maybe I understood this wrong and I need to add that whole belt settings part somewhere too?
Re: How to get started with modding? (small graphical mod)
Based on that error message, I guess you need to use
(without 0.1.1)
Code: Select all
'__ubeltmagic__/Graphics/underground-belt/ubeltmagic.png'
Re: How to get started with modding? (small graphical mod)
That did the trick!
And to my amazement it actually works like intended! the game somehow automatically adds the belt parts under the transparent parts of the underground belt entity.
http://images.akamai.steamusercontent.c ... 458EB5308/
todo:
repeat edit for fast and express belt
release in workshop (how?)
And to my amazement it actually works like intended! the game somehow automatically adds the belt parts under the transparent parts of the underground belt entity.
http://images.akamai.steamusercontent.c ... 458EB5308/
todo:
repeat edit for fast and express belt
release in workshop (how?)
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: How to get started with modding? (small graphical mod)
To release in mod portal, you just log in to mods.factorio.com (login link in top-right corner of that page - note: different login to your forum login, it think mods site uses the account you bought game with) and then upload your mod.
I did very short tutorial with some infos that might be of help: viewtopic.php?f=189&t=32664
I did very short tutorial with some infos that might be of help: viewtopic.php?f=189&t=32664
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: How to get started with modding? (small graphical mod)
edit out: (didnt find all the necessary files)
actually no, wait, Im an idiot. just found the other files under their respective folders
actually no, wait, Im an idiot. just found the other files under their respective folders
Re: How to get started with modding? (small graphical mod)
The grass shines through on one of them, it's not ready yet
Last edited by Zeblote on Sun Sep 18, 2016 9:48 pm, edited 1 time in total.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: How to get started with modding? (small graphical mod)
They are in different folders in the base mod:
__base__/graphics/entity/fast-underground-belt/fast-underground-belt-structure.png
__base__/graphics/entity/express-underground-belt/express-underground-belt-structure.png
__base__/graphics/entity/underground-belt/underground-belt-structure.png
You could just have 3 files in your graphics folder, one for each of the belts.
__base__/graphics/entity/fast-underground-belt/fast-underground-belt-structure.png
__base__/graphics/entity/express-underground-belt/express-underground-belt-structure.png
__base__/graphics/entity/underground-belt/underground-belt-structure.png
You could just have 3 files in your graphics folder, one for each of the belts.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: How to get started with modding? (small graphical mod)
zeblote: true! Small tweaking to commence!
Re: How to get started with modding? (small graphical mod)
aaaand its released!
https://mods.factorio.com/mods/Mendeli/ubeltmagic
Well, first version anyways!
Thanks for the help!
I would appreciate if someone tested this too
https://mods.factorio.com/mods/Mendeli/ubeltmagic
Well, first version anyways!
Thanks for the help!
I would appreciate if someone tested this too