Page 1 of 1

Fuel Slots lockable by Code

Posted: Wed Jun 20, 2018 11:10 pm
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

Re: Fuel Slots lockable by Code

Posted: Wed Jun 20, 2018 11:14 pm
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.

Re: Fuel Slots lockable by Code

Posted: Thu Jun 21, 2018 12:11 am
by Rseding91
What's the use case?

Re: Fuel Slots lockable by Code

Posted: Thu Jun 21, 2018 1:39 am
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.

Re: Fuel Slots lockable by Code

Posted: Thu Jun 21, 2018 1:41 am
by Bilka
So you just want an infinite energy source?

Re: Fuel Slots lockable by Code

Posted: Thu Jun 21, 2018 2:12 am
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.

Re: Fuel Slots lockable by Code

Posted: Thu Jun 21, 2018 8:06 am
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)

Re: Fuel Slots lockable by Code

Posted: Thu Jun 21, 2018 8:08 am
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.

Re: Fuel Slots lockable by Code

Posted: Thu Jun 21, 2018 8:33 am
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?)