connects to power but does not add to map mesh

Started by Igabod, January 03, 2015, 07:00:48 PM

Previous topic - Next topic

Igabod

I'm working on an update for my advanced lamps mod and this warning pops up in the debug window. Can someone please tell me what is causing this?

UVHeatLamp connects to power but does not add to map mesh. Will not create wire meshes.

Here is the relevant XML code:


  <ThingDef ParentName="BuildingBase">
    <defName>UVHeatLamp</defName>
    <eType>BuildingComplex</eType>
    <label>UV Heat Lamp</label>
    <description>Lights an area brightly enough to grow crops while also providing a small amount of warmth to the room.</description>
    <thingClass>Building_Heater</thingClass>
    <category>Building</category>
    <graphicPath>Things/Building/AdvancedLampSun</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <altitudeLayer>BuildingTall</altitudeLayer>
    <passability>PassThroughOnly</passability>
    <constructEffect>ConstructDirt</constructEffect>
    <tickerType>Normal</tickerType>
    <drawerType>RealtimeOnly</drawerType>
    <statBases>
      <MaxHealth>80</MaxHealth>
      <WorkToMake>500</WorkToMake>
      <Flammability>1.0</Flammability>
    </statBases>
    <selectable>true</selectable>
    <size>(1,1)</size>
    <costList>
      <Steel>75</Steel>
    </costList>
    <soundImpactDefault>BulletImpactGround</soundImpactDefault>
    <leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
    <placeWorkers>
      <li>PlaceWorker_Heater</li>
    </placeWorkers>
    <drawPlaceWorkersWhileSelected>true</drawPlaceWorkersWhileSelected>
    <comps>
      <li>
        <compClass>CompGlower</compClass>
        <overlightRadius>7.0</overlightRadius>
        <glowRadius>10</glowRadius>
        <glowColor>(250,250,370,0)</glowColor>
      </li>
      <li>
        <compClass>CompHeatPusher</compClass>
        <heatPerSecond>20</heatPerSecond>
        <heatPushMaxTemperature>15</heatPushMaxTemperature>
      </li>
      <li>
        <compClass>CompGatherSpot</compClass>
      </li>
      <li>
        <compClass>CompPowerTrader</compClass>
        <startElectricalFires>true</startElectricalFires>
        <soundPowerOn>PowerOnSmall</soundPowerOn>
        <soundPowerOff>PowerOffSmall</soundPowerOff>
        <basePowerConsumption>500</basePowerConsumption>
      </li>
    </comps>
    <specialDisplayRadius>5.8</specialDisplayRadius>
    <designationCategory>Misc</designationCategory>
    <rotatable>false</rotatable>
    <researchPrerequisite>Advanced_Sunlamp</researchPrerequisite>
  </ThingDef>


And if someone could point out any other odd things they see with this code if there is anything that would help me learn how to do things better.

unifex

#1
You need this one:

    <drawerType>MapMeshAndRealTime</drawerType>

Think that's all I changed and it appears to work fine. I'm tempted to add transmitsPower to all the light's CompPowerTrader block, I don't like having to route wiring around those.

Igabod

Quote from: unifex on January 03, 2015, 08:09:57 PM
You need this one:

    <drawerType>MapMeshAndRealTime</drawerType>

Think that's all I changed and it appears to work fine. I'm tempted to add transmitsPower to all the light's CompPowerTrader block, I don't like having to route wiring around those.

Nope, it doesn't put out any warnings or errors. But when I place the item it turns the screen all tie-dyed. See the attachment for a reference. I was too lazy to upload the screenshot to imgur.

[attachment deleted due to age]

unifex

