Jump to content

[Need Help] What tags do I need in Unity for a Harvestable plant?


Vanblam

Recommended Posts

As the description says I can't figure out what tag I need to set on a prefab for a harvestable plant. Is it still T_mesh_b? On top of that how would I get the plant to move with the wind (I'm guessing ill need a specific asset attached to the prefab).

 

EDIT: It was t_mesh_b. I just had the collider done incorrectly. But now I just need to figure out how get it to sway with everything else 😛

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

Well I have the block working (just used a shader from the asset store for the sway). I have tested the block itself and it works and looks just fine. However I have the plant in the biome generation for the pine forest in all the subbiome decorations and the main decorations, but it's not generating into the world ( after doing a rwg). I will show you the xml for the biome that I have right now. plantedPeppercorn3Harvest is my new plant block.

 

<vanblam>

	<set xpath="/biomes/biome[@name='pine_forest']">
	<weather>
			<Temperature min="-35" max="15" prob="1"/>
			<!--<Fog min="0" max="0" prob=".9"/>-->
			<!--<Fog min="100" max="100" prob=".1"/>-->
			<CloudThickness min="0" max="0" prob=".3"/>
			<CloudThickness min="10" max="70" prob=".6"/>
			<CloudThickness min="100" max="100" prob=".1"/>
			<Precipitation min="0" max="0" prob=".0"/>
			<Precipitation min="50" max="100" prob=".75"/>
			<Wind min="10" max="20" prob="0.9"/>
			<Wind min="20" max="100" prob="0.1"/>
		</weather>

		<subbiome prob="0.12"> <!-- Pine Forest Sub Biome Clustered Flowers and Boulders -->
			<layers>
				<layer depth="1" blockname="terrForestGround"/> <layer depth="3" blockname="terrDirt"/>
				<layer depth="*" blockname="terrStone">
					<resource blockname="terrOreIron" prob="0.6500" rwgGenerationType="all"/>
					<resource blockname="terrGravel" prob="0.7830" rwgGenerationType="all"/>
				</layer>
				<layer depth="3" blockname="terrBedrock"/>
			</layers>
			<decorations>
				<decoration type="prefab" name="deco_iron_vein" checkresource="-7" onslopes="true" prob=".00657" rotatemax="3"/>
				<decoration type="block" blockname="rockResource" prob=".00033" rotatemax="3"/>
				<decoration type="block" blockname="rockResource02" prob=".00033" rotatemax="3"/>
				<decoration type="block" blockname="plantedGoldenrod3Harvest" prob="0.008"/>
				<decoration type="block" blockname="plantedCotton3Harvest" prob="0.07"/>
				<decoration type="block" blockname="plantedChrysanthemum3Harvest" prob="0.07"/>
				<decoration type="block" blockname="plantedPeppercorn3Harvest" prob="0.06"/>
				<decoration type="block" blockname="rock01" prob=".01"/>
				<decoration type="block" blockname="rock02" prob=".01"/>
				<decoration type="block" blockname="rock04" prob=".01"/>
				<decoration type="block" blockname="treeTallGrassDiagonal" prob=".5"/>
			</decorations>
		</subbiome>

		<subbiome prob="0.292"> <!-- Ore Sub Biome: coalOre -->
			<layers>
				<layer depth="1" blockname="terrForestGround"/> <layer depth="3" blockname="terrDirt"/>
				<layer depth="1" blockname="terrStone"> <resource blockname="terrGravel" prob="0.7830" rwgGenerationType="all"/> </layer>
				<layer depth="*" blockname="terrStone"> <resource blockname="terrOreCoal" prob="0.6500" rwgGenerationType="all"/> <resource blockname="terrGravel" prob="0.7830" rwgGenerationType="all"/> </layer> <layer depth="3" blockname="terrBedrock"/>
			</layers>
			<decorations>
				<decoration type="prefab" name="deco_coal_vein" checkresource="-7" onslopes="true" prob=".00657" rotatemax="3"/>
				<decoration type="block" blockname="rockResource" prob=".00033" rotatemax="3"/>
				<decoration type="block" blockname="rockResource02" prob=".00033" rotatemax="3"/>
				<decoration type="block" blockname="cntForestRandomLootHelper" prob="0.00025"/>
				<decoration type="prefab" name="rock_form02" prob=".001" rotatemax="7"/>
				<decoration type="prefab" name="rock_form01" prob=".001" rotatemax="7"/>
				<decoration type="block" blockname="plantedCotton3Harvest" prob="0.001"/>
				<decoration type="block" blockname="rock01" prob=".001"/>
				<decoration type="block" blockname="rock02" prob=".001"/>
				<decoration type="block" blockname="rock04" prob=".001"/>
				<decoration type="block" blockname="cntBirdnest" prob="0.001"/>
				<decoration type="block" blockname="treeDeadPineLeaf" prob="0.01" rotatemax="7"/>
				<decoration type="block" blockname="treeJuniper4m" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine12m" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine19m" prob="0.0015" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine27m" prob="0.002" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine31m" prob="0.002" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPineDry21m" prob="0.002" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine41m" prob="0.004" rotatemax="7"/>
				<decoration type="block" blockname="plantedSnowberry3Harvest" prob="0.001"/>
				<decoration type="block" blockname="plantedChrysanthemum3Harvest" prob="0.001"/>
				<decoration type="block" blockname="plantedPeppercorn3Harvest" prob="0.001"/>
				<decoration type="block" blockname="treeTallGrassDiagonal" prob=".4"/>
				<decoration type="block" blockname="treeOakLrg01" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeOakMed01" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeOakMed02" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeOakSml01" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeFirLrg01" prob="0.0005" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine48m" prob="0.0005" rotatemax="7"/>
				<decoration type="block" blockname="treeStump" prob=".0002" rotatemax="7"/></decorations>
		</subbiome>
		<subbiome prob="0.312"> <!-- Ore Sub Biome: potassiumNitrate -->
			<layers>
				<layer depth="1" blockname="terrForestGround"/> <layer depth="3" blockname="terrDirt"/>
				<layer depth="1" blockname="terrStone"> <resource blockname="terrGravel" prob="0.7830" rwgGenerationType="all"/> </layer>
				<layer depth="*" blockname="terrStone"> <resource blockname="terrOrePotassiumNitrate" prob="0.6500" rwgGenerationType="all"/> <resource blockname="terrGravel" prob="0.7830" rwgGenerationType="all"/> </layer> <layer depth="3" blockname="terrBedrock"/>
			</layers>
			<decorations>
				<decoration type="prefab" name="deco_nitrate_vein" checkresource="-7" onslopes="true" prob=".00657" rotatemax="3"/>
				<decoration type="block" blockname="rockResource" prob=".00033" rotatemax="3"/>
				<decoration type="block" blockname="rockResource02" prob=".00033" rotatemax="3"/>
				<decoration type="block" blockname="cntForestRandomLootHelper" prob="0.00025"/>
				<decoration type="prefab" name="rock_form02" prob=".001" rotatemax="7"/>
				<decoration type="prefab" name="rock_form01" prob=".001" rotatemax="7"/>
				<decoration type="block" blockname="plantedCotton3Harvest" prob="0.001"/>
				<decoration type="block" blockname="rock01" prob=".001"/>
				<decoration type="block" blockname="rock02" prob=".001"/>
				<decoration type="block" blockname="rock04" prob=".001"/>
				<decoration type="block" blockname="cntBirdnest" prob="0.001"/>
				<decoration type="block" blockname="treeDeadPineLeaf" prob="0.01" rotatemax="7"/>
				<decoration type="block" blockname="treeJuniper4m" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine12m" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine19m" prob="0.0015" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine27m" prob="0.002" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine31m" prob="0.002" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPineDry21m" prob="0.002" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine41m" prob="0.004" rotatemax="7"/>
				<decoration type="block" blockname="plantedSnowberry3Harvest" prob=".001"/>
				<decoration type="block" blockname="plantedChrysanthemum3Harvest" prob="0.001"/>
				<decoration type="block" blockname="plantedPeppercorn3Harvest" prob="0.001"/>
				<decoration type="block" blockname="treeTallGrassDiagonal" prob=".4"/>
				<decoration type="block" blockname="treeOakLrg01" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeOakMed01" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeOakMed02" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeOakSml01" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeFirLrg01" prob="0.0005" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine48m" prob="0.0005" rotatemax="7"/>
				<decoration type="block" blockname="treeStump" prob=".0002" rotatemax="7"/></decorations>
		</subbiome>
		<subbiome prob="0.342"> <!-- Ore Sub Biome: leadOre -->
			<layers>
				<layer depth="1" blockname="terrForestGround"/> <layer depth="3" blockname="terrDirt"/>
				<layer depth="1" blockname="terrStone"> <resource blockname="terrGravel" prob="0.7830" rwgGenerationType="all"/> </layer>
				<layer depth="*" blockname="terrStone"> <resource blockname="terrOreLead" prob="0.6500" rwgGenerationType="all"/> <resource blockname="terrGravel" prob="0.7830" rwgGenerationType="all"/> </layer> <layer depth="3" blockname="terrBedrock"/>
			</layers>
			<decorations>
				<decoration type="prefab" name="deco_lead_vein" checkresource="-7" onslopes="true" prob=".00657" rotatemax="3"/>
				<decoration type="block" blockname="rockResource" prob=".00033" rotatemax="3"/>
				<decoration type="block" blockname="rockResource02" prob=".00033" rotatemax="3"/>
				<decoration type="block" blockname="cntForestRandomLootHelper" prob="0.00025"/>
				<decoration type="prefab" name="rock_form02" prob=".001" rotatemax="7"/>
				<decoration type="prefab" name="rock_form01" prob=".001" rotatemax="7"/>
				<decoration type="block" blockname="plantedCotton3Harvest" prob="0.001"/>
				<decoration type="block" blockname="rock01" prob=".001"/>
				<decoration type="block" blockname="rock02" prob=".001"/>
				<decoration type="block" blockname="rock04" prob=".001"/>
				<decoration type="block" blockname="cntBirdnest" prob="0.001"/>
				<decoration type="block" blockname="treeDeadPineLeaf" prob="0.01" rotatemax="7"/>
				<decoration type="block" blockname="treeJuniper4m" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine12m" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine19m" prob="0.0015" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine27m" prob="0.002" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine31m" prob="0.002" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPineDry21m" prob="0.002" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine41m" prob="0.004" rotatemax="7"/>
				<decoration type="block" blockname="plantedSnowberry3Harvest" prob=".001"/>
				<decoration type="block" blockname="plantedChrysanthemum3Harvest" prob="0.001"/>
				<decoration type="block" blockname="plantedPeppercorn3Harvest" prob="0.001"/>
				<decoration type="block" blockname="treeTallGrassDiagonal" prob=".4"/>
				<decoration type="block" blockname="treeOakLrg01" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeOakMed01" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeOakMed02" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeOakSml01" prob="0.001" rotatemax="7"/>
				<decoration type="block" blockname="treeFirLrg01" prob="0.0005" rotatemax="7"/>
				<decoration type="block" blockname="treeMountainPine48m" prob="0.0005" rotatemax="7"/>
				<decoration type="block" blockname="treeStump" prob=".0002" rotatemax="7"/></decorations>
		</subbiome>

		<!-- Block layers: Pine Forest -->
		<layers>
			<layer depth="1" blockname="terrForestGround"/> <layer depth="3" blockname="terrDirt"/>
			<layer depth="*" blockname="terrStone">
				<resource blockname="terrOreIron" prob="0.6500" rwgGenerationType="all"/>
				<resource blockname="terrGravel" prob="0.7830" rwgGenerationType="all"/>
			</layer>
			<layer depth="3" blockname="terrBedrock"/>
		</layers>
		<!-- Decorations Main: Pine Forest -->
		<decorations>
			<decoration type="prefab" name="deco_iron_vein" checkresource="-7" onslopes="true" prob=".00657" rotatemax="3"/>
			<decoration type="block" blockname="rockResource" prob=".00033" rotatemax="3"/>
			<decoration type="block" blockname="rockResource02" prob=".00033" rotatemax="3"/>
			<decoration type="block" blockname="cntForestRandomLootHelper" prob="0.00025"/>
			<decoration type="prefab" name="rock_form02" prob=".001" rotatemax="7"/>
			<decoration type="prefab" name="rock_form01" prob=".001" rotatemax="7"/>
			<decoration type="block" blockname="plantedCotton3Harvest" prob="0.001"/>
			<decoration type="block" blockname="rock01" prob=".001"/>
			<decoration type="block" blockname="rock02" prob=".001"/>
			<decoration type="block" blockname="rock04" prob=".001"/>
			<decoration type="block" blockname="cntBirdnest" prob="0.001"/>
			<decoration type="block" blockname="treeDeadPineLeaf" prob="0.01" rotatemax="7"/>
			<decoration type="block" blockname="treeJuniper4m" prob="0.001" rotatemax="7"/>
			<decoration type="block" blockname="treeMountainPine12m" prob="0.001" rotatemax="7"/>
			<decoration type="block" blockname="treeMountainPine19m" prob="0.0015" rotatemax="7"/>
			<decoration type="block" blockname="treeMountainPine27m" prob="0.002" rotatemax="7"/>
			<decoration type="block" blockname="treeMountainPine31m" prob="0.002" rotatemax="7"/>
			<decoration type="block" blockname="treeMountainPineDry21m" prob="0.002" rotatemax="7"/>
			<decoration type="block" blockname="treeMountainPine41m" prob="0.004" rotatemax="7"/>
			<decoration type="block" blockname="plantedSnowberry3Harvest" prob=".001"/>
			<decoration type="block" blockname="plantedChrysanthemum3Harvest" prob="0.001"/>
			<decoration type="block" blockname="plantedPeppercorn3Harvest" prob="0.001"/>
			<decoration type="block" blockname="treeTallGrassDiagonal" prob=".4"/>
			<decoration type="block" blockname="treeOakLrg01" prob="0.001" rotatemax="7"/>
			<decoration type="block" blockname="treeOakMed01" prob="0.001" rotatemax="7"/>
			<decoration type="block" blockname="treeOakMed02" prob="0.001" rotatemax="7"/>
			<decoration type="block" blockname="treeOakSml01" prob="0.001" rotatemax="7"/>
			<decoration type="block" blockname="treeFirLrg01" prob="0.0005" rotatemax="7"/>
			<decoration type="block" blockname="treeMountainPine48m" prob="0.0005" rotatemax="7"/>
			<decoration type="block" blockname="treeStump" prob=".0002" rotatemax="7"/>
		</decorations>
		<terrain class="Mountains"/>
	</set>

