Page 1 of 1

equipment.prototype.energy_source.type = "electric"

Posted: Fri May 05, 2017 10:18 pm
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

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

Posted: Fri May 05, 2017 10:22 pm
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.

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

Posted: Fri May 05, 2017 10:30 pm
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.