WorldEdit

Discussion in 'Plugin Release Discussion' started by MarioE, Jul 28, 2012.

Thread Status:
Not open for further replies.
  1. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    Description:
    • Allows for mass modification of tiles. Any data is stored in the worldedit folder, including clipboards, schematics, and redo/undo data.
    Permissions:
    Commands:
    • //all - Selects the entire world.
    • //biome <biome1> <biome2> - Converts all of the tiles in the selection that correspond to the first biome to the tiles that correspond with the second biome.
    • //copy - Copies the selection to the clipboard.
    • //cut - Cuts the selection into the clipboard.
    • //drain - Drains liquids from the selection.
    • //fixgrass - Fixes suffocated grass in the selection.
    • //fixhalves - Fixes covered half blocks in the selection.
    • //fixslopes - Fixes covered slopes in the selection.
    • //flip <direction> - Flips the contents of the clipboard. <direction> can contain any amount of X's and Y's; each occurrence will flip the direction. E.g., XXYY would leave the clipboard unchanged.
    • //flood <liquid> - Floods the selection with a liquid.
    • //mow - Mows grass, thorns, and vines in the selection.
    • //near <radius> - Selects an area around you.
    • //paint <color> [=> boolean expr...] - Paints all of the tiles in the selection. You can use "blank" to remove paint.
    • //paintwall <color> [=> boolean expr...] - Paints all of the walls in the selection. You can use "blank" to remove paint.
    • //paste [alignment] [=> boolean expr...] - Pastes the clipboard to the first point. The alignment specifies the paste "direction" -- it can be l, r, t, b, or a combination of those letters. For example, //paste rb would paste as if the first point were the right-bottom.
    • //point1 [x] [y] - Sets the first point of the selection.
    • //point2 [x] [y] - Sets the second point of the selection.
    • //redo [steps] [account] - Redoes that many actions for the account, if possible.
    • //region [name] - Selects a region to perform actions on.
    • //resize <direction(s)> <amount> - Resizes the selection -- you can specify multiple directions.
    • //rotate <degrees> - Rotates the clipboard's contents by the specified angle, in degrees. Only multiples of 90 are accepted.
    • //schematic - Schematic commands:
      • //schematic delete <name> - Deletes the specified schematic if possible.
      • //schematic help - Lists all schematic commands.
      • //schematic list [page] - Lists the available schematics.
      • //schematic load <name> - Loads the specified schematic to the clipboard if it exists.
      • //schematic save <name> - Saves the contents of the clipboard to the specified schematic.
    • //select <selection type> - Sets the way that tiles are selected. Valid arguments include: altcheckers, checkers, ellipse, normal, and outline.
    • //set <tile> [=> boolean expr...] - Sets all of the tiles in the selection to <tile>.
    • //setwall <wall>[=> boolean expr...] - Sets all of the walls in the selection to <wall>.
    • //setwire <wire> <state> [=> boolean expr...] - Sets all of the wire states in the section.
    • //shift <direction(s)> <amount> - Moves the selection -- you can supply multiple directions.
    • //undo [steps] [account] - Undoes that many actions for the account, if possible.
    Some commands accept boolean expressions, allowing you to change the conditions of the command. These variables exist:
    • tile (t) - Can function as boolean if used by itself: e.g., => tile checks if there is a tile, => tile = dirt checks if the tile is dirt.
    • tilepaint (tp) - Can function as boolean if used by itself, see above
    • wall (w) - Can function as boolean if used by itself, see above
    • wallpaint (wp)- Can function as boolean if used by itself, see above
    • honey
    • lava
    • liquid
    • water
    • wire
    • wire2
    • wire3
    You could paint all wood tiles with walls green with //paint green => tile = wood & wall, set green-painted tiles without walls to lava with //set lava => tilepaint = green & !wall, set dirt and wood to honey with //set honey => tile = dirt | tile = wood, and so on.

    Links:
     
    • Like Like x 12
    • Winner Winner x 1
    • Useful Useful x 1
    #1 MarioE, Jul 28, 2012
    Last edited by a moderator: May 26, 2015
  2. Wolfe

    Wolfe Level 9

    Joined:
    Jan 3, 2012
    Messages:
    386
    This sounds pretty useful. Thanks for making it.
     
  3. Ijwu

    Ijwu Level 11

    Joined:
    Apr 4, 2012
    Messages:
    647
    Is the undo on that just for the last action, or does it keep a history?
     
  4. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    It keeps an infinite history, basically.
     
    • Like Like x 3
  5. Alrof

    Alrof Level 4

    Joined:
    Jul 30, 2012
    Messages:
    63
    i can imagine this happening

    /all
    /cut

    you should rename the /all to /scall

    because housing dis uses a /all command
     
  6. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    • //all - Selects the entire world.
    • //all - Selects the entire world.
     
    • Like Like x 3
  7. Alrof

    Alrof Level 4

    Joined:
    Jul 30, 2012
    Messages:
    63
    does it have to have

    two "/" before the command?
     
  8. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    Yes.
     
    • Like Like x 1
  9. Wight

    Wight Administrator
    TShock Admin TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    May 20, 2012
    Messages:
    1,597
    Tested a bit... So far, //shift doesn't seem to be working :/
     
  10. chafoux

    chafoux Level 1

    Joined:
    Sep 16, 2012
    Messages:
    5
    Awesome plugin for make Hellavator , thank's dude ! :D
     
  11. radishes

    Plugin Developer

    Joined:
    Dec 30, 2011
    Messages:
    148
    Very cool, and working well in my initial tests.
     
  12. radishes

    Plugin Developer

    Joined:
    Dec 30, 2011
    Messages:
    148
    This plugin is very neat. Thanks MarioE :D

    I've been working on adding a new function to the plugin: random maze generation. I've come up with a rendition of the recursive backtracker maze algorithm and incorporated it into WorldEdit.

    I selected an entire small world with //all, filled it in with //set, and then carved a maze with the new command //maze. It took a couple of minutes to run with such a large selection area, but it completed without problems:

    [​IMG]

    Of course this is a bit of an extreme example, but the mazes look pretty much the same at any size.

    I'll post a version here for download when it's more polished. I'd really like to add more maze generation algorithms, so that you can select which one to use for a given maze. I'm sort of figuring out C# as I go, so it's slow progress and bad code everywhere :p
     
    • Like Like x 3
    • Creative Creative x 1
  13. Wight

    Wight Administrator
    TShock Admin TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    May 20, 2012
    Messages:
    1,597
    Holy crap that's a big maze XD
     
  14. popstarfreas

    Plugin Developer

    Joined:
    Feb 27, 2012
    Messages:
    357
    What do you get if you win the maze?
     
  15. radishes

    Plugin Developer

    Joined:
    Dec 30, 2011
    Messages:
    148
    [​IMG]

    I've got the maze generator working at a basic level.

    Gallery of sample maze screenshots: http://imgur.com/a/WLNth

    Use
    1. Select an area for the maze with //point 1 and //point 2
    2. Fill the area with your desired tile with //set (and optionally set a wall with //setwall). The maze algorithm carves a tunnel through the selected area, and may give unpredictable results if the selected area is not solid tiles.
    3. Stand in or immediately adjacent to the selected area. The tunneling process starts near where you're standing when you execute the //maze command. If you're not standing at the selected area, nothing will happen.
    4. Enter the //maze command. Make sure to specify a tunnel width of at least 3 if you want people to be able to navigate the maze.
      • //maze <tunnel_width> <wall_width>
      • Example: //maze 3 2
    5. You should now have a randomly-generated maze in the selected area.
      • If a very large area is selected, there may be a significant delay in maze creation. I selected an entire small world using //all and it took a few minutes to create the maze.
      • If maze creation failed, try digging into the selected area a bit and running the command again.
      • If you don't like what happened, do //undo and try again.
    Beta DLL: https://github.com/downloads/radishes/WorldEdit/WorldEdit.dll
    Source: https://github.com/radishes/WorldEdit

    Important note: Debug functionality is enabled in this build of the plugin. Each time the //maze command is run, details of maze creation are output to maze_debug.txt in the root tshock directory. This file can quickly reach several MB in just one run of //maze, and continues to grow with each run! You can delete this file any time :)
     
    • Like Like x 2
  16. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    Very nice, I like it. :)
     
  17. Marcus101RR

    Banned

    Joined:
    Sep 16, 2012
    Messages:
    220
    Question #1: How do you spawn a mob with a sub number? Such as green slime or the other slimes, assuming the name don't work?
    Question #2: How to spawn/replace Gold Chest with Locked Golden Chest after storing items into it? Or is TEdit3, the only way?
     
  18. SUNNYSIDE11

    SUNNYSIDE11 Level 0

    Joined:
    Oct 30, 2012
    Messages:
    4
    This plugin is AMAZING!:)
     
  19. Squadeep

    Squadeep Level 0

    Joined:
    Nov 4, 2012
    Messages:
    1
    Excellent plugin, I added a Pull Request on the GitHub page for region support to contribute my piece =)
     
  20. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    Thanks! Polished up some of that code, and it's official now.
     
Thread Status:
Not open for further replies.