Jump to content

Need a bit of help with my first mod.

Ivan Stamenov

Recommended Posts

I am trying to create a block behaviour which will allow some blocks (e.g. chutes) to be rotated when right-clicked with empty hand.

The problem is that method BlockBehavior.Initialize(JsonObject properties) no longer takes JsonObject as parameter (as stated by Tyron here). It is also not taking a string parameter, because the reworked code

class BlockBehaviorRotatableByHand : BlockBehavior
	protected bool VFlipApplicable = false;


	public override void Initialize(string propertiesAtString)
		//VFlipApplicable = properties["VFlipApplicable"].AsBool(false);
		VFlipApplicable = true;

throws "[Error] [rotatablebyhand]     src\rotatablebyhand.cs(110): 'RotatableByHandMod.BlockBehaviorRotatableByHand.Initialize(string)': no suitable method found to override [CS0115]".

All the sample code in the wiki and the code available in GitHub still use the JsonObject thingy (e.g. "BehaviorFiniteSpreadingLiquid").

As I passionately hate and despise microsoft, I really don't want to install VS (damn, I mean VertigoStudio, not Vintage Story).

Can a good soul help me by telling me what is/are the current parameters method BlockBehavior.Initialize() takes and, possibly, how can I extract the individual parameters there?

Link to comment
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.