Ack, something else going on there I think (at least, it works fine for me with that change, I also changed the Texture but I doubt that'd be it).

I'd try with a vanilla install.

Igabod

that was tested with no other mods active. in a tundra biome during december on a new map and everything.

unifex

Looks like something going wrong with Unity's shaders or something, not sure sorry (definitely got the right drawerType?). It does however "work on my machine" :) I've got a fair few mods installed though.

Igabod


  <ThingDef Name="BuildingBase" Abstract="True">
    <category>Building</category>
    <thingClass>Building</thingClass>
    <soundImpactDefault>BulletImpactMetal</soundImpactDefault>
    <selectable>true</selectable>
    <drawerType>MapMeshAndRealTime</drawerType>
    <terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
    <repairEffect>Repair</repairEffect>
  </ThingDef>

  <ThingDef ParentName="BuildingBase">
    <defName>UVHeatLamp</defName>
    <eType>BuildingComplex</eType>
    <label>UV Heat Lamp</label>
    <description>Lights an area brightly enough to grow crops while also providing a small amount of warmth to the room.</description>
    <thingClass>Building_Heater</thingClass>
    <category>Building</category>
    <graphicPath>Things/Building/AdvancedLampSun</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <altitudeLayer>BuildingTall</altitudeLayer>
    <passability>PassThroughOnly</passability>
    <constructEffect>ConstructDirt</constructEffect>
    <tickerType>Normal</tickerType>
    <drawerType>MapMeshAndRealTime</drawerType>
    <statBases>
      <MaxHealth>80</MaxHealth>
      <WorkToMake>500</WorkToMake>
      <Flammability>1.0</Flammability>
    </statBases>
    <selectable>true</selectable>
    <size>(1,1)</size>
    <costList>
      <Steel>75</Steel>
    </costList>
    <soundImpactDefault>BulletImpactGround</soundImpactDefault>
    <leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
    <placeWorkers>
      <li>PlaceWorker_Heater</li>
    </placeWorkers>
    <drawPlaceWorkersWhileSelected>true</drawPlaceWorkersWhileSelected>
    <comps>
      <li>
        <compClass>CompGlower</compClass>
        <overlightRadius>7.0</overlightRadius>
        <glowRadius>10</glowRadius>
        <glowColor>(250,250,370,0)</glowColor>
      </li>
      <li>
        <compClass>CompHeatPusher</compClass>
        <heatPerSecond>20</heatPerSecond>
        <heatPushMaxTemperature>15</heatPushMaxTemperature>
      </li>
      <li>
        <compClass>CompGatherSpot</compClass>
      </li>
      <li>
        <compClass>CompPowerTrader</compClass>
        <startElectricalFires>true</startElectricalFires>
        <soundPowerOn>PowerOnSmall</soundPowerOn>
        <soundPowerOff>PowerOffSmall</soundPowerOff>
        <basePowerConsumption>500</basePowerConsumption>
      </li>
    </comps>
    <specialDisplayRadius>5.8</specialDisplayRadius>
    <designationCategory>Misc</designationCategory>
    <rotatable>false</rotatable>
    <researchPrerequisite>Advanced_Sunlamp</researchPrerequisite>
  </ThingDef>


There is all the relevant code for this item, including the parent item at the top of the file. If the problem isn't in that then I don't know what it is. I've come across this bug before when I was making my Temperature Control mod and I can't even remember how I fixed it.

Loki88

#7
I didn't exactly figure out what was causing the bug, but I did manage to reverse engineer a heater to make it Work like a sunlamp as well. it doesn't seem to want to use the compClass CompHeatPusher while connected to power. instead it wants to use the compClass CompTempController. I know this isn't exactly what you were going for with having the temp control panel pop up but it's the best I can seem to do :P


  <!-- ========================= UVHeatLamp ==========================-->

<ThingDef ParentName="BuildingBase">
    <defName>UVHeatLamp</defName>
    <eType>Building_TempController</eType>
    <label>UV Heat Lamp</label>
    <thingClass>Building_Heater</thingClass>
    <graphicPath>Things/Building/Production/LampSun</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <altitudeLayer>BuildingTall</altitudeLayer>
    <passability>PassThroughOnly</passability>
    <castEdgeShadows>false</castEdgeShadows>
    <rotatable>false</rotatable>
    <fillPercent>1</fillPercent>
    <statBases>
      <WorkToMake>500</WorkToMake>
      <MaxHealth>80</MaxHealth>
      <Flammability>1.0</Flammability>
    </statBases>
    <tickerType>Rare</tickerType>
    <description>Lights an area brightly enough to grow crops while also providing a small amount of warmth to the room.</description>
    <size>(1,1)</size>
    <costList>
      <Steel>75</Steel>
    </costList>
    <killedLeavings>
      <ChunkSlag>1</ChunkSlag>
    </killedLeavings>
    <filthLeavings>
      <SlagRubble>3</SlagRubble>
    </filthLeavings>
    <leaveResourcesWhenKilled>true</leaveResourcesWhenKilled>
    <terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
    <placeWorkers>
      <li>PlaceWorker_Heater</li>
    </placeWorkers>
    <drawPlaceWorkersWhileSelected>true</drawPlaceWorkersWhileSelected>
    <comps>
      <li>
        <compClass>CompPowerTrader</compClass>
        <startElectricalFires>true</startElectricalFires>
        <soundPowerOn>PowerOnSmall</soundPowerOn>
        <soundPowerOff>PowerOffSmall</soundPowerOff>
        <basePowerConsumption>100</basePowerConsumption>
      </li>
      <li>
        <compClass>CompTempControl</compClass>
        <energyPerSecond>18</energyPerSecond>
      </li>
      <li>
        <compClass>CompGlower</compClass>
        <overlightRadius>7.0</overlightRadius>
        <glowRadius>14</glowRadius>
        <glowColor>(370,370,370,0)</glowColor>
      </li>
    </comps>
    <designationCategory>Misc</designationCategory>
    <sunShadowInfo>
      <basewidth>0.5</basewidth>
      <baseHeight>0.5</baseHeight>
      <tallness>1.0</tallness>
    </sunShadowInfo>
  </ThingDef>


Edit: I dev spawned the resources in but made them build the lamp as per usual to make sure it wouldn't have any kind of generation issues in normal use. (I built the room out of silver because... well I'm dev spawning resources so why not silver? :P )

[attachment deleted due to age]

Loki88

