Need help with...

Started by HeadyBucket, June 05, 2014, 02:28:24 PM

Previous topic - Next topic

HeadyBucket

Hi, I'm trying to make a torch for a mod I'm making, what I've done is used the same code from the standing light, changed what was necessary (like texture location etc.) I can make it so that it works without power, but it will only work if it's connected to wire that has power running through it. Can anyone help me?

Also this is my first time making a mod.

Here's the whole code.
   <ThingDef ParentName="BuildingBase">
      <defName>Torch</defName>
      <eType>BuildingComplex</eType>
      <label>Torch</label>
      <thingClass>Building</thingClass>
      <category>Building</category>
      <texturePath>Things/Building/Torch</texturePath>
      <altitudeLayer>BuildingTall</altitudeLayer>
      <passability>PassThroughOnly</passability>
      <maxHealth>50</maxHealth>
      <flammability>1.0</flammability>
      <selectable>true</selectable>
      <description>Wooden Torch that lights a small area.</description>
      <size>(1,1)</size>
      <workToBuild>5</workToBuild>
      <costList>
         <li>
            <thingDef>WoodLog</thingDef>
            <count>1</count>
         </li>
      </costList>
      <soundBulletHit>BulletImpactWood</soundBulletHit>
      <leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
      <comps>
         <li>
            <compClass>CompPowerTrader</compClass>
            <basePowerConsumption>0</basePowerConsumption>
            <soundPowerOn>PowerOnSmall</soundPowerOn>
            <soundPowerOff>PowerOffSmall</soundPowerOff> 
         </li>
         <li>
            <compClass>CompGlower</compClass>
            <glowRadius>12</glowRadius>
            <glowColor>(217,217,208,0)</glowColor>
         </li>
      </comps>
      <designationCategory>Furniture</designationCategory>
      <sunShadowInfo>
         <basewidth>0.3</basewidth>
         <baseHeight>0.3</baseHeight>
         <tallness>0.6</tallness>
         <offset>(0,0,-0.1)</offset>
      </sunShadowInfo>
      <rotatable>false</rotatable>
  </ThingDef>


Is what I'm trying to change hardcoded?

iame6162013

what's in the building base?
what's the error,could you give a small demo mod so i can see what is wrong?
(it isn't the first time the code is right but the file is not ^^)
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
Robert J. Hanlon: "Never attribute to malice that which is adequately explained by stupidity."

HeadyBucket

Quote from: iame6162013 on June 05, 2014, 02:49:33 PM
what's in the building base?
what's the error,could you give a small demo mod so i can see what is wrong?
(it isn't the first time the code is right but the file is not ^^)

I just can't find a way to get the light on the torch to turn on without connecting it to a power line. Also nothing comes up with any errors if that helps.

iame6162013

remove the
         <li>
            <compClass>CompPowerTrader</compClass>
            <basePowerConsumption>0</basePowerConsumption>
            <soundPowerOn>PowerOnSmall</soundPowerOn>
            <soundPowerOff>PowerOffSmall</soundPowerOff> 
         </li>
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
Robert J. Hanlon: "Never attribute to malice that which is adequately explained by stupidity."

HeadyBucket

Quote from: iame6162013 on June 05, 2014, 03:01:41 PM
remove the
         <li>
            <compClass>CompPowerTrader</compClass>
            <basePowerConsumption>0</basePowerConsumption>
            <soundPowerOn>PowerOnSmall</soundPowerOn>
            <soundPowerOff>PowerOffSmall</soundPowerOff> 
         </li>


Already tried that, all it does is just make it so that it doesn't connect to any power lines and it makes no change to the light. Thanks though, I appreciate your help.

iame6162013

change the thing class to " Building_Glower"
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
Robert J. Hanlon: "Never attribute to malice that which is adequately explained by stupidity."

Cala13er

#6
iame, "Building_Glower" doesn't exist in Alpha 4.

Try changing the power consumption to -1.

Edit : If this does not work I'll make you a Building class that keeps it lit regardless of power or not.

iame6162013

Quote from: Cala13er on June 05, 2014, 03:13:03 PM
iame, "Building_Glower" doesn't exist in Alpha 4.

Try changing the power consumption to -1.
guess i should take a nap ... soon
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
Robert J. Hanlon: "Never attribute to malice that which is adequately explained by stupidity."

HeadyBucket

Quote from: iame6162013 on June 05, 2014, 03:12:09 PM
change the thing class to " Building_Glower"

Came up with an error, "could not find a type named Building_Glower"

Cala13er

Quote from: HeadyBucket on June 05, 2014, 03:16:52 PM
Quote from: iame6162013 on June 05, 2014, 03:12:09 PM
change the thing class to " Building_Glower"

Came up with an error, "could not find a type named Building_Glower"

Yeah. Building_Glower doesn't exist, do what I said.

HeadyBucket

Quote from: Cala13er on June 05, 2014, 03:18:01 PM
Quote from: HeadyBucket on June 05, 2014, 03:16:52 PM
Quote from: iame6162013 on June 05, 2014, 03:12:09 PM
change the thing class to " Building_Glower"

Came up with an error, "could not find a type named Building_Glower"

Yeah. Building_Glower doesn't exist, do what I said.

Yeah, already tried changing it to -1 and it basically turned it into a mini generator. Also thanks, I'll credit you for the code when I upload the mod.

Cala13er

Is there anything you'd like me to add to it?

Like, doesn't work during rain if it's outside but if under roof it still works.
Or anything else.

HeadyBucket

Quote from: Cala13er on June 05, 2014, 03:33:36 PM
Is there anything you'd like me to add to it?

Like, doesn't work during rain if it's outside but if under roof it still works.
Or anything else.

That's a good idea, yeah thanks. I'll be sure to credit you for any help and things you add to it.

Cala13er

Quote from: HeadyBucket on June 05, 2014, 03:35:26 PM
Quote from: Cala13er on June 05, 2014, 03:33:36 PM
Is there anything you'd like me to add to it?

Like, doesn't work during rain if it's outside but if under roof it still works.
Or anything else.

That's a good idea, yeah thanks. I'll be sure to credit you for any help and things you add to it.

No problem, happy to help. Let me know if you ever need any more modding help :)

Cala13er

Here you go mate! Sorry it took forever, was doing a few things in Industrial Rim first.

You'll find it attached to this.

1. But in your mods assemblies folder.
2. Go to your light def
3. Change compClass to "<compClass>CompGlowerX</compClass>"
4. Remove all of this
      <li>
        <compClass>CompPowerTrader</compClass>
        <startElectricalFires>true</startElectricalFires>
        <soundPowerOn>PowerOnSmall</soundPowerOn>
        <soundPowerOff>PowerOffSmall</soundPowerOff>
        <basePowerConsumption>0</basePowerConsumption>
      </li>
5. Finished

[attachment deleted by admin: too old]