Auto-pillar script for mappers:
Be sure to edit line 58 of the script to change the bind to the key of your choice, otherwise you'll see an error about unknown key 'KEY' on startup.
There is a menu to make things easier, use the:
...command or your keybind to view the menu. From here you can set the size of the pillar, decide whether or not to automatically corner it, and actually create the pillar. If you prefer to use commands:
...is the command used to automatically create the pillars. It only requires 1 arugment, the size, and the only valid arguments currently are 4 (4x4 pillar), 6 (6x6 pillar), or 8 (8x8 pillar) until other sizes are suggested/requested.
The command obviously only works while in edit mode, and therefore the menu will only be useful then as well (unless you're just settings some defaults for later). It has NOT yet been tested in coop edit and so if anyone tries it let me know how it goes. HF, enjoy. :)
[SELECT ALL] Code:
// Auto-pillar script for mappers by DES|Bukz
if (checkalias auto_pillar_corner) [] [alias auto_pillar_corner 0]
alias makepillar [
if $editing [
if (= $arg1 4) [
x_sel = (- $selx 2); y_sel = (- $sely 2)
select $x_sel $y_sel 4 4; solid 1
select $x_sel $y_sel 1 1; if $auto_pillar_corner [corner] []
+= x_sel 3; select $x_sel $y_sel 1 1
if $auto_pillar_corner [corner] []; -= x_sel 3
+= y_sel 3; select $x_sel $y_sel 1 1
if $auto_pillar_corner [corner] []; += x_sel 3
select $x_sel $y_sel 1 1; if $auto_pillar_corner [corner] []
] [
if (= $arg1 6) [
x_sel = (- $selx 3); y_sel = (- $sely 3)
select $x_sel $y_sel 6 6; solid 1
select $x_sel $y_sel 1 1; if $auto_pillar_corner [corner] []
+= x_sel 5; select $x_sel $y_sel 1 1
if $auto_pillar_corner [corner] []; -= x_sel 5
+= y_sel 5; select $x_sel $y_sel 1 1
if $auto_pillar_corner [corner] []; += x_sel 5
select $x_sel $y_sel 1 1; if $auto_pillar_corner [corner] []
] [
if (= $arg1 8) [
x_sel = (- $selx 4); y_sel = (- $sely 4)
select $x_sel $y_sel 8 8; solid 1
select $x_sel $y_sel 1 1; if $auto_pillar_corner [corner] []
+= x_sel 7; select $x_sel $y_sel 1 1
if $auto_pillar_corner [corner] []; -= x_sel 7
+= y_sel 7; select $x_sel $y_sel 1 1
if $auto_pillar_corner [corner] []; += x_sel 7
select $x_sel $y_sel 1 1; if $auto_pillar_corner [corner] []
] [echo make_pillar only allows 4, 6, or 8 as an argument.]
]
]
] []
]
newmenu [Auto Map Commands]
menuitemvar [concat (c 2)Pillars] [showmenu "Pillars"]
menuitem [ OK] [closemenu "Auto Map Commands"]
if (checkalias pillar_size) [] [pillar_size = 4]
newmenu [Pillars]
menuitemslider [Size: ] 4 8 [$pillar_size] 2 ["small (4x4)" "" "medium (6x6)" "" "large (8x8)"] [pillar_size = $arg1]
menuitemcheckbox [Automatically corner pillars?] [$auto_pillar_corner] [auto_pillar_corner = $arg1]
menuitem [] -1
menuitemvar [concat (c 1)Make pillar!] [makepillar $pillar_size]
menuitem [] -1
menuitem [ OK] [closemenu "Pillars"]
alias mapcom [showmenu "Auto Map Commands"]
// Change "KEY" to whatever key you want to use for viewing the menu
bind KEY [mapcom]
docsection [Auto Map];
docident [makepillar] [Automatically creates a square pillar of the given size.];
docargument [S] [The size of the pillar: 4, 6, or 8];
docexample [/makepillar 4] [Creates a 4x4 pillar centered over the current selection.];
docremark [If auto_pillar_corner is set to 1, the resulting pillars will have automatically cornered corners.];
docident [mapcom] [Shows the "Auto Map Commands" menu.];
Be sure to edit line 58 of the script to change the bind to the key of your choice, otherwise you'll see an error about unknown key 'KEY' on startup.
There is a menu to make things easier, use the:
[SELECT ALL] Code:
/mapcom
...command or your keybind to view the menu. From here you can set the size of the pillar, decide whether or not to automatically corner it, and actually create the pillar. If you prefer to use commands:
[SELECT ALL] Code:
/makepillar
...is the command used to automatically create the pillars. It only requires 1 arugment, the size, and the only valid arguments currently are 4 (4x4 pillar), 6 (6x6 pillar), or 8 (8x8 pillar) until other sizes are suggested/requested.
The command obviously only works while in edit mode, and therefore the menu will only be useful then as well (unless you're just settings some defaults for later). It has NOT yet been tested in coop edit and so if anyone tries it let me know how it goes. HF, enjoy. :)