take measurements to create arch prefabs from existing maps
The arch menu now allows * editing all vertices instead of only half of them, for non-symmetrical arches * deleting saved custom arches * using custom arches for other widths than what they were created for * measuring an arch on a map and creating a prefab of it Scripts: av_measure "echo (av_measure)" prints the list of vdelta values of a selected arch. Only works as expected, if the selection is only 1 cube wide. To use the measurements to create a width 8 arch, select 8x1 cubes under the arch to copy and type "av 8 (av_measure)". Or use the menu. av width-1 vdelta_list One of the oldest scripts of the game (and because of that, the first argument stayed "arch width minus one", for compatibility reasons). Creates a prefab arch of the desired width. If the list has exactly as many entries as required, all of them are used to create the prefab - this is the way the script has always worked. If there are too few or too many elements in the list, the script will try to take half the required values from the list and mirror the other half to create a symmetrical arch. This way, a list can be used for slightly wider or narrower archs. Or use the menu.
This commit is contained in:
+30
-3
@@ -128,7 +128,7 @@ menuinit [
|
||||
newmenu "Edit arch"
|
||||
menuinit [
|
||||
resetcurmenu
|
||||
menuheader "" (concat "edit arch width" $__pickarch)
|
||||
menuheader "" (concat "edit arch width" $__pickarch "(symmetrical)")
|
||||
push ii ""
|
||||
loop i (div $__pickarch 2) [
|
||||
ii = (+ $i 1)
|
||||
@@ -136,14 +136,41 @@ menuinit [
|
||||
]
|
||||
pop ii
|
||||
menuitem "" -1
|
||||
menuitem (concat Measure selection for width $__pickarch arch) (concat av (- $__pickarch 1) "(av_measure)")
|
||||
menuitem "Edit full arch (non-symmetrical)..." [ showmenu "Edit full arch" ]
|
||||
menuitem "Restore arch of different size (ymmv)..." [ showmenu "Pick custom arch" ]
|
||||
menuitem "Delete saved custom arch..." [ showmenu "Delete custom arch" ]
|
||||
menuitem "" -1
|
||||
tempalias __archname custom
|
||||
looplist (enumalias (concatword _arch_ $__pickarch _)) [fn sn] [
|
||||
if (= (+ (listlen $$fn) 1) $__pickarch) [
|
||||
__archname = $sn
|
||||
menuitem (concat restore $sn " " $$fn) (concat av (- $__pickarch 1) (escape $$fn))
|
||||
menuitem (concat Restore $sn " " $$fn) (concat av (- $__pickarch 1) (escape $$fn))
|
||||
]
|
||||
]
|
||||
menuitemtextinput "save arch as " "result $__archname" (concat __archname "= $arg1 ; (concatword _arch_"$__pickarch "_ $arg1) = (__listarch" $__pickarch ")" ) "" 250
|
||||
menuitemtextinput "Save arch as " "result $__archname" (concat __archname "= $arg1 ; (concatword _arch_"$__pickarch "_ $arg1) = (__listarch" $__pickarch ")" ) "" 250
|
||||
]
|
||||
|
||||
newmenu "Edit full arch"
|
||||
menuinit [
|
||||
resetcurmenu
|
||||
menuheader "" (concat "edit arch width" $__pickarch "(non-symmetrical)")
|
||||
loop i $__pickarch [
|
||||
if $i [ menuitemslider (concat vertex $i "\t") 0 31 (archvertex $__pickarch $i) 1 [] (concat archvertex $__pickarch $i "$arg1") ]
|
||||
]
|
||||
]
|
||||
|
||||
newmenu "Pick custom arch"
|
||||
menuinit [
|
||||
resetcurmenu
|
||||
menuheader "" (concat "pick custom arch for width" $__pickarch)
|
||||
looplist (enumalias _arch_) [fn sn] [ menuitem (concat Use "\fs\f2" $sn $$fn "\fr " as width $__pickarch arch) (concat av (- $__pickarch 1) (escape $$fn)) ]
|
||||
]
|
||||
|
||||
newmenu "Delete custom arch"
|
||||
menuinit [
|
||||
resetcurmenu
|
||||
looplist (enumalias _arch_) [fn sn] [ menuitem (concat Delete custom arch "\fs\f2" $sn "\fr" $$fn) (concat delalias (escape $fn)) ]
|
||||
]
|
||||
|
||||
newmenu skymaps
|
||||
|
||||
+22
-3
@@ -5,10 +5,20 @@
|
||||
persistidents 0
|
||||
|
||||
const av [
|
||||
loop i $arg1 [
|
||||
archvertex (+ $arg1 1) (+ $i 1) (at $arg2 $i)
|
||||
]
|
||||
push vn (+ $arg1 1)
|
||||
if (= (listlen $arg2) $arg1) [
|
||||
loop i $arg1 [
|
||||
archvertex $vn (+ $i 1) (at $arg2 $i)
|
||||
]
|
||||
][
|
||||
loop i (div $vn 2) [
|
||||
archvertex $vn (+ $i 1) (at $arg2 $i)
|
||||
archvertex $vn (- $vn (+ $i 1)) (at $arg2 $i)
|
||||
]
|
||||
]
|
||||
pop vn
|
||||
]
|
||||
|
||||
av 1 "2"
|
||||
av 2 "4 4"
|
||||
av 3 "5 6 5"
|
||||
@@ -27,4 +37,13 @@ av 15 "8 13 16 18 19 19 19 19 19 19 19 18 16 13 8"
|
||||
|
||||
// add wider arches here! :)
|
||||
|
||||
const av_measure [
|
||||
push ii ""
|
||||
selectionwalk [ ii = (concat $ii $sw_vdelta) ] [ if (&& (!= (at $sw_cursel 2) 1) (!= (at $sw_cursel 3) 1)) [ echo "using wide selections may lead to weird measurements..."] ]
|
||||
push offs (at $ii 0)
|
||||
push res ""
|
||||
loop i (listlen $ii) [ if $i [ res = (concat $res (- (at $ii $i) $offs)) ] ]
|
||||
result (pop res offs ii)
|
||||
]
|
||||
|
||||
persistidents 1
|
||||
|
||||
Reference in New Issue
Block a user