Page 4 of 4

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Jul 29, 2019 8:16 pm
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.

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Jul 29, 2019 8:34 pm
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.

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Jul 29, 2019 8:43 pm
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. :)

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Jul 29, 2019 9:01 pm
by Shenpen
["?Diesel-Locomotive
The questionmark makes it a soft dependency?

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Jul 29, 2019 9:03 pm
by FuryoftheStars
Yes!

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Jul 29, 2019 9:06 pm
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...

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Jul 29, 2019 9:23 pm
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.

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Jul 29, 2019 10:27 pm
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.

Re: [MOD 0.16] Diesel Locomotive

Posted: Thu Aug 01, 2019 12:39 am
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.

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Sep 23, 2019 6:45 pm
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.

Re: [MOD 0.16] Diesel Locomotive

Posted: Tue Sep 24, 2019 5:34 am
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

Re: [MOD 0.16] Diesel Locomotive

Posted: Wed Sep 25, 2019 12:24 am
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.

Re: [MOD 0.16] Diesel Locomotive

Posted: Mon Apr 20, 2020 9:09 am
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

Re: [MOD 0.16] Diesel Locomotive

Posted: Sun Apr 26, 2020 3:40 pm
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

Re: [MOD 0.16] Diesel Locomotive

Posted: Sun Apr 26, 2020 4:28 pm
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.