Optional power grid requirement for ammo-turret entities

Things that we aren't going to implement
Post Reply
User avatar
wodzu93
Inserter
Inserter
Posts: 31
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: 400
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..
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

Rseding91
Factorio Staff
Factorio Staff
Posts: 13173
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”