[MOD 0.16] Diesel Locomotive

Topics and discussion about specific mods
FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 389
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by FuryoftheStars »

BlueTemplar wrote: ↑
Mon Jul 29, 2019 7:39 pm
Heh, looks like that this is pretty much what I was asking for !
(Not sure why I missed it before, as it's not the first time that I looks into that file...)
BlueTemplar wrote: ↑
Sat Jul 13, 2019 12:17 pm
It really sounds like these fuel values should be handled by vanilla...
[...]

Or at least it should be a "community" mod, like https://mods.factorio.com/mod/stdlib
Possibly. Only catch is that I'd then have to sort through the fluids, find ones that should be considered as "invalid" for this mod (like steam, water, etc), and then override their values when going into the locomotive. I think this may be more tedious as other mods add different fluids that could potentially be used as fuel in something.

User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by Shenpen »

I'm really just trying to learn about compatibilities, how to integrate and make my mod a useful part of the Factorio world.

This is a challenge from the technical perspective but also in finding the right balance in terms of friendly behavior towards everybody else in the community. So I'm really just trying to find my feet as to what is possible and what not.

FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 389
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by FuryoftheStars »

Shenpen wrote: ↑
Mon Jul 29, 2019 8:34 pm
I'm really just trying to learn about compatibilities, how to integrate and make my mod a useful part of the Factorio world.

This is a challenge from the technical perspective but also in finding the right balance in terms of friendly behavior towards everybody else in the community. So I'm really just trying to find my feet as to what is possible and what not.
Oh, you're good. I'm actually working on another mod that modifies other mods as well. :)

Here, I think you need something like this (code is untested).

In info.json:

Code: Select all

"dependencies": ["?Diesel-Locomotive >= 0.2.3"]
And then in data-final-fixes.lua:

Code: Select all

if mods["Diesel-Locomotive"] then
	local diesellocokerosene = data.raw["item"]["Diesel-Locomotive-kerosene"]
	diesellocokerosene.fuel_value = "1MJ" -- Modify as desired
	diesellocokerosene.fuel_acceleration_multiplier = 1 -- Modify as desired
	diesellocokerosene.fuel_top_speed_multiplier = 1 -- Modify as desired
end
I think that should do it, but only if the user of the diesel locomotive mod leaves the valid fuel types setting on the default "Both heavy and light oil" option.

Sorry, sometimes my understanding of what's being done starts off wrong, then as it slowly dawns on me I go back and make corrections as I'm typing and sometimes the whole post can wind up a mess. :)

User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by Shenpen »

