Notifications
Clear all

[Closed] Can you evaluate my script?

Hey everyone im really new to maxscript and have been playing around with creating one that produces favela type geometry on a hillside in a stepped manner.

I know the script is terrible but im here to learn so would appreciate any pointer in developing it for the better, thanks for your time

Script:

Favela = box length:10 width:10 height:10

-- Create 5 iteration along the Y Axis
for i = 1 to 5 do
(
	box_copy = copy Favela
	box_copy.pos = [0, i*20, 0]
)

select objects

macros.run "Modifier Stack" "Convert_to_Poly"

-- attach Objects, Courtesy of Chris Gray, CG Society
(
	while selection.count > 1 do
	(
		selcount = selection.count
		for i = selcount to 2 by -2 do
		(
			polyop.attach selection[i] selection[i-1]
		)
	)
	update selection[1]
)

select objects

for i = 1 to 5 do
(
	box_copy = copy $
	box_copy.pos = [i*20,0,i*20]
)

--Select Box and Move to position 0,0,0
select $Box006
$.position = [0,0,0]

select objects

-- Attach objects, Courtesy of Chris Gray, CG Society
(
	while selection.count > 1 do
	(
		selcount = selection.count
		for i = selcount to 2 by -2 do
		(
			polyop.attach selection[i] selection[i-1]
		)
	)
	update selection[1]
)

-- Select Sub-Object level: Polygons
subobjectLevel = 4
	
-- Select Random Faces
PolyToolsSelect.Random 1 60 0 false

-- Extrude Selected Faces	
$.extrusionType = 2
$.faceExtrudeHeight = 10
$.EditablePoly.buttonOp #Extrude

select objects

-- Select by normal -Z
polyToolsSelect.Normal 3 90 true 

-- Inset selected faces
$.insetType = 1

$.insetAmount = 3.93701
$.EditablePoly.buttonOp #Inset

-- Extrude selected faces
$.faceExtrudeHeight = 19.685

$.EditablePoly.buttonOp #Extrude

-- Delete selected faces

actionMan.executeAction 0 “40020”
max delete
$.EditablePoly.delete #Face