equipment.prototype.energy_source.type = "electric"

Bugs that are actually features.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

equipment.prototype.energy_source.type = "electric"

Post by Ranakastrasz »

Even if the equipment is type burner, it returns electric.

Code: Select all

                        for x,equipment in ipairs(grid.equipment) do -- Loop through all equipment.
                            if (equipment.max_energy ~= 0) then
                                energy = energy + equipment.energy -- If it has energy, add values to total value.
                                energyCap = energyCap + equipment.max_energy
                                --if equipment.type == "battery-equipment" then
                                --    hasBattery = true
                                --else
                                
                                --end
                            else
                            
                            end
                            
                            
							local prototype = equipment.prototype
							globalPrint(prototype.energy_source.type)
							--if (prototype.energy_source.type == "rana-conduit") then
							
								transferRate = transferRate + (prototype.energy_source.energy_production)
							--end
							
                        end
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Rseding91
Factorio Staff
Factorio Staff
Posts: 15966
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: equipment.prototype.energy_source.type = "electric"

Post by Rseding91 »

The burner variant of the generator equipment still uses an electric energy source type in addition to the burner.

The burner transfers energy into the electric source.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: equipment.prototype.energy_source.type = "electric"

Post by Ranakastrasz »

Code: Select all

{
    type = "generator-equipment",
    name = "semiconductor-conduit-equipment",
    sprite = 
    {
      filename = "__Modular-Armor__/graphics/equipment/power-conduit-equipment-1x1.png",
      width = 32,
      height = 32,
      priority = "medium"
    },
    shape =
    {
      width = 1,
      height = 1,
      type = "full"
    },
	energy_source =
	{
		type = "burner",
		usage_priority = "primary-output"
	},
	burner =
	{
	  fuel_category = "rana-conduit",
	  effectivity = 1,
	  fuel_inventory_size = 0,
	  burnt_inventory_size = 0
	},
	power = "40kW",
	categories = {"armor"}
  },
I kinda assumed that since energy_source.type = "burner" in the prototype,\
that energy_source.type = "burner"
would be what I got if I asked for it.

In that case, How do I get the type = "burner"
Actually, now that I reread it, I did this wrong anway. how do I get the fuel_category = "rana-conduit", since that is what I actually care about.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Post Reply

Return to “Not a bug”