["?Diesel-Locomotive
The questionmark makes it a soft dependency?


User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by Shenpen »

diesellocokerosene
There is also a balance regarding other uses. The main use for kerosine is actually as a solvent for cocaine production...
Which is why I hesitate about renaming it a loco-fuel...

User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by Shenpen »

I think I will find a way to "change" the main kerosine into a loco fuel. If I had lead I would process the kerosine with lead to make a loco-fuel.
As it happens I dont have any lead, but perhaps I can add some other additive.

FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 389
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by FuryoftheStars »

Note that this does not modify your kerosene fluid. The diesel locomotive mod creates items (similar in nature to solid fuel) that are reresentative of all fluids in the game. These items are what are actually consumed by the locomotive (not the fluid) and thus the change in the code example is to the representative item of kerosene, not the actual fluid.

slippycheeze
Filter Inserter
Filter Inserter
Posts: 587
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by slippycheeze »

Shenpen wrote: ↑
Mon Jul 29, 2019 9:01 pm
["?Diesel-Locomotive
The questionmark makes it a soft dependency?
Which, specifically, makes sure that *if* it is installed, the dependency mod will be loaded *before* your mod is loaded, and all the data stuff will run in there first. If you don't need that ordering you can also check out the list of loaded mods via the in-game objects to figure that out.

PurityLegion
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Sep 23, 2019 6:21 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by PurityLegion »

Hi, I'm not sure if your still activly working on the 0.16 Factorio version of this mod but. I have a Mod Conflict to Report, When You use Pressurized Fluids It Has an issue with A Fluid It creates. Here's a imgur of the Error on Factorio Startup. https://imgur.com/a/3OXunmj

Here's the Links to the Mods Involved:
https://mods.factorio.com/mod/Diesel-Locomotive

https://mods.factorio.com/mod/CompressedFluids

Im Not Sure which Mod is at fault, But I have posted a Bug Report on both mods pages.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2810
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by Optera »

PurityLegion wrote: ↑
Mon Sep 23, 2019 6:45 pm
Hi, I'm not sure if your still activly working on the 0.16 Factorio version of this mod but. I have a Mod Conflict to Report, When You use Pressurized Fluids It Has an issue with A Fluid It creates. Here's a imgur of the Error on Factorio Startup. https://imgur.com/a/3OXunmj

Here's the Links to the Mods Involved:
https://mods.factorio.com/mod/Diesel-Locomotive

https://mods.factorio.com/mod/CompressedFluids

Im Not Sure which Mod is at fault, But I have posted a Bug Report on both mods pages.
That's a sloppy written fluid parser in Diesel Locomotive.
It should support icons or icon like base game. If you need to layer icons my library offers a function to convert icon or icons into an icons array while optionally adding another layer https://github.com/Yousei9/Opteras-Libr ... eate_icons

FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 389
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by FuryoftheStars »

PurityLegion wrote: ↑
Mon Sep 23, 2019 6:45 pm
Hi, I'm not sure if your still activly working on the 0.16 Factorio version of this mod but. I have a Mod Conflict to Report, When You use Pressurized Fluids It Has an issue with A Fluid It creates. Here's a imgur of the Error on Factorio Startup. https://imgur.com/a/3OXunmj

Here's the Links to the Mods Involved:
https://mods.factorio.com/mod/Diesel-Locomotive

https://mods.factorio.com/mod/CompressedFluids

Im Not Sure which Mod is at fault, But I have posted a Bug Report on both mods pages.
Optera wrote: ↑
Tue Sep 24, 2019 5:34 am
That's a sloppy written fluid parser in Diesel Locomotive.
It should support icons or icon like base game. If you need to layer icons my library offers a function to convert icon or icons into an icons array while optionally adding another layer https://github.com/Yousei9/Opteras-Libr ... eate_icons
Yup, as Optera said, the 0.16 version of the mod did not take icons vs icon into account. I believe I fixed this when I took over the mod and updated it for 0.17.

That said, I am no longer working on this. I've lost interest in the game since the 0.17.60 update and have stopped following updates somewhere around .62 or .63. I even got a new laptop recently and have not reinstalled the game or even transferred any of the related files.

Sorry.

ksmonkey123
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Oct 29, 2014 9:59 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by ksmonkey123 »

Hi,

I would like to offer taking over this mod. There are requests to upgrade it to 0.18 and I have a few ideas for a few improvements. I am already familiar with the code base as I wrote a mod based on this one. And since I will maintain mine, it would be little to no effort to also support this one. They share most of their code. What do you think?

Cheers

Gamestrust-TS
Burner Inserter
Burner Inserter
Posts: 11
Joined: Mon Dec 04, 2017 12:05 am
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by Gamestrust-TS »

hi, solution for a this problem?
impossible load mod
error while loading item prototype" diesel-Locomotive-high-pressure-water-1"(item): Key "icon" not found in property tree at ROOT.item.Diesel-locomotive-high-pressure-water-1 modifications :diesel locomotive


thanks

ksmonkey123
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Oct 29, 2014 9:59 pm
Contact:

Re: [MOD 0.16] Diesel Locomotive

Post by ksmonkey123 »

Gamestrust-TS wrote: ↑
Sun Apr 26, 2020 3:40 pm
hi, solution for a this problem?
impossible load mod
error while loading item prototype" diesel-Locomotive-high-pressure-water-1"(item): Key "icon" not found in property tree at ROOT.item.Diesel-locomotive-high-pressure-water-1 modifications :diesel locomotive


thanks
The problem is another mod adding a fluid named "high-pressure-water-1". apparently the way the icon for this fluid is created is not compatible with the way Diesel Locomotives creates icons for all the fluid in-game. I could in theory create a fix for this in 0.17, but it's an old known issue. In my continuation mod for 0.18 (Diesel Trains) it should also be fixed already.

Post Reply

Return to β€œMods”