Jump to content

Mesh swap mod to assist color vision impaired help needed.


usHallgrim

Recommended Posts

TLDR: Due to my color-vision impairment I am trying to mod dead corn to either be a drastic color change or use the treeDeadPineLeaf shape.

Long version. I have only been messing with modding for a couple of weeks. I have been able to extend items, change the tint color, make new recipes, change growing times for Oakraven honey and eggs, etc by fumbling around but this project has me stuck.

Here is the vanilla dead corn block:
 

<block name="plantedCornDeadSmall">
    <property name="DisplayInfo" value="Description"/>
    <property name="Material" value="Mcorn"/>
    <property name="Shape" value="ModelEntity"/>
    <property name="Model" value="Entities/OutdoorDecor/cornStalkBrownSmallPrefab"/>
    <property name="ModelOffset" value="0,0,0"/>
    <property name="LightOpacity" value="0"/>
    <property name="Collide" value="melee"/>
    <property name="IsTerrainDecoration" value="true"/>
    <property name="StabilitySupport" value="false"/>
    <drop event="Destroy" name="resourceYuccaFibers" count="3,12"/>
    <property name="SortOrder1" value="B960"/>
    <property name="SortOrder2" value="0006"/>
</block>

<block name="plantedCornDeadMedium">
    <property name="DisplayInfo" value="Description"/>
    <property name="DisplayType" value="blockMulti"/>
    <property name="Material" value="Mcorn"/>
    <property name="Shape" value="ModelEntity"/>
    <property name="Model" value="Entities/OutdoorDecor/cornStalkBrownMediumPrefab"/>
    <property name="ModelOffset" value="0,0,0"/>
    <property name="MultiBlockDim" value="1,2,1"/>
    <property name="LightOpacity" value="0"/>
    <property name="Collide" value="melee"/>
    <property name="IsTerrainDecoration" value="true"/>
    <property name="StabilitySupport" value="false"/>
    <drop event="Destroy" name="resourceYuccaFibers" count="3,12"/>
    <property name="SortOrder1" value="B960"/>
    <property name="SortOrder2" value="0007"/>
</block>

<block name="plantedCornDead">
    <property name="DisplayInfo" value="Description"/>
    <property name="DisplayType" value="blockMulti"/>
    <property name="Material" value="Mcorn"/>
    <property name="Shape" value="ModelEntity"/>
    <property name="Model" value="Entities/OutdoorDecor/cornStalkBrownPrefab"/>
    <property name="ModelOffset" value="0,0,0"/>
    <property name="MultiBlockDim" value="1,3,1"/>
    <property name="LightOpacity" value="0"/>
    <property name="Collide" value="melee"/>
    <property name="IsTerrainDecoration" value="true"/>
    <property name="StabilitySupport" value="false"/>
    <drop event="Destroy" name="resourceYuccaFibers" count="3,12"/>
    <property name="SortOrder1" value="B960"/>
    <property name="SortOrder2" value="0008"/>
</block>

 

I was able to replace the cornStalkBrownSmallPrefab with <property name="Model" value="@:Entities/Trees/AzaleaPrefab.prefab"/> via the following code:

 

<configs>
    <set xpath="/blocks/block[starts-with(@name, 'plantedCornDead')]/property[@name='Model']/@value">
        @:Entities/Trees/AzaleaPrefab.prefab
    </set>
</configs>

 

But the Azalea really makes the corn fields look stupid. I'd rather use the treeDeadPineLeaf (which is that scrubby bit of brushwood that you usually harvest when your start a new game). This is the vanilla block for the treeDeadPineLeaf:

 

<!-- Dead bush easily harvested for wood in many biomes-->
<block name="treeDeadPineLeaf">
    <property name="IndexName" value="quest_wood"/>
    <property name="Material" value="Mleaves"/>
    <property name="Shape" value="BillboardPlant"/>
    <property name="Mesh" value="grass"/>
    <property name="Texture" value="177"/>
    <property name="WaterFlow" value="permitted"/>
    <property name="Collide" value="melee"/>
    <property name="IsTerrainDecoration" value="true"/>
    <property name="CanDecorateOnSlopes" value="true"/>
    <drop event="Harvest" name="resourceWood" count="1,3" tag="allHarvest"/>
    <drop event="Destroy" count="0"/>
    <drop event="Fall" name="resourceWood" count="0" prob="1" stick_chance="0"/>
    <property name="SortOrder1" value="B900"/>
    <property name="SortOrder2" value="0001"/>
    <property name="Tags" value="twitchReplace"/>
    <property name="FilterTags" value="MC_outdoor,SC_shrubbery"/>
</block>

 

So seeing that treeDeadPineLeaf is a different -- I guess -- class? I tried to mix the properties of the treeDeadPineLeaf into starts-with plantedDeadCorn but all that did was erase all the dead corn. Which is better than nothing I guess, but I'd like to get a small deadish looking mesh to represent the dead corn if possible.

 

<<!-- THIS FAILED BUT THE REMOVE SORT OF MADE THINGS BETTER BY REMOVING THE DEAD CORN MESH ALTOGETHER -->>
<configs>
    <remove xpath="/blocks/block[starts-with(@name, 'plantedCornDead')]/property[@name='Model']" />
    <append xpath="/blocks/block[starts-with(@name, 'plantedCornDead')]">
        <property name="Shape" value="BillboardPlant" />
        <property name="Mesh" value="grass" />
    </append>
</configs>

 

Edited by usHallgrim (see edit history)
Link to comment
Share on other sites

Just taking a quick look at your attempt that failed, I think if you add a texture for the BillboardPlant, you might see something in game. From the code above, it looks like the game uses 

<property name="Texture" value="177"/>

 

An alternate way to do this would be by just replacing all the dead corn with another block by essentially making each of the dead corn blocks a placeholder, and then having the game fill the placeholder with treeDeadPineLeaf when the map is first generated or a POI is reset. Those edits could be done in blockplaceholders.xml file. 

<configs>
<!-- replace the dead corn models with something easier to see -->
	<append xpath="/blockplaceholders">
		<placeholder name="plantedCornDeadSmall">
			<block name="treeDeadPineLeaf" prob="1.0"/>
		</placeholder>
		
	<append xpath="/blockplaceholders">
		<placeholder name="plantedCornDeadMedium">
			<block name="treeDeadPineLeaf" prob="1.0"/>
		</placeholder>		

	<append xpath="/blockplaceholders">
		<placeholder name="plantedCornDead">
			<block name="treeDeadPineLeaf" prob="1.0"/>
		</placeholder>		
	</append>

</configs>

 

In my experience, it's best to put this change in before you start playing a world, otherwise it might not show up until you start resetting POIs by running missions at them.

 

Hope this works for you.

Link to comment
Share on other sites

Adding the texture value WORKED! Hopefully I can get the forum to show the steam screenshot :>

 

spacer.png

 

Anyway, I could not be HAPPIER 😁👍

 

And that placeholder code -- I will definitely try that at some point because that's one I want to have in my bag of tricks.

Thank you thank you!

Cranberry Monster for the win!

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...