• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Where am i going wrong - block upgrades

AaronG85

Refugee
I have the following code

<append xpath="/blocks/block[@name='steelShapes']">
<property class="UpgradeBlock">
<property name="ToBlock" value="meteotireGreenShapes"/>
<property name="Item" value="resourceForgedMeteoriteGreen"/>
<property name="ItemCount" value="10"/>
<property name="UpgradeHitCount" value="4"/>
</property>
</append>

<block name="meteotireGreenShapes" shapes="All">
<property name="DescriptionKey" value="meteotireGreenShapesDesc"/>
<property name="DisplayType" value="blockHardened"/>
<property name="Material" value="MmeteotireGreen_shapes"/>
<property name="Shape" value="New"/>
<property name="Texture" value="544"/>
<property name="UiBackgroundTexture" value="544"/>
<property name="EconomicValue" value="150"/>
<property name="EconomicBundleSize" value="20"/>
<property class="RepairItems">
<property name="resourceForgedMeteoriteGreen" value="10"/>
</property>
<drop event="Harvest" name="resourceForgedMeteoriteGreen" count="8" tag="allHarvest"/>
<drop event="Destroy" count="0"/>
<drop event="Fall" name="resourceMeteoriteGreen" count="10" prob="0.75" stick_chance="1"/>
<property class="UpgradeBlock">
<property name="ToBlock" value="meteotireRedShapes"/>
<property name="Item" value="resourceForgedMeteoriteRed"/>
<property name="ItemCount" value="10"/>
<property name="UpgradeHitCount" value="4"/>
</property>
<property name="UpgradeSound" value="place_block_concrete"/>
<property name="SortOrder1" value="S030"/>
<property name="Group" value="Building,advBuilding"/>
<property name="FilterTags" value="MC_Shapes"/>
</block>




I have made all the required mods to the recipes, blocks, items and material XMLs but im stuck as I cant upgrade from the steel block to my new block. Any help is greatly appreciated.

 
Im on my phone, and its just a guess,and it might be outdated info,  but i think the "item repairing the blocks" (like the hammer, stone axe, nailgun) needs to be changed/modified as being able to upgrade/repair this block, or something similar. Like you may have to make an edit/addition to the item that is repairing the block to add this block type/mayerial? As something it can repair. If no one else has an actual answer I can try to validate to see if this is true but it might be late tonight.

you might also be able to search the vanilla xml files for "nailgun" (or hammer) and see if you can find a place where there is a "list of blocks or block classes" and see if adding your block to that list makes it work. I vaguely remember there was a list attached to the repair items like this in a19/20. Its not "all blocks" its like "the parent block classes" 

 
Last edited:
I have the following code

<append xpath="/blocks/block[@name='steelShapes']">
<property class="UpgradeBlock">
<property name="ToBlock" value="meteotireGreenShapes"/>
<property name="Item" value="resourceForgedMeteoriteGreen"/>
<property name="ItemCount" value="10"/>
<property name="UpgradeHitCount" value="4"/>
</property>
</append>

<block name="meteotireGreenShapes" shapes="All">
<property name="DescriptionKey" value="meteotireGreenShapesDesc"/>
<property name="DisplayType" value="blockHardened"/>
<property name="Material" value="MmeteotireGreen_shapes"/>
<property name="Shape" value="New"/>
<property name="Texture" value="544"/>
<property name="UiBackgroundTexture" value="544"/>
<property name="EconomicValue" value="150"/>
<property name="EconomicBundleSize" value="20"/>
<property class="RepairItems">
<property name="resourceForgedMeteoriteGreen" value="10"/>
</property>
<drop event="Harvest" name="resourceForgedMeteoriteGreen" count="8" tag="allHarvest"/>
<drop event="Destroy" count="0"/>
<drop event="Fall" name="resourceMeteoriteGreen" count="10" prob="0.75" stick_chance="1"/>
<property class="UpgradeBlock">
<property name="ToBlock" value="meteotireRedShapes"/>
<property name="Item" value="resourceForgedMeteoriteRed"/>
<property name="ItemCount" value="10"/>
<property name="UpgradeHitCount" value="4"/>
</property>
<property name="UpgradeSound" value="place_block_concrete"/>
<property name="SortOrder1" value="S030"/>
<property name="Group" value="Building,advBuilding"/>
<property name="FilterTags" value="MC_Shapes"/>
</block>




I have made all the required mods to the recipes, blocks, items and material XMLs but im stuck as I cant upgrade from the steel block to my new block. Any help is greatly appreciated.


Hi AaronG85

It's like Doughphunghus says, you have to add the material with which you are going to improve the block to each tool with which you want the block to be improved.
You can check my GK old sysyem upgrade mod or Sephiroth mod or any other Nexus mod, to give you an idea.

Regards
Gouki

 
My "Blocks" mod does not show upgrades. It's a special, 100% custom block that "grows" stock, in-game blocks to save builders time. With that said, here's a simple example.

<property class="UpgradeBlock">
<property name="ToBlock" value="concreteShapes"/>
<property name="Item" value="resourceConcreteMix"/>
<property name="ItemCount" value="10"/>
<property name="UpgradeHitCount" value="4"/>
</property>


This is how a cobblestone block upgrades into a concrete block. You need a section like this in your core block (the one you can morph into the various shapes) and only in that block.

