Optional power grid requirement for ammo-turret entities

Things that we aren't going to implement
User avatar
wodzu93
Inserter
Inserter
Posts: 35
Joined: Thu Apr 20, 2017 3:57 pm
Contact:

Optional power grid requirement for ammo-turret entities

Post by wodzu93 »

TL;DR
Make ammo-turret entities use and require electric power grid if LuaEntityPrototype.energy_source is not nil.
What ?
Currently ammo-turret type entities completely ignore electric grid information. I tried to make turrets that take ammo AND require electric energy as well,
but ammo-turret entities ignore energy_source entry and electric-turret entities cannot be fed with ammo even if ammo_category is not set to electric.

Since code for this is already in the game (Laser Turrets), this should be very easy to implement.
For example:

Code: Select all

   type = "ammo-turret",
	name = "w93-rocket-turret2",

        ...

   energy_usage = "300kW",
	energy_source =
	{
		type = "electric",
		drain = "50kW",
		usage_priority = "secondary-input"
	},

        ...

	attack_parameters =
	{
		type = "projectile",
		ammo_category = "rocket",

      ...
This turret would fire rockets, while requiring power grid, with 50kW of passive drain and 300kW of active drain (constant drain while turret is not passive, ex. fires or rotates).
IT student that likes modding in his free time.

Shameless self-promotion:
http://steamcommunity.com/sharedfiles/f ... =555765765
http://steamcommunity.com/sharedfiles/f ... =575758597
User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 441
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: Optional power grid requirement for ammo-turret entities

Post by ownlyme »

you could periodically check if the rotation is not north/east/west/south or shooting target is not nil, and when there is not enough energy you set the turret to active = false, though this would probably be a total ups nightmare..
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Rseding91
Factorio Staff
Factorio Staff
Posts: 14765
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Optional power grid requirement for ammo-turret entities

Post by Rseding91 »

This isn't going to happen. Electric turrets are what you need to use if you want to consume power and use a turret.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Won't implement”