Nonspecific <costList>

Started by Azuraal, March 03, 2017, 05:38:27 PM

Previous topic - Next topic

Azuraal

Is it possible for position in cost list be any item from specific category?
I'm working on a mod that replaces walls of solid metal with metal plated stone walls.

So I have plated wall structure with metallic in stuff categories
and any stone block in cost list, but that doesn't work.
I tried abstract stone blocks and this:

<costList>
<li>
<filter>
<categories>
<li>StoneBlocks</li>
</categories>
</filter>
<count>20</count>
</li>
</costList>

Am I doing something wrong or is it impossible?

RawCode

please open and copypaste vanilla walls recipe here (best if you provide complete defs, just in case), then we will compare fields one by one to determinate source of issue.

Azuraal

I do not really see the point in That, it's just vanilla wall That accepts only metallic "stuff"
and has what I posted in the OP in <costList>.
Other That that I have redefined various materials, only with stat changes, and abstract parents used.

The only error that game throws is "Misconfigured ThingCount" with quote of what is inside <costList>.
That leads me to belive That costList either has to be specifc or I'm doing it wrong.

RawCode

is stones and wood "metallic" stuff?

you should change your point of view, probably it will help.

Azuraal

#4
You seem to not understand my intent.
In mod I have 2 types of walls,
Normal which is build out of wood or stone blocks,
and metal plated which is build out of stone blocks and any metalic metarial.

So materials needed for this metal plated wall are: 10 of selected metalic material and 20 stone blocks.
The problem is that there are 5 types of stone blocks and I don't want to have 5 types of the same wall, therefore i wanted to make it so costList accepts any type of stone blocks.

EDIT: To clarify I don't want this wall's stats to be affected by type of stone used.

RawCode

i will not repeat my post.

[attachment deleted by admin due to age]

Azuraal

Why are you even here? You're the least helpful person that ever, allegedly, tried to help me.
The question in this thread is unambigious, How do you set <costList> in such a way that it accepts group of items instead of specific items.
Yet for some reason you want complete defs and are asking if I don't want to include wood and stone in allowed materials.
If it will help you think here they are but unless you want to answer the actual question don't bother replying.

All related defs:
Wall:
<ThingDef ParentName="BuildingBase" Name="MetalPlatedWall">
<defName>MetalPLatedWall</defName>
<label>plated wall</label>
<thingClass>Building</thingClass>
<category>Building</category>
<description>A metal plated wall.</description>
<graphicData>
<texPath>Things/Building/Linked/Wall</texPath>
<graphicClass>Graphic_Appearances</graphicClass>
<linkType>CornerFiller</linkType>
<linkFlags>
<li>Wall</li>
<li>Rock</li>
</linkFlags>
<damageData>
<cornerTL>Damage/Corner</cornerTL>
<cornerTR>Damage/Corner</cornerTR>
<cornerBL>Damage/Corner</cornerBL>
<cornerBR>Damage/Corner</cornerBR>
<edgeTop>Damage/Edge</edgeTop>
<edgeBot>Damage/Edge</edgeBot>
<edgeLeft>Damage/Edge</edgeLeft>
<edgeRight>Damage/Edge</edgeRight>
</damageData>
</graphicData>
<blueprintGraphicData>
<texPath>Things/Building/Linked/Wall_Blueprint_Atlas</texPath>
</blueprintGraphicData>
<uiIconPath>Things/Building/Linked/WallSmooth_MenuIcon</uiIconPath>
<statBases>
<MaxHitPoints>1500</MaxHitPoints>
<WorkToBuild>600</WorkToBuild>
<Flammability>1.0</Flammability>
</statBases>
<costList>
<li>
<filter>
<thingCategories>
<li>StoneBlocks</li>
</thingCategories>
</filter>
<count>20</count>
</li>
</costList>
<costStuffCount>10</costStuffCount>
<leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
<altitudeLayer>Building</altitudeLayer>
<passability>Impassable</passability>
<blockWind>true</blockWind>
<castEdgeShadows>true</castEdgeShadows>
<fillPercent>1</fillPercent>
<coversFloor>true</coversFloor>
<placingDraggableDimensions>1</placingDraggableDimensions>
<tickerType>Never</tickerType>
<rotatable>false</rotatable>
<selectable>true</selectable>
<neverMultiSelect>true</neverMultiSelect>
<terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
<holdsRoof>true</holdsRoof>
<designationCategory>Structure</designationCategory>
<staticSunShadowHeight>1.0</staticSunShadowHeight>
<blockLight>true</blockLight>
<stuffCategories>
<li>Metallic</li>
</stuffCategories>
<building>
<isInert>true</isInert>
<ignoreNeedsPower>true</ignoreNeedsPower>
</building>
<damageMultipliers>
<li>
<damageDef>Bomb</damageDef>
<multiplier>2</multiplier>
</li>
</damageMultipliers>
<designationHotKey>Misc4</designationHotKey>
</ThingDef>

Building base:
<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>
<leaveResourcesWhenKilled>true</leaveResourcesWhenKilled>
<filthLeaving>BuildingRubble</filthLeaving>
</ThingDef>

Stone block base:
<ThingDef ParentName="ResourceBase" Name="StoneBlocksBase" Abstract="True">
<description>Blocks of stone. Mostly useful for building long-lasting, simple structures.</description>
<graphicData>
<texPath>Things/Item/Resource/StoneBlocks</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>
<soundInteract>Stone_Drop</soundInteract>
<soundDrop>Stone_Drop</soundDrop>
<useHitPoints>false</useHitPoints>
<statBases>
<MarketValue>1.9</MarketValue>
<SharpDamageMultiplier>0.6</SharpDamageMultiplier>
<BluntDamageMultiplier>1.0</BluntDamageMultiplier>
<Beauty>-12</Beauty>
</statBases>
<thingCategories>
<li>StoneBlocks</li>
</thingCategories>
<stuffProps>
<categories>
<li>Stony</li>
</categories>
<commonality>0.20</commonality> <!-- because there are so many stone types -->
<appearance>Bricks</appearance>
<statOffsets>
<Beauty>2</Beauty>
</statOffsets>
<statFactors>
<Beauty>1.2</Beauty>
<MarketValue>0.4</MarketValue>
<MaxHitPoints>3.5</MaxHitPoints>
<Flammability>0</Flammability>
<WorkToBuild>2.5</WorkToBuild>
<WorkToMake>1.3</WorkToMake>
<DoorOpenSpeed>0.45</DoorOpenSpeed>
<BedRestEffectiveness>0.9</BedRestEffectiveness>
<MeleeWeapon_Cooldown>1.35</MeleeWeapon_Cooldown>
</statFactors>
</stuffProps>
</ThingDef>

RemingtonRyder

I think the easiest way to accomplish what you're trying to do is have a recipe (on the stonecutting table for instance) which takes a fixed number of any type of stone bricks and converts them to the same number of a generic stone brick.

Then your cost list simply uses generic stone bricks (and steel, for the metal plated ones).

RawCode

QuoteIf it will help you think here they are but unless you want to answer the actual question don't bother replying.
have a good day, not going to waste my time anymore.