</vanblam>

 

Edit: forgot to show my block xml for the plant:

<vanblam>
	<append xpath= "/blocks">

		<block name="plantedPeppercorn3Harvest"> <!-- stage 3, harvestable / player-farmed and prefab peppercorn -->
			<property name="Extends" value="cropsHarvestableMaster"/>
			<property name="DisplayInfo" value="Name"/>
			<property name="CustomIcon" value="avBlockPeppercorn"/>
			<property name="Shape" value="ModelEntity"/>
			<property name="Model" value="#@modfolder:Resources/AV_Main.unity3d?peppercorn_bush_p.prefab"/>
			<property name="Mesh" value="cutoutmoveable"/>
			<drop event="Harvest" name="ingredientPeppercorns" count="1" tag="wildCropsHarvest"/>
		</block>

	</append>

</vanblam>

I do plan on making it a "plantable" crop.

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

I am relatively new to modding, but if you are trying to modify the biomes config file, should it be in a file called biomes.xml in your mod, not called vanblam?  I made changes to the trader file in my mod, so I created a trader.xml file that starts with <trader> and ends with <\trader>

Link to comment
Share on other sites

20 minutes ago, BFT2020 said:

I am relatively new to modding, but if you are trying to modify the biomes config file, should it be in a file called biomes.xml in your mod, not called vanblam?  I made changes to the trader file in my mod, so I created a trader.xml file that starts with <trader> and ends with <\trader>

