Jump to content

Could Extends with Params be explained in more depth.


Code_Ovrld

Recommended Posts

Could Extends with Params be explained in more depth? 

 

Code For Reference from blocks.xml:

<block name="terrDestroyedStone">
    <property name="Material" value="Mrubble"/>
    <property name="NoScrapping" value="true"/>
    <property name="Shape" value="Terrain"/>
    <property name="Mesh" value="terrain"/>
    <property name="Texture" value="438"/>
    <property name="ImposterExclude" value="true"/>
    <property name="Weight" value="90"/>
    <property name="Map.Color" value="152,149,63"/>
    <property class="RepairItems">
        <property name="resourceCobblestones" value="6"/>
    </property>
    <drop event="Harvest" name="resourceCrushedSand" count="4" tag="oreWoodHarvest"/>
    <drop event="Harvest" name="resourceRockSmall" count="12" tag="oreWoodHarvest"/>
    <drop event="Destroy" count="0"/>
    <property name="CanMobsSpawnOn" value="true"/>
    <property name="EconomicValue" value="5"/>
    <property name="EconomicBundleSize" value="1"/>
    <property name="SellableToTrader" value="false"/>
    <property name="FilterTags" value="MC_outdoor,SC_terrain,MC_building,SC_destruction"/>
    <property name="SortOrder1" value="d0k0"/>
    <property name="SortOrder2" value="0050"/>
    <property name="DisplayType" value="blockTerrainFertile"/>
</block>

<block name="terrDestroyedWoodDebris">
    <property name="Extends" value="terrDestroyedStone" param1="Harvest"/>
    <property name="Texture" value="438"/>
    <property name="CustomIcon" value="terrDestroyedStone"/>
    <property name="CustomIconTint" value="C68C53"/>
    <property name="Material" value="Mwood_regular"/>
    <property name="MaxDamage" value="30"/>
    <property name="FuelValue" value="150"/>
    <property name="ImposterExclude" value="true"/>
    <drop event="Harvest" name="resourceCrushedSand" count="0" tag="oreWoodHarvest"/>
    <drop event="Harvest" name="resourceRockSmall" count="0" tag="oreWoodHarvest"/>
    <drop event="Harvest" name="resourceWood" count="1,2" tag="oreWoodHarvest"/>
    <property name="Map.Color" value="110,95,49"/>
    <property name="CanMobsSpawnOn" value="true"/>
    <property name="FilterTags" value="MC_outdoor,SC_terrain,MC_building,SC_destruction"/>
    <property name="DisplayType" value="blockTerrain"/>
    <property name="DescriptionKey" value="terrainBlockGroupDesc"/>
</block>

 

Why does param1="Harvest" need to specified and how is it interpreted?

<property name="Extends" value="terrDestroyedStone" param1="Harvest"/>

 

I.E. does the values from the Harvest values in terraDestroyedStone over-write the values in terrDestroyedWoodDebris, or is it vice-versa? 
 

<!-- Values from terrDestroyedStone -->

    <drop event="Harvest" name="resourceCrushedSand" count="4" tag="oreWoodHarvest"/>
    <drop event="Harvest" name="resourceRockSmall" count="12" tag="oreWoodHarvest"/>

<!-- Values from terrDestroyedWoodDebris -->

    <drop event="Harvest" name="resourceCrushedSand" count="0" tag="oreWoodHarvest"/>
    <drop event="Harvest" name="resourceRockSmall" count="0" tag="oreWoodHarvest"/>
    <drop event="Harvest" name="resourceWood" count="1,2" tag="oreWoodHarvest"/>

 

Link to comment
Share on other sites

As bdubyah said, it tells terrDestroyedWoodDebris to inherit everything BUT Harvest from terrDestroyedStone. Many things can be overwritten in xml and thus don't need to be specifically excluded--CustomIcon, etc--but in the case of Harvest events, it doesn't overwrite them in extended blocks, it ADDS them to the existing Harvest events. Without that exception, you'd get both the wood harvest from the new block and the stone and sand from the original block.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...