Implementation Structure Templates

Discussion in 'Modules' started by Florian, May 19, 2016.

  1. Florian

    Florian Active Member

    I pushed a new version that contains a new "Toolbox" item.

    • It can be obtained via the command "give toolbox"
    • It is intended to provide tools for structure template creation in future
    • For now however it already offers you a way to get blocks
    • Shapeless blocks can be obtained in any wished shape
    • It works in multiplayer (In my quick test at least)
    • It uses tree view component @rzats made in GSOC
    • Like Like x 2
    • Winner Winner x 2
  2. Florian

    Florian Active Member

    I pushed up a new version:
    • The toolbox contains now also a structure spawner for each type of structure template known.
    • The toolbox root node is now expanded by default.
  3. Florian

    Florian Active Member

    I pushed up a new version:
    • The toolbox offers now "Structure Template" items for each structure template.
    • Those new items can be used to place the blocks of structure template and obtain a structure template editor item that edits that structure.
    • The "Structure Spawner" items are still also in the toolbox and work as before.
    • Like Like x 1
  4. Florian

    Florian Active Member

    I finally pushed the new template editor work I was working in the last weeks to the master branch.

    Since it is a big change with the chance to break existing stuff I increased the version number to 0.2.0-SNAPSHOT.

    The following has changed:
    • The structure template editor gets no longer accessed via a item, but via a block that marks the origin of the structure template. It is the block with the T in the following screenshot:


    • When you use the structureTemplateGenerator item, the target block will be replaced by the structure template origin marking block.
    • The structure template origin block can be activated by pressing E to show the editor UI. It looks like this:
    • The region where from which blocks get copied does no longer need to be specified manually. Instead the origin block UI offers you a option to record any block placement.
      • When you place a block while that option is active any block you add with extend the tracked region by the position of the placed block.
      • When you remove a block while that option is active, the position of the removed block will be removed from the tracked region
      • That means that the tracked region can become any size
      • The option is called "Update region on block placement" and is currently at the bottom of the screen that shows up when you E click the origin.
      • The region of the template remains highlighted and the block tracking continous even if you close the UI. To stop tracking you need to open the UI again and uncheck the option.
      • One way to track air placement for now is to first add the blocks and then unckeck the option to track block addition. If you then remove the blocks the air will be copied that is there now.
      • Theoretically it will be possible in future for multiple players to work on the same structure
    • It is still possible to explicitly set a copy region of a specified size.
      • If you have already a non box-shaped region then the default of that region will the boundings of that region.
      • So if you want a box-shaped region, you can first activate the option to track block placements, place 2 blocks in the corner and then make the box-shaped region marked by that 2 blocks the tracked region.
      • The button for this option is called "Make edit region box-shaped"
    • The origin block UI also provides a button called "Selected -> Clipboard"
      • This button copies the complete JSON for the created structure template to the clipboard.
      • The basic template data (type and spawnChance) get also included. It can be adjusted via a "Edit STructure TEmplate Properties" button
      • The generated JSON also will include item additions to chests.
        • e.g. if you place items in a chest and then copy the JSON then the structure template that template describes will create a chest with the exact items you put in it.
        • It currently works for block items and for unmodified items based on prefabs.
      • Structure spawns will also be copied from the places structure placeholders (see next item for more info)
    • Structure template placeholders blocks can now be used to mark locations in the template where other structures should spawn.
      • The block with the s inthe following screenshot is a structure template placeholder
        • The screenshot shows a left turn corridor of gooey's quest.
        • The next room will appear with a rotation to the left as the structure template placeholder is rotated left.
        • The next corridor spawn origin will be at the block below the s marker.
      • The structure template placeholder block offers a minimalistic UI when you E click it that allows you to select the structure that should spawn.
      • The structure template place holders get automatically placed when you place a structure template (not structure spawner) from the toolbox item.
      • I suggest you have a look at existing templates to get a feel for them
      • The item can be obtained for now with the "give StructurePlaceholder" command but it will be added later on to the toolbox item UI.
    • The "Create Structure Spawner" button of the structure template orign block gives you now a structure spawner that includes the same features like the genreated JSON.
      • The generated structure spawner will place items in chets
      • The generated structure spawner will spawn additional structures if your template region included structure placeholders
    • There is now also a button for copying a "is underground" condition
      • It copies a JSON string to clipbard that represents for the structure template the condition that it is underground. You can then manually paste it in a template
      • The exact condition is that the regions the template + 1 block layer above are solid blocks
    • The structure template origin block can be replaced without loosing the marked regions or other data.
    • Structure templates get now also always copied with the correct relative rotation. The "front" and "position" field have been removed from the StructureTemplate component as this manual correction is no longer needed.
      • Existing templates with a "front" field value != FRONT need to be adjusted. This is however simple as you can just place the structure template and fix the rotation of the origin block. Then you just need to copy the new JSON over the old.
    • Winner Winner x 3
    • Informative Informative x 1
    Last edited: Jan 28, 2017
  5. Florian

    Florian Active Member

    I pushed some new changes to the repository:
    • The toolbox has now a "Structure Template Tools" node
    • The structure template generator has a new icon
    • Like Like x 1

Share This Page