#8
I'm hoping that this is even moderately useful to you. If it's not then my bad :(

I changed the label, description, resource counts, and work counts to what you had.

other than that, it overlighting, and the designation category, it's a heater...

[attachment deleted due to age]

Igabod

yeah I don't want the control buttons on there. It's not a controlled heater, just a bulb that warms the room up more than typical bulbs do. I reverse-engineered the campfire to do it but had to do several edits to make the flames animation not show up. It's more of a combination of the campfire, the heater, and the sunlamp. The way I had it before actually works exactly how I want it to work, but it puts off that warning in the debug log. Fortunately nobody would ever notice it unless they open up the debug panel or if an actual error in another mod were to force it open. But I really don't like releasing things with warnings or errors or anything like that.

Loki88

Quote from: Igabod on January 04, 2015, 11:58:29 AM
yeah I don't want the control buttons on there. It's not a controlled heater, just a bulb that warms the room up more than typical bulbs do. I reverse-engineered the campfire to do it but had to do several edits to make the flames animation not show up. It's more of a combination of the campfire, the heater, and the sunlamp. The way I had it before actually works exactly how I want it to work, but it puts off that warning in the debug log. Fortunately nobody would ever notice it unless they open up the debug panel or if an actual error in another mod were to force it open. But I really don't like releasing things with warnings or errors or anything like that.

I can't get the thing to work with heat pusher and what makes the control panel pop up is the tempcontroller :( FAIL!

Igabod

Quote from: Loki88 on January 04, 2015, 12:01:05 PM
Quote from: Igabod on January 04, 2015, 11:58:29 AM
yeah I don't want the control buttons on there. It's not a controlled heater, just a bulb that warms the room up more than typical bulbs do. I reverse-engineered the campfire to do it but had to do several edits to make the flames animation not show up. It's more of a combination of the campfire, the heater, and the sunlamp. The way I had it before actually works exactly how I want it to work, but it puts off that warning in the debug log. Fortunately nobody would ever notice it unless they open up the debug panel or if an actual error in another mod were to force it open. But I really don't like releasing things with warnings or errors or anything like that.

I can't get the thing to work with heat pusher and what makes the control panel pop up is the tempcontroller :( FAIL!

yep, you have now arrived at the same place as me. Which is why I posted this thread.

Loki88

#12

  <!-- ========================= UVHeatLamp ==========================-->

<ThingDef ParentName="BuildingBase">
    <defName>UVHeatLamp</defName>
    <eType>Building_TempController</eType>
    <label>UV Heat Lamp</label>
    <thingClass>Building_Heater</thingClass>
    <graphicPath>Things/Building/Production/LampSun</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <altitudeLayer>BuildingTall</altitudeLayer>
    <passability>PassThroughOnly</passability>
    <castEdgeShadows>false</castEdgeShadows>
    <rotatable>false</rotatable>
    <fillPercent>1</fillPercent>
    <statBases>
      <WorkToMake>500</WorkToMake>
      <MaxHealth>80</MaxHealth>
      <Flammability>1.0</Flammability>
    </statBases>
    <tickerType>Normal</tickerType>
    <description>Lights an area brightly enough to grow crops while also providing a small amount of warmth to the room.</description>
    <size>(1,1)</size>
    <costList>
      <Steel>75</Steel>
    </costList>
    <killedLeavings>
      <ChunkSlag>1</ChunkSlag>
    </killedLeavings>
    <filthLeavings>
      <SlagRubble>3</SlagRubble>
    </filthLeavings>
    <leaveResourcesWhenKilled>true</leaveResourcesWhenKilled>
    <terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
    <placeWorkers>
      <li>PlaceWorker_Heater</li>
    </placeWorkers>
    <drawPlaceWorkersWhileSelected>true</drawPlaceWorkersWhileSelected>
    <comps>
      <li>
        <compClass>CompPowerTrader</compClass>
        <startElectricalFires>true</startElectricalFires>
        <soundPowerOn>PowerOnSmall</soundPowerOn>
        <soundPowerOff>PowerOffSmall</soundPowerOff>
        <basePowerConsumption>100</basePowerConsumption>
      </li>
      <li>
        <compClass>CompHeatPusher</compClass>
        <heatPerSecond>88</heatPerSecond>
        <heatPushMaxTemperature>30</heatPushMaxTemperature>
      </li>
      <li>
        <compClass>CompGlower</compClass>
        <overlightRadius>7.0</overlightRadius>
        <glowRadius>14</glowRadius>
        <glowColor>(370,370,370,0)</glowColor>
      </li>
    </comps>
    <designationCategory>Misc</designationCategory>
    <sunShadowInfo>
      <basewidth>0.5</basewidth>
      <baseHeight>0.5</baseHeight>
      <tallness>1.0</tallness>
    </sunShadowInfo>
  </ThingDef>



See if this works for you too. I jacked up the heat per second and max temp for faster feedback but it worked. I just wanna make sure it's not a fluke...

Edit: I also just noticed I forgot to increase the power consumption :(

Igabod

Besides the eType, what is different on that one? Cause I tried just changing the eType and the same results.

Loki88

Quote from: Igabod on January 04, 2015, 12:32:40 PM
Besides the eType, what is different on that one? Cause I tried just changing the eType and the same results.

Other than what I listed that I changed it's a carbon copy of the heater