Turrets taking from modified hoppers.

Started by Lonely Rogue, July 06, 2015, 07:07:08 PM

Previous topic - Next topic

Lonely Rogue

I REALLY need to know how I can get a turret to take steel from my modified hopper. I have everything else set up but that.
Rimworld: A game where you're kept as entertainment for thousand year old robots, and you just don't know it yet.
Any mod requests?

kaptain_kavern

I found that : https://ludeon.com/forums/index.php?topic=8228.0
and in that old mod i found that :   <ThingDef ParentName="BuildingBase">
    <defName>AutoLoader</defName>
    <eType>BuildingComplex</eType>
    <label>AutoLoader</label>
    <thingClass>Building_Storage</thingClass>
    <graphicPath>Things/Building/AutoLoader</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <altitudeLayer>Waist</altitudeLayer>
    <passability>Impassable</passability>
    <building>
<fixedStorageSettings>
        <priority>Important</priority>
        <allowances>
          <categories>
            <li>Ammo</li>
          </categories>
        </allowances>
      </fixedStorageSettings>
      <defaultStorageSettings>
        <priority>Important</priority>
        <allowances>
          <exceptedCategories>
            <li>Ammo</li>
          </exceptedCategories>         
        </allowances>
      </defaultStorageSettings>  
    </building>
    <inspectorTabs>
      <li>ITab_Storage</li>
    </inspectorTabs>
    <castEdgeShadows>true</castEdgeShadows>
    <fillPercent>1</fillPercent>
    <statBases>
      <WorkToMake>450</WorkToMake>
      <MaxHealth>50</MaxHealth>
      <Flammability>1.0</Flammability>
    </statBases>
    <description>Holds Ammunition for use with Turrets.</description>
    <costList>
      <Steel>10</Steel>
    </costList>
    <tickerType>Never</tickerType>
    <rotatable>true</rotatable>
    <neverMultiSelect>true</neverMultiSelect>
    <killedLeavings>
      <ChunkSlag>1</ChunkSlag>
    </killedLeavings>
    <filthLeavings>
      <SlagRubble>2</SlagRubble>
    </filthLeavings>
    <designationCategory>Security</designationCategory>
    <staticSunShadowHeight>0.3</staticSunShadowHeight>
    <itemSurface>true</itemSurface>
    <placeWorkers>
      <li>PlaceWorker_NextToHopperAccepter</li>
    </placeWorkers>
    <constructEffect>ConstructMetal</constructEffect>   
  </ThingDef>

Jaxxa

Please stop making new threads for the same issue.

You will get better responses if you just keep replying to your first thread and it will be a lot easier to follow rather than spamming new threads.

Lonely Rogue

#3
I'm sorry if you misread one of the issues, the last one was an actual xml to let me put a hopper next to it, this is so I can have it remove items. And the first one was to change what you could put in the hopper. These are all different questions. I worded the 'require' part of it wrong, I thought that's what the xml said. I've changed it. Also, I was half asleep. Even if I had, slack should be cut. Ask if I meant to make three different ones.
Rimworld: A game where you're kept as entertainment for thousand year old robots, and you just don't know it yet.
Any mod requests?

Jaxxa

Reading back over what I said, I sounded harsher than I meant, sorry about that.

Here is my comment from one of the other threads.

QuoteYou do realise that you will have to do with with C# coding and creating a .dll right? As far as I know you cant do what you want with just editing the xml.

I found the code that I was using to do this on Github that you can have a look at, it is for an old version so probably does not work right now, but I am planning to update it, maybe this weekend. Ask questions if you cant figure it out.

https://github.com/jaxxa/RimWorld-Enhanced-Defence/tree/master/ED-Core/Source/Enhanced_Defence/TurretAmmo

From memory you need to inherit the Turret Building class and override the tick event to do the checks for Ammo, and if you cant find ammo I think I was just setting the Cooldown to the max value so it wont keep firing.

Lonely Rogue

Thanks. I'm going to leave this topic open in case there are any other ways someone might want to volunteer.  ;D
Rimworld: A game where you're kept as entertainment for thousand year old robots, and you just don't know it yet.
Any mod requests?