Jump to content

Block helpers in upgrade/downgrade paths?


Recommended Posts

Hey, all. I searched for an answer on the forums but couldn't find one.

 

Are any of the random block helpers usable in the upgrade or downgrade paths of blocks?

 

For example, let's say you have a custom block, and it doesn't have any variants (no ramp variations, etc). You specify this property:

<property class="UpgradeBlock"> <property name="ToBlock" value="metalSheetRandomHelper"/> </property>

 

If you upgrade this block, what do you get?

Edited by khzmusik
clearer example, hopefully (see edit history)
Link to comment
Share on other sites

A placeholder will randomly choose between the blocks set in the blockplaceholders.xml... This one will be one of these:

 

	<placeholder name="metalSheetRandomHelper">
		<block name="corrugatedMetalSheetBent1"/>
		<block name="corrugatedMetalSheetBent2"/>
		<block name="corrugatedMetalSheetBent3"/>
		<block name="corrugatedMetalSheetBent4"/>
	</placeholder>


However for some reason i'm having slight memory of me trying this before and it wouldnt work, so I had to put a plant or an upgraderated block between the one the player upgrades and the blockplaceholder... I could be misremembering, but I'm fairly sure i remember I couldn't get it to be random or something like that, when it was upgraded with an item... A growing block would work though. I know that for a fact as I use them in my mods a lot.

Edit: Also you're able to use a prob attribute, so you're able to do % chances of that block being chosen.

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

That's good news.

 

To be honest, I was going to use this for downgrading rather than upgrading, but I figured they would work the same way. (For example, wood blocks would downgrade to one of the "burnt" wood blocks, rather than just a regular wood frame, chosen at random.)

 

Time to do some experiments. :) Thank you!

Edited by khzmusik
downgrade, not download. The name is "dumass" (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...