Update:

Here's a quick example. Assume you wanted to go from steel to the old stainless steel, assuming you added items or formula to allow it.

<append xpath="/blocks">
<block name="steelShapes" shapes="All">
<property name="DescriptionKey" value="steelBlockGroupDesc"/>
<property name="DisplayType" value="blockHardened"/>
<property name="Material" value="Msteel_shapes"/>
<property name="Shape" value="New"/>
<property name="Texture" value="356"/>
<property name="UiBackgroundTexture" value="356"/>
<property name="EconomicValue" value="160"/>
<property class="RepairItems">
<property name="resourceForgedSteel" value="8"/>
</property>
<drop event="Harvest" name="resourceScrapIron" count="15" tag="allHarvest"/>
<drop event="Destroy" count="0"/>
<drop event="Fall" name="scrapMetalPile" count="1" prob="0.75" stick_chance="1"/>

<!-- This is the stuff I added for the example -->
<property class="UpgradeBlock">
<property name="ToBlock" value="stainlessSteelShapes"/>
<property name="Item" value="resourceStainlessSteelPolish"/>
<property name="ItemCount" value="10"/>
<property name="UpgradeHitCount" value="4"/>
</property>
<!-- My additions end here -->

<property name="UpgradeSound" value="place_block_metal"/>
<property name="SortOrder1" value="S040"/>
<!-- SortOrder2 is assigned in code to keep all of the shapes in the same order for each material -->
<property name="Group" value="Building,advBuilding"/>
<property name="FilterTags" value="MC_Shapes"/>
</block>
</append>


I copied the stock "steelShapes" and simply added the section you need in your block(s) to do upgrades. I should have named it "mySteelShapes" or something though. I do not know what the game would do if you added a block with a name that already exists!

Update 2:

After reviewing your code a second time I see you have the upgrade section. I skipped over it somehow upon first reading. That or I wasn't paying enough attention. Have you done as suggested and added the upgrade materials to the tools?

 
Last edited by a moderator:
Update 2:

After reviewing your code a second time I see you have the upgrade section. I skipped over it somehow upon first reading. That or I wasn't paying enough attention. Have you done as suggested and added the upgrade materials to the tools?


Yeah I've added the

resourceForgedMeteoriteRed


to the nailgun but still nothing?

 
Can the nailgun upgrade? I know it repairs, but I have NEVER tried upgrading with it. I use the normal claw hammer or, early on, the stone axe.

You added your materials to the nailgun how?

<property name="Allowed_upgrade_items" value="resourceWood,resourceClayLump,resourceSnowBall,resourceScrapIron,resourceForgedIron,resourceForgedSteel,resourceConcreteMix,resourceCobblestones,ironDoorBlockVariantHelper,ironDoorDoubleBlockVariantHelper,vaultDoor01,vaultDoor01Double,ironHatchBlockVariantHelper,vaultHatch01,cellarDoorDoubleIron,cellarDoorDoubleSteel,shuttersIronBlockVariantHelper,shuttersSteelBlockVariantHelper,resourceYuccaFibers,resourceCloth,resourceScrapPolymers,resourceNail"/>


That's the stock line. Did you use something like an "items.xml" file in your mod with the following?

<configs>
<set xpath="/items/item[@name='meleeToolRepairT3Nailgun']/property[@name='Allowed_upgrade_items']/@value">resourceWood,resourceClayLump,resourceSnowBall,resourceScrapIron,resourceForgedIron,resourceForgedSteel,resourceConcreteMix,resourceCobblestones,ironDoorBlockVariantHelper,ironDoorDoubleBlockVariantHelper,vaultDoor01,vaultDoor01Double,ironHatchBlockVariantHelper,vaultHatch01,cellarDoorDoubleIron,cellarDoorDoubleSteel,shuttersIronBlockVariantHelper,shuttersSteelBlockVariantHelper,resourceYuccaFibers,resourceCloth,resourceScrapPolymers,resourceNail,resourceForgedMeteoriteRed</set>
</configs>


That SHOULD do the trick.

 
Last edited by a moderator:
So everyone knows

<set xpath="/items/item[@name='meleeToolRepairT3Nailgun']/property/property[@name='Allowed_upgrade_items']/@value">resourceWood,resourceClayLump,resourceSnowBall,resourceScrapIron,resourceForgedIron,resourceForgedSteel,resourceConcreteMix,resourceCobblestones,ironDoorBlockVariantHelper,ironDoorDoubleBlockVariantHelper,vaultDoor01,vaultDoor01Double,ironHatchBlockVariantHelper,vaultHatch01,cellarDoorDoubleIron,cellarDoorDoubleSteel,shuttersIronBlockVariantHelper,shuttersSteelBlockVariantHelper,resourceYuccaFibers,resourceCloth,resourceScrapPolymers,resourceNail,resourceForgedMeteoriteGreen,resourceForgedMeteoriteRed,resourceForgedMeteoriteBlue</set>  




Original code was items/item/property[@name], needed to be   items/item/property/property[@name]

 
Indeed, you spotted it before I did! I was also not seeing where the upgrade from whatever stock block was, but I also didn't have much time earlier. Busy day. Got home after 9PM.

 
Back
Top