Hey, I figured I would open up a thread here instead of just chatting in the main channel as I'm fairly new to Modding Factorio and I at this moment have very little to no knowledge of Lua/FactorioModdingAPI, and I'm sure that I'm going to have a lot of questions during my modding journey for Factorio. I have done some basic modding in the past for Minecraft and more Recently Eco, and have basic understanding of programming, code styles, etc, so I guess beginner level programmer. No college/codecamps, just basic programming classes taken back in high-school. man I miss scratch and KTurtle. Anyways, I Recently have been wanting to get into Factorio Modding, and I figured I would get my IDE setup, Ig VScode is the only one that really works good haha. used Intellij Idea and Visual Studio in the past, with that setup, I'm almost ready to get sat down and start coding. But I'm curious if any of you have any advice for me about the planning stage of my mod, and things I should keep in mind as I design and plan out all the main features and mechanics of my mod. I have rough Idea in mind, inspired by different features or mods I've played with or seen, and I think I have a good end goal of what I want my mod to be about. Anyways I would appreciate any guidance as I progress on my modding journey through Factorio. Thank you in advance.
#Thelian Industries, Overhaul Mod. New to modding, Looking for Guidance.
1 messages · Page 1 of 1 (latest)
@faint escarp Welcome to modding and Have fun! 🙂 since you've never modded Factorio B4 there's only so much planning you can do before actually knowing what and how to do it obviously 😉 but yeah, VSC setup, check the pins, there's a lot of well made guides and docs there.
Since you've going for an "overhaul", you'll probably be hitting the data stage 1st and the control stage much later. The Factorio API is now your best friend https://lua-api.factorio.com/latest/index-prototype.html
#mod-dev-guide has links to all the info. I think it used to be in the pins.
Thanks for the warm welcome. already been looking through the APIDocs a bit, very decent, do you know by chance if anyone has made any youtube video tutorials/guide for modding Factorio? As a visual learner/listener, Looking at code examples combined with videos backing up the Docs Has always been the best way for me to learn anything new coding wise.
Maybe Bilka, I don't know. Doing the modding tutorial helps a bit
On a Side note. I just found Galdoc's manufacturing... lol, it Looks like he is doing what I was looking into making. our ideas are nearly identical.... well theres some things that I would like to try to figure out atleast to be different. maybe later on create the overhaul that depends on his to reduce the headache of reinventing the wheel. and focus on other features that I feel like could be cool to use in game. One mechanic I would like to see and figure out is how to implement mechanical energy as a sort of power stage between burner and electrical. probably a mix of pulleys gears belts pistons or usage of hydraulics either liquid or gas. stuff like that. Tbh atm looking through the API (so far) not sure if thats even possible atm. gotta look at the energy system. also want to redesign how science is created. that should be interesting once i understand how they get the rocket silo to instantly use its own rocket parts etc.
Rocket Silo is it's own kind of building, but you can define others.
Not sure how you were envisioning mechanical energy working, but if it were it's own type of fluid/item, maybe making burner entities that burn that instead of actual burnable fuels might work.
Loaded as one of the BaseEnergySource extensions, based on the value of the type key.
All energy sources must be one of those options, but you can be creative about how you use them, including simply using VoidEnergySource and doing whatever you want in a script... but any custom logic you implement in scripts that run as the game runs you need to be careful about perf, so it's best if you can creatively represent things in terms of existing game mechanics as much as possible.
Yeah i was looking through energysource last night, the way i was thinking of using mechanical energy would be a state of inertia where the energy itself is transfered then consumed, from a fluid, but even with Fluidenergy it just directly consumes instead of using a transfer maybe pumps are the best example of what a potential way to create hydraulics but im not to sure if it can be designed in a way to simulate pressure or inertia. Although I guess I can figure out through the boiler how it turns water into steam I could try to figure out a newer steam system similar to the one found off of COI (captain of Industry) similar to what BobbingAbout does for his steam tiered machines but on a slightly large scale of having different energy states or temps which fairly doable.
yeah im more curious on the way the game uses the silo by inserting LDS RCU RF etc to make the rocket parts that instantly get used in the building of the rocket, that usage I would want to recreate for use in labs to simulate actual scientific researching in a sense, for example im supplying the lab with crude oil either barrels or fluid form, and it uses a bit of the material to simulate the process of discovering the properties or characteristics of crude oil and then through experiments or ingame as crafting time. is how you discover all of that and its applicable uses, and that creates lets rename them to research papers and thats how technology is researched. which should be more doable than the simulated mechanical energy. haha.
You might want to consider looking at Nullius's checkpoints feature. Somewhat different from what you're talking about, but it has "technologies" that you research not by using labs but by crafting/consuming/placing things you've invented.
ooh that sounds interesting. I've seen something like that with the beginning of the seablock pack. ill have to go check out nullius as well.
Instead of mechanical power I might as well as just redesign and expand on power generation instead less headache and still follows vanilla without much altering. more of a COI feel power setup. with different energy states of steam, and instead of being burned it converts to a lower energy state of steam. until depleted then needs to cooled back into water....
So right now im looking at wanting to create a new boiler type of entity that has a recipe selection. but Im not fully sure what would be the best way to do this. I'm thinking I would want to keep factorio's boiler graphics for now as placeholder graphics while I work on adding custom graphics later on. What would be the best way of doing this atm.
to this I have figured out ill probably need to use assembly type. and for the turbines for now i can either use scripting to simulate fluid flow and heat transfer, or i can just which im probably going to do for now. create a turbine for each temperature level of steam
What would be it's inputs and outputs?
3 sets, a burner level, fluid level(like bobs Oil ones) and heat level, that would output steam, but setup as a crafting machine to select recipe of different steam temperatures. to be then used in higher tiered steam engines or turbines. although ive read some where that that doing that is potentially more ups intensive so I think im going to just stick with one of each type of boiler per steam temp level i want. My second issue is then the engines/ turbines. If i want to do what i plan on doing I got to think of a way for me to input steam to a turbine, script in a tank or an infinity pipe invis placed in a way to simulate an ouput fluid box to simulate in a small way of steam does not get used in its entirety and only loses energy simulated in the way of outputing lower temp steam. to then be used in a lower tier steam engine/turbine until I get steam in a low temp (depleted of energy) state thay can then be piped to one of 3 options, a void pump(boring), into a cooling tower that converts it back into a smaller amount of water, or pipe the depleted steam into a reheater boiler(burner/fluid/heat) (Final Name Pending) to be reheated back to a desired temperature to be reused again in a power setup. that second step with the turbines are probably going to be fun to figure out to script, it also has to be dynamic so it only outputs the exact amount of steam currently being consumed to generate power per turbine. which again. is potentially ups intentsive, which is why I've submitted a API Request to add an Output_fluid_box to generatorPrototype on the fourms. If the devs are able to implement such a property with the associated logic to the engine, I think would expand the way you can setup modded power generation to be more diversified around steam generation of electricity.
also I think instead of writing all my boilers etc out by hand I think i could use Util.merge to copy the boiler entity, which is also what Bobbing Did for the Power Mod. although im not sure if thats the best way to do it, its a way after all.
Have a look at the condensing turbine in Space Exploration (I think that's what it's called). Sounds similar to what you're trying to do
huh hadn't seen them yet i will check them out.
as seening that SE is not open source with and their ND clause included in their license , idk if I should look at any code in their mod without asking permission first. is it okay to @ ping Erandal in here for that exact purpose of asking about their condenser turbine?
Don't copy it exactly. Look at how they do it and do something similar
You're unlikely to get a reply from Erandal
ahh that makes more sense yes.
currently getting a traceback error missing type in the following prototype definition {} stack traceback: [C]: in function 'error' __core__/lualib/dataloader.lua:19 in function 'extend' __ti__/prototypes/entity/power/ti-boiler-entity.lua:11: in main chunk in function 'require' __ti__/data/lua:6 in main chunk.
if settings.startup["ti-steam-overhaul"].value == true then
data.raw.boiler.boiler.fast_replaceable_group = "boiler"
data:extend({
util.merge({
data.raw.boiler.boiler,
{
name = "low-energy-boiler",
icon = "__base__/graphics/icons/boiler.png",
icon_size = 64,
minable = { mining_time = 0.5, result = "low-energy-boiler" },
next_upgrade = "med-energy-boiler",
max_health = 200,
target_temperature = 330,
energy_consumption = "3.6MW",
energy_source = {
fuel_category = "combustible-solid-fuels",
emissions_per_minute = 30,
},
},
}),
util.merge({
data.raw.boiler["low-energy-boiler-fluid"],
{
name = "super-energy-boiler-fluid",
icon = "__base__/graphics/icons/boiler.png",
icon_size = 64,
minable = { mining_time = 0.5, result = "super-energy-boiler-fluid" },
max_health = 300,
target_temperature = 825,
energy_consumption = "9MW",
}
}),
})
data.raw.boiler["low-energy-boiler-fluid"].energy_source = {
type = "fluid",
emissions_per_minute = 30,
fluid_box = {
base_area = 1,
height = 2,
base_level = -1,
pipe_connections = {
{type = "input", position = { 0, 1.5}},
},
pipe_covers = pipecoverspictures(),
pipe_picture = assembler2pipepictures(),
production_type = "input",
filter = "combustible-liquid-fuels",
},
burns_fluid = true,
scale_fluid_usage = true,
smoke = {
{
name = "smoke",
north_position = util.by_pixel(-38, -47.5),
south_position = util.by_pixel(38.5, -32),
east_position = util.by_pixel(20, -70),
west_position = util.by_pixel(-19, -8.5),
frequency = 15,
starting_vertical_speed = 0.0,
starting_frame_deviation = 60,
}
},
}
end```
that is the file.
(Use ```lua not just ``` for starting code blocks to get syntax highlighting. EDIT: sorry, apparently that doesn't work on mobile.)
Anyway, have you tried looking at the line in the debugger?
I did use lua. Unless it is case sensitive and need to type Lua
I have not yet for debugger was a bit tired this morning. Haha. .
My edit was because just after writing that I saw a comment in the main channel that the syntax highlighting doesn't show up on mobile and I was on my phone.
ahh yes i just saw that as well.
so After using the bugger, im my data its showing that my last 3 entities are not being written into the data table.
util.merge({
data.raw.boiler.boiler,
{
name = "low-energy-boiler-fluid",
icon = "__base__/graphics/icons/boiler.png",
icon_size = 64,
minable = { mining_time = 0.5, result = "low-energy-boiler-fluid" },
max_health = 300,
target_temperature = 330,
energy_consumption = "3.6MW",
next_upgrade = "med-energy-boiler-fluid",
}
}),
})
data.raw.boiler["low-energy-boiler-fluid"].energy_source = {
type = "fluid",
emissions_per_minute = 30,
fluid_box = {
base_area = 1,
height = 2,
base_level = -1,
pipe_connections = {
{type = "input", position = { 0, 1.5}},
},
pipe_covers = pipecoverspictures(),
pipe_picture = assembler2pipepictures(),
production_type = "input",
filter = "combustible-liquid-fuels",
},
burns_fluid = true,
scale_fluid_usage = true,
smoke = {
{
name = "smoke",
north_position = util.by_pixel(-38, -47.5),
south_position = util.by_pixel(38.5, -32),
east_position = util.by_pixel(20, -70),
west_position = util.by_pixel(-19, -8.5),
frequency = 15,
starting_vertical_speed = 0.0,
starting_frame_deviation = 60,
}
},
}
data:extend({
util.merge({
data.raw.boiler["low-energy-boiler-fluid"],
{
name = "med-energy-boiler-fluid",
icon = "__base__/graphics/icons/boiler.png",
icon_size = 64,
minable = { mining_time = 0.5, result = "med-energy-boiler-fluid" },
max_health = 300,
target_temperature = 495,
energy_consumption = "5.4MW",
next_upgrade = "high-energy-boiler-fluid",
}
}),
``` this is where its at.
okay i think i figured it out.
vanilla boiler is 1.8MW / (.2kJ * 150) = 1.8MW / 30kJ = 60/s
yours is 7.2MW / (.2kJ * 645) = 7.2MW / 129kJ = 55.8/s for reference
I havent uploaded any of my progress for a while, but ive have been busy with some IRL stuff, but been getting back into it a little bit, here and there, I have a few more new power related entities and items created, minus recipes and technologies, but I have also worked on a small GDD plan for the mod as well. I will be trying to post some progress monthly, as im currently busy with college again.
so this is sorta interesting. currently working on migrating what entities I currently have, and im running into this issue. LUA Failed to load mods: Error while loading entity prototype "le-boiler" (boiler): Value must be a number in property tree at ROOT.boiler.le-boiler.energy_source.emissions_per_minute.1 Modifications: Thelian Industries
util.merge({
data.raw.boiler.boiler,
{
name = "le-boiler",
icon = "__base__/graphics/icons/boiler.png",
icon_size = 64,
--localised_description = { "entity-description.le-boiler" },
minable = { mining_time = 0.5, result = "le-boiler" },
next_upgrade = "me-boiler",
max_health = 250,
target_temperature = 215,
energy_consumption = "2.4MW",
fast_replaceable_group = "boiler",
energy_source = {
--fuel_category = "combustible-solid-fuels",
emissions_per_minute = { "pollution", 20},
},
},
}),```
the code now, changed the emmissions to use the new table structure. but still getting the error above.
ohhh, its Lua emissions_per_minute = { pollution = 20},
Well I got everything working and ported to 2.0 for TI. TU will be removing WaterFill and Swimming, and might just add them to the optional dependencies list on the modpack .json and see what pops up.
I'm thinking I might will probably Turn this thread Into the followers and current devs for T.I.M. (Thelian Industries Mod/pack), As since im back in school I want to focus on working on the mod more but realized how much work it will take to get it packaged and deployable in like a year or so. Mostly because I want to have a 2.0 mod version and a version specifically for SA.