Blockscape

Blockscape

Not enough ratings
Guide for tools (models) in XML
By vincentl
Guide for creating custom XML files for Blockscape.
   
Award
Favorite
Favorited
Unfavorite
Information
THIS GUIDE IS OLD AND PROBABLY OUTDATED

I decided to make this guide to address several issues:


1- General information: to explain what tools/models are for and what can be done with them. I see that a lot of people don't use custom tools when they are doing repetitive tasks such as making the ceiling of a cathedral. Using custom yet simple tools (or even more complex tools) could save a ton of time and give more time for the artistic creation.

2- Structure of the XML file: I feel like I needed to do a sum up of the different features available when it comes to the tools used in Blockscape because new snapshots comes with new features (proprieties) and modifications of the different elements inside the XML files.

3- Recipes… coming later


*Keep in mind that this guide is a work in progress since I don't know everyting and the game is still evolving.

1- General information
Tools, also called models, uses XML files that contain relatively simple code, easy to read and to understand.

The files are located in the ''tools'' folder inside the ''Blockscape'' installation folder.
The tools is what you use in the game, it's nearly everything there is to place in the menus. Tools like a hammer is a tool among others. Some tools like the sculpt tool are hardcoded, and therefore are not in the XML format. I will not talk about these hardcoded tools that includes : sculpt, fluid, material paint, slope, cylinder, push/pull, smooth ; according to Jmane2009 (there are possibly others tools too).

XML can be created and edited using almost any text editor. Notepad does a pretty good job.
Or you can edit it with Blockscape edit made by aarghm : viewtopic.php?f=10&t=2614
it's good for visualization but if you want more advanced features and newer stuff, you will have to edit the file manually.

You can create a model from something you have built in the game:
Stand close to it and press CTRL+ S. This will create a file named blockmodeldump.xml located in the C:\Users\(your username)\AppData\Roaming\Blockscape. Be sure that you don't have other blocks near it before saving because they might get saved as well and you are at risk of exceeding block limit for the tool. Right now, the maximum size for tools is 32x32x32 small blocks (in the text editor it will show 31 because 0 count as the first block). So the theorical limit is 32 768 blocks in one tool but be advised that a file so big is likely to make the game crash. By experience, XML files exceeding around 700 kb are more likely to crash depending on the memory usage of your computer.

