Page 1 of 1
[SOLVED]Make machine not reqire energy
Posted: Mon Apr 30, 2018 2:49 pm
by Villfuk02
i want to make a machine for crafting, which doesn't reqire power, but it doesn't let me delete the energy_source and energy_usage
Re: make machine not reqire energy
Posted: Mon Apr 30, 2018 3:41 pm
by darkfrei
Re: make machine not reqire energy
Posted: Mon Apr 30, 2018 4:21 pm
by Villfuk02
Cool idea, but that means there's no way? (i tried it, and it didn't work, so it was just a suggestion)
But i got another idea how to work around it!
When you place burner inserter or roboport, it has some small amount of energy stored inside. How can i do that?
Re: make machine not reqire energy
Posted: Mon Apr 30, 2018 4:55 pm
by darkfrei
Villfuk02 wrote:When you place burner inserter or roboport, it has some small amount of energy stored inside. How can i do that?
http://lua-api.factorio.com/latest/LuaE ... ity.energy
Re: make machine not reqire energy
Posted: Mon Apr 30, 2018 5:02 pm
by Villfuk02
How exactly should i use that?
neither of the exmples below work
Code: Select all
energy_source =
{
type = "burner",
usage_priority = "secondary-input",
fuel_inventory_size = 0,
energy = "420kJ",
emissions = -0.02,
},
Code: Select all
energy_source =
{
type = "burner",
usage_priority = "secondary-input",
fuel_inventory_size = 0,
emissions = -0.02,
},
energy = "420kJ",
I guess I'll have to modify the energy amount after placement, but i do not know how
Re: make machine not reqire energy
Posted: Mon Apr 30, 2018 5:38 pm
by Villfuk02
I found out i can use
Code: Select all
/c game.player.selected.burner.currently_burning="wood"
/c game.player.selected.burner.remaining_burning_fuel=2000000
Now i only need to figure out how to apply those commands after placing the entity
Re: make machine not reqire energy
Posted: Mon Apr 30, 2018 6:00 pm
by darkfrei
Villfuk02 wrote:I found out i can use
Code: Select all
/c game.player.selected.burner.currently_burning="wood"
/c game.player.selected.burner.remaining_burning_fuel=2000000
Now i only need to figure out how to apply those commands after placing the entity
control.lua
http://lua-api.factorio.com/latest/even ... ilt_entity
Code: Select all
script.on_event(defines.events.on_built_entity, function(event)
local entity = event.created_entity
if (entity.name == 'my_entity_name') and entity.burner and entity.burner.remaining_burning_fuel then
burner.remaining_burning_fuel=2000000
end
end)
Re: make machine not reqire energy
Posted: Tue May 01, 2018 1:27 am
by eradicator
Villfuk02 wrote:I found out i can use
Code: Select all
/c game.player.selected.burner.currently_burning="wood"
/c game.player.selected.burner.remaining_burning_fuel=2000000
Now i only need to figure out how to apply those commands after placing the entity
You can not set a remaining value greater than the maximum for that fuel type. You'll have to define a new fuel item with the value you want. If you set the energy usage to 1J it should last quite a while.
Also it would be nice if you could bump the 'null' source request thread with a link to this topic. Makes it more likely that it might some day be implemented.
Re: make machine not reqire energy
Posted: Tue May 01, 2018 5:24 am
by Villfuk02
One "wood" has exactly 2000000J of energy, so that's fine. For my purposes I have set the power consumption to 500W, so it lasts 4000 seconds, which is exactly 3 items crafted (They take very long).
I know It's off topic but i'd like a way to not be able to place the machine at the same place, until the ground is repaired. My idea is to place entities under this entity which are normally indestructible (like cliffs) and you are able to remove them by special item (like cliff explosives). Is this idea plausible, or not? And would it be possible to set up another collision layer, so only this machine is blocked by the entity?
Btw I implemented the fuel like this:
Code: Select all
script.on_event(defines.events.on_built_entity, function(event)
local entity = event.created_entity
if (entity.name == "basic-farmland") and entity.burner and entity.burner.remaining_burning_fuel then
event.created_entity.burner.currently_burning="wood"
event.created_entity.burner.remaining_burning_fuel=2000000
end
end
)
Thanks!
Re: [SOLVED]Make machine not reqire energy
Posted: Wed May 02, 2018 12:01 am
by eradicator
Theoretically there are five collision layers not used by the base game.
https://wiki.factorio.com/Types/CollisionMask
The more mods start to use those randomly the less of a "blocks only this one machine" effect you will have though.
What is the exact thing you're trying to do? From what your explaining about crafting machines that only need to craft 3 items it's not very clear and thus hard to give better advice.
Re: [SOLVED]Make machine not reqire energy
Posted: Wed May 02, 2018 6:04 pm
by Villfuk02
Don't worry, i first went for a farm, which would deplete the foel over time, because the most basic version has no water input, so the ground dries out. It should not be placeable on concrete/stone path tiles, because it's DIRT and you put none in the crafting recipe. I also wanted for the ground to be unusable after usint the farmland there, because it'S dried out, but i then realised this mechanic would be annoying and confusing, so i just made the crafting time longer and each farm can grow crops 3 times until it has to be crafted again.