Fuel Slots lockable by Code

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 333
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Fuel Slots lockable by Code

Post by LuziferSenpai »

Hey,

it would be nice if we can lock the Fuel Slots of an Entity via Code and its only avaible via Code than. No Entity can put in it or pull out of it.

Greetz,

Luzifer
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Fuel Slots lockable by Code

Post by eradicator »

Oh yea. I've thought about this before. Mostly to use fake "electricity" (or fluid) "items" to fake locomotive/car fuel. But that only works if the player can't just take out the "electricity" item.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Fuel Slots lockable by Code

Post by Rseding91 »

What's the use case?
If you want to get ahold of me I'm almost always on Discord.

User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 333
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: Fuel Slots lockable by Code

Post by LuziferSenpai »

Rseding91 wrote:What's the use case?
Like he said abouve, for Modder's that are adding Electric Trains, so we can improve the UPS of our Modifications.

Because at the Moment there is only the way to put EVERY Tick "fuel" into the Trains, but with that we can improve the script.
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Fuel Slots lockable by Code

Post by Bilka »

So you just want an infinite energy source?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 333
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: Fuel Slots lockable by Code

Post by LuziferSenpai »

Bilka wrote:So you just want an infinite energy source?
No, I want to have the possibility to look Fuel Slots, so I can insert fake energy Items so I dont need to use many UPS for my Trains MOD.
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Fuel Slots lockable by Code

Post by bobingabout »

Part of the issue with trying to make electric trains is that you have to put energy in the train, you have to add fuel to the fuel slot of the burner powered train, AFAIK there's no other way to put energy into it.
So what he's asking for is an option to remove interfacing with that fuel slot (in gui, or via inserter ineraction etc) from the game, to lock it's only interface to script (to add a fuel item when sufficient electricity has been consumed on his electric charger, or whatever)
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Godmave
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Tue Nov 15, 2016 3:52 pm
Contact:

Re: Fuel Slots lockable by Code

Post by Godmave »

Alternative to that:
Put a big battery in the fuel-slot and let it be charged at stations or exchanged by the player. If there was an event on_remove_fuel you could take the leftover burner-gauge and tag the item with it (not sure if/how that would work)

more generic:
Put a tank (the one holding liquids, not the one shooting stuff) in the slot, which allows "charging" with select fluids via pumps on the loco.
Options might be a refined oil-product, or "liquid" electricity.

Without the chargeable part it would just be like https://mods.factorio.com/mod/Nuclear%20Locomotives but with full/empty batteries.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Fuel Slots lockable by Code

Post by eradicator »

@bob, removing the interface is actually not that useful. You can already emulate that by setting fuel_inventory_size to zero, handling every tick (like described by OP) is not required, just set a burning item. The problem with that is that now a) you need a single item to carry all the charge (lacking granularity) and more importantly b) there's no good way for the player to see how much charge remains, as the remaining-fuel bar is the same size regardless of what is being burned. So the idea is as follows:
  1. Create a custom locomotive/car which requires x accumulators to craft.
  2. Create a fuel type item called something like "One Megajoule", stack size of $large_number.
  3. Have a script-based "charger" at train stations that consumes electrical energy to put "One Megajoule" items into the fuel slots. How many items the charger can put into the loco is determined by the accumulator used to craft the loco.
  4. The player can now see that there's i.e. 100x "One Megajoule" charge left in the loco when they hover the fuel slot
  5. ???
  6. Profit: The loco is essentially still a normal fuel-powered loco performance wise.
The obvious problem here is: How to prevent the player from just taking 'One Megajoule' and putting it into furnaces, etc, while still allowing to the player to see how much charge the loco/car has left. → Idea: allow locking interaction with the slot.

A less round-about way would be to actually show the remaining charge and item type (and estimated remaining burn time) as text below the remaining-fuel bar while the gui is already being reworked. (come to think of it i hope trains/cars will also support the new null/infinite energy source?)

Post Reply

Return to “Modding interface requests”