Jump to content

Empty Crate Block


zztong

Recommended Posts

(Updating as I experiment)

 

I've got a custom POI that is a warehouse full of crates. Because crates give out loot, I couldn't just use block cntStorageGeneric or block : cntStorageGenericPOI or the POI would be a pile of loot, like books. It was suggested I transition the POI to use empty shelves, but that approach doesn't match with the intended POI design. That is, making a maze of of empty shelves doesn't look right or have the desired effect. Thus, I resorted to placing wooden cubes and painting them to look like storage crates. A few folks don't care for that approach. They feel crates should be a working container. Admittedly, that would be my preference too, if I could make sure they were empty or contained very light loot.

 

So this had me glancing at the various XML files where cntStorageGeneric and cntStorageGenericPOI are either defined or mentioned I settled on these:

 

blocks.xml

loot.xml

 

It seems like in my custom POI modlet I could add this XSLT to a blocks.xml file in my modlet:

 

<blocks>
    <insertAfter xpath="/blocks/block[@name='cntStorageGenericPOI']">
        <!-- Wooden POI loot crate -->
        <!-- SPECIAL_BLOCK_SHAPE_OR_TEXTURE_DO_NOT_CONVERT -->
        <block name="cntStorageGenericPOIEmpty">
            <property name="CreativeMode" value="Dev"/>
            <property name="CustomIcon" value="cntStorageHealth"/>
            <!-- <property name="Class" value="Loot"/> -->
            <!-- <property name="LootList" value="poiStorageBox"/> -->
            <property name="Material" value="MwoodReinforced"/>
            <property name="Texture" value="572"/>
            <property name="UseGlobalUV" value="L,L,G,G,G,G"/>
            <property class="RepairItems">
                <property name="resourceWood" value="10"/>
            </property>
            <drop event="Destroy" name="resourceWood" count="1,3"/>
            <drop event="Fall" name="terrDestroyedWoodDebris" count="1" prob="0.75" stick_chance="1"/>
            <property name="DescriptionKey" value="creativeMenuBlockGroupDesc"/>
            <property name="FilterTags" value="MC_building,SC_loot"/>
        </block>
    </insertAfter>
</blocks>

 

And that seemed to work. I can find the new block in the Prefab Editor. I can place the block and it acts like a Crate, other than not having an inventory or loot.

 

What I'm not certain about yet is if this would have any effect on EAC?

 

Or, when A21 comes along and I use the POI converter tool, what will happen with those blocks?

 

Thoughts? Advice?

Link to comment
Share on other sites

You can create custom loot containers with custom loot lists via modlet.  AFAIK, it should be EAC friendly .  Your custom stuff should be fine as long as any dependencies in your XPath doesn't change.

 

Regarding converter tool, that has always been for vanilla blocks only so should have no impact on custom blocks.

Link to comment
Share on other sites

6 minutes ago, Laz Man said:

You can create custom loot containers with custom loot lists via modlet.  AFAIK, it should be EAC friendly .  Your custom stuff should be fine as long as any dependencies in your XPath doesn't change.

 

Regarding converter tool, that has always been for vanilla blocks only so should have no impact on custom blocks.

 

Thanks for the info.

 

I had thought about making a custom loot list, but there's an ID property on that. I'm guessing I'd just pick a value up near 1023 rather than risk a collision with TFP growth. Then I'd have to find some worthless loot to put with it. Or, don't. I kind of like the crates defined without loot. They destroy like crates and don't change loot balance.

 

The blocks.xml seems to have an "Extends" tag and I wonder if I could just extend cntStorageGenericPOI but would somehow have to _remove_ the Class and LootList tags. I've not found an example where a tag is removed from the parent.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...