Jump to content

Getting started - CanPickup to block


Recommended Posts

Hi

 

Years ago I used to generate wrappers to mod 7d2d xmls. It allowed me to create recipes and blocks and re-apply changes after game updates. I'm now trying to accomplish the same as below by using modlets but am already running into issues.

 

 

Spoiler

public static void CreateRecipeAndAllowPickup()
{
  /* donotuse */
  var doNotUseSign = new RecipeWrapper(Item.doNotUse, false);
  doNotUseSign.ClearComponents();
  doNotUseSign.AddDistributed(Item.plantChrysanthemum, 1, Item.leather, 3, Item.leather, 3, Item.leather, 3);
  doNotUseSign.Count = 9;
  doNotUseSign.CraftTime = 9;
  doNotUseSign.Clone("doNotUse"); // clone + remove to get in same place in xml
  doNotUseSign.Remove();

  var doNotUseSignBlock = new BlockWrapper(Block.doNotUse);
  doNotUseSignBlock.CanPickup = true;
}

 

 

I started out with the stop sign, trying to allow player to pick it up but ... yeah, can't even get that to work. 😃

 

The modlet seems to load just fine so I guess the culprit is my blocks.xml. Is there any way, in-game, to look at the current attributes of items?

 

...\7 Days To Die\Mods\TJL\Config\blocks.xml

<configs>
	<setattribute xpath="/blocks/block[@name='signRoadStop']" name="CanPickup">true</setattribute>
</configs>

 

Link to comment
Share on other sites

Looking at that block, it doesn't have that property, so it would need to be an append, not setattribute. Something like:

 

<append xpath="/blocks/block[@name='signRoadStop']">
  <property name="CanPickup" value="true"/>
</append>

 

And also, this should probably go into the Discussion and Requests forum. This one is mostly used for released mods.

Edited by bdubyah (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...