*Also be aware that fluids like fire, seems to make the files much bigger and more prone to crash even if the number of blocks is smaller.
2- Structure of the XML file
<model>
  • <name>
  • <description>

  • <usage>
    This will determine what the tool is supposed to do and where the tool will appear in the menus, and also other characteristics such as how NPC will interact with it. Most blocks using for building have no specific usage.

    crafting_station, door, generator, seed.
    arms, feets , hand_left, hand_right, head, legs, torso,
    helmet, sword (seems to include weapon and tool)

    used by npc:
    • bed : adding a bed will spawn an npc
    • shelf: npc will use the material on the shelf
    • table: put the food of the npc on it, otherwise they will starve
    • window: indicate where npc will build windows
    • zone: will tell npc where to build the roof

  • <efficiency> between 0 and 1
    An example of this would be that the iron weapon is more efficient than the bronze weapon or the wooden stick. I just wonder if there is a difference between the efficiency of a weapon and one for a tool like a fishing rod.

  • <efficience_influence>
    Set how much the part efficiency influence the efficiency of the entire tool

  • <efficience_from>
    Sets which material property that dictates the efficiency of this part

  • <efficiency vs="0">0.3</efficiency>
    Incomplete, see thread: viewtopic.php?f=9&t=5618&p=30196&hilit=efficiency+vs#p30196



  • <pivot position>
    This determines the pivot point.
    In theory, when you hit, the weapon moves forward, the pommel backward. Seems simple but modifying it does not produce the expected result. Or maybe I misunderstood?

  • <rotate y> (for tool/weapon)
    Put the object in hand at a specific angle for those who like to hit with the flat side of the sword.



  • <model interactive> (for tree and mushroom as of now)
    0 player can’t change model state by clicking on it. You can only delete it.
    1 is the default value

  • <collide>
    If the cursor/model should collide against the surrounding. default is 1

  • <explode_on_delete>
    If set to 1 model will explode and inventory handling on block level will be activated

  • <corner_model_hack>1</corner_model_hack>
    No ideas what this does

  • <inverty>1</inverty>
    Make it possible to place a model upside down. Default is 0.

  • <anyrotation>1</anyrotation>
    Can be aligned on any axis (not sure what this does exactly)



  • <Material id>
    See materials.csv for material list in the main Blockscape folder

    If the material id is specified in the beginning, all blocks will be of the same id. It will not be possible to have more than one material for this model.

    It’s possible to have a choice between different materials by listing them separately or with
    <material_group id=> Bark, Castmetals, Glass, Leaves, Light, Metal, Normal, Plastic, Refinedmetals, Water, Wood
    Adding a group will allow the player to select any type of material of that group for the creation of the model. But only one material at a time.

    If the model uses a combination of different materials, don’t specify a material id in the beginning but add the material to the specific block.
    In that case, you can use as many materials as you like while the above are limited to only one at a time.

    You can combine material block and unspecified material for greater variety.
    Example: A wooden wall with colors. Only the wood is a specified material so you can change the material of the other part to your liking.



  • Block type : from the russian wiki : http://wiki.blockscape.pro/index.php/ID ... 0%BE%D0%B2



  • State and tool (differences between the two)
    • <State id>
      Active models with different states possible
      Multiple states mean the object will change upon activation (by touching or electric activation)
      State id start at 0 (limit of possible state is unknown)
      Object placed can be deleted as a whole

    • <Tool size>
      Static models with different size possible
      Tool can have different size or different objects included in the same tool xml. The standard cube is a good example of that.
      Tool size start at 1 (possible values 1,2,4)
      Blocks need to be deleted one by one


    • <part id> (support for multiple materials)
      Part belonging is specified with the part attribute for each block, material and material_group (if no part is specified it defaults to 0) Materials can be specidied in the part tag
      Added support for multi material block types. See pickaxe head.
      *I really don’t understand what this does


    • <sun_light_min> (Default is 0. the state model can only move to the state if sunlight is _more_ than or equal to this value)
    • <sun_light_max> (Default is 1. the state model can only move to the state if sunlight is _less_ than or equal to this value)


    • < time> Time before changing state.
      *How long is 1 unit ?

    • <time_increment> lets you specifiy conditions for time increments on a state



    • position= position of the block inside the model x,y,z (from 0 to 31)


    • fluid_type: include fire and water and window ?
    • fluid_value: not sure what this is for



    • edge="65,127,127,127" (example) when the block uses smooth surfaces.

    • corner="1" I suppose it’s the same as above

    • mat_axis (specifies material axis alignment when material is not specified)
      0/1 not sure what this mean and only some models have it

    • exclude_from_bounding_box="1" (door)
      again, I’m not sure



    • <bone id="9"> serve to determine animation of the different body parts
      1
      2
      3
      4
      5 butt
      6
      7
      8
      9 tigh right
      10 tigh left
      11
      12 leg right
      13 leg left
      14 right foot
      15 left foot
      16



    • Mirror and cache geometry on request (model data): this does not appear in any of the XML files but it look like a cool feature added some snapshots ago.


    • <icon> with plant (not sure what this mean)
Notes
1- on <rotate y> and <inverty> : you cannot invert the x or z because only inverty exist
2- Some elements of the code were simplified to make things easier to read.
3- Some propriety, I have no idea what they do so if anyone knows, feel free to share your knowledge. And also feel free to tell me what you think of the guide in general.

{LINK REMOVED}
7 Comments
Valerie Rosenwoods 4 Oct, 2018 @ 3:08pm 
Very cool, thank you! this would be interesting to mess around with sometime hehe.
Wrsaith 16 Sep, 2016 @ 12:40am 
ok thanks vincentlocas i was begining to think I was totaly missing something and I was XD
vincentl  [author] 14 Sep, 2016 @ 8:07am 
Lastly, future updates are likely to undo the modifications done, especially for the mod.xml. Everytime there is an update, you will have to reenter the codeline(s). A solution would be to make a copy of the whole BS folder elsewhere so it is not affected by updates, but you won<t have acces to the new content.
vincentl  [author] 14 Sep, 2016 @ 8:04am 
The other problem is that the number of tols is limited ingame. Since it<s not possible to scroll, it won<t appear unless you get rid of the already existing ones. I believe that simply moving them temporarly into a subfolder is enough.
vincentl  [author] 14 Sep, 2016 @ 8:02am 
@Wrsaith the guide is outdated. In order to make the tools appear, you also need to add a codeline to mod.xml. There are four of them located in the mods forlder of Blosckape. I presume each subefile is for the different mode of the game. So if you ewant the tools to appear in all modes, you need to edit the 4 xml files. The line of code should look like <tool file="sapling_spruce"></tool> but replace sapling_spruce with the name of the tool you want to add.
Wrsaith 13 Sep, 2016 @ 10:16pm 
none of my tools even ones made of just simple stone shapes show up in game. affter i ctrl +s and rename the xml, then drop it into the tools folder. what should i do?
Dave Mo 23 Aug, 2014 @ 6:07am 
tool i created only works in just build mode
not in play the game
can i do something about it