Ludeon Forums

RimWorld => Mods => Help => Topic started by: HeadyBucket on June 05, 2014, 02:28:24 PM

Title: Need help with...
Post by: HeadyBucket on June 05, 2014, 02:28:24 PM
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?
Title: Re: Need help with...
Post by: 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 ^^)
Title: Re: Need help with...
Post by: HeadyBucket on June 05, 2014, 02:56:27 PM
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.
Title: Re: Need help with...
Post by: 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>
Title: Re: Need help with...
Post by: HeadyBucket on June 05, 2014, 03:05:05 PM
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.
Title: Re: Need help with...
Post by: iame6162013 on June 05, 2014, 03:12:09 PM
change the thing class to " Building_Glower"
Title: Re: Need help with...
Post by: 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.

Edit : If this does not work I'll make you a Building class that keeps it lit regardless of power or not.
Title: Re: Need help with...
Post by: iame6162013 on June 05, 2014, 03:14:07 PM
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
Title: Re: Need help with...
Post by: 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"
Title: Re: Need help with...
Post by: 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.
Title: Re: Need help with...
Post by: HeadyBucket on June 05, 2014, 03:20:42 PM
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.
Title: Re: Need help with...
Post by: 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.
Title: Re: Need help with...
Post by: 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.
Title: Re: Need help with...
Post by: Cala13er on June 05, 2014, 03:35:59 PM
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 :)
Title: Re: Need help with...
Post by: Cala13er on June 05, 2014, 04:16:58 PM
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]
Title: Re: Need help with...
Post by: HeadyBucket on June 05, 2014, 04:24:14 PM
Quote from: Cala13er on June 05, 2014, 04:16:58 PM
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

Thanks, heavily appreciated. Also I had no idea this would have required .dll, good thing I'm getting a book on C#.
Title: Re: Need help with...
Post by: Cala13er on June 06, 2014, 07:31:23 AM
I just realised I gave you a version where it still would work outdoors in the rain. Will get it to you when I have time to.