That part doesn't effect anything as far I've seen, as long as the xml file name is correct eg: if you change an item with a an xpath just make sure that the xml is call items.xml. That's what I've seen in tutorials anyway :) Also my item.xml for example has <vanblam> </vanblam> and works just fine.

Link to comment
Share on other sites

14 minutes ago, BFT2020 said:

Sorry got to ask…If you are adding your block to the biome, would it be easier to just append the new block to the code rather than replace it all like you did in your blocks file?

I wouldn't mind doing that way, but I didn't know how to approach it :D I've done items that way but not biomes, and I have the block in many subbiomes so it seemed less confusing to me to do the way I did. But I probably should append it because the way I have it is not working hehe.

 

EDIT: Oh and I am very new to all this :)

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

Um check your hierarchy on your file.

 

If you open the biomes.xml file, the first layer should be worldgeneration, not biomes.  That is why your pathing is not working.

 

I just loaded biomes in notepad++

 

<set xpath="/biomes/biome[@name='pine_forest']">

 

should be

 

<set xpath="/worldgeneration/biomes/biome[@name='pine_forest']">

 

or you can try

 

<set xpath="//biomes/biome[@name='pine_forest']">

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

Once again, i must recommend using notepad ++, and using ALT 0 to collapse all nodes. Then as you open them up, write them down. This way you won't miss a node.

You're missing the very first one. Xpath should be: /worldgeneration/biomes/biome[@name...........etc.

It's very easy to miss nodes if you are new to xpath, and I highly suggest you get notepad++ and use the method i just put up.

Link to comment
Share on other sites

13 minutes ago, Telric said:

Once again, i must recommend using notepad ++, and using ALT 0 to collapse all nodes. Then as you open them up, write them down. This way you won't miss a node.

You're missing the very first one. Xpath should be: /worldgeneration/biomes/biome[@name...........etc.

It's very easy to miss nodes if you are new to xpath, and I highly suggest you get notepad++ and use the method i just put up.

OMG ty, never tried that command in notepad++, I most definitely will from now on. Did not see worldgeneration. And ty BFT2020 for your help bud :)

Edited by Vanblam (see edit history)
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...