Lost Adventurer, Aleks Kirilenko (3D)
LC #42 Pipers Alley

View Full Version : Max Script Error solution...

01-27-2009, 07:12 PM
Hello all....
I decided to start learning max script. Some days back I came across a tutorial to make a Xray shader material. So I decided to follow it. The code is given below
plugin material xray_shader
extend: Standard replaceGI:true
parameters main rollout:params
Transparency type:#float default:100 ui:trans
Color type:#color default:[203,232,255] ui:col
Le type:#float default:1.8 ui:output
two type:#boolean default:false ui:twoside
inpurity type:#float default:0 ui:distort
imp_scale type:#float default:1.0 ui:purity_scale
ON Transparency SET VAL DO delegate.opacityFallOff = VAL
ON Le set val do delegate.diffuseMap.map1.output.Output_Amount = val
on Color set val do delegate.diffuseMap.red = val
on two set val do delegate.twoSided = val
on imp_scale set val do delegate.selfillumMap.map2.size = val
on inpurity set val do delegate.selfillumMap.map2Amount = val
rollout params "X-RAY | base features version |"
bitmap logo_sea "Bitmap" pos:[6,5] width:313 height:61 filename:"E:\Beast_On_Fire_1440 x 900 widescreen.jpg"
group "X-RAY base Parameters"
colorpicker col "X-density color (dc)" align:#left offset:[0,0]
checkbox twoside "2-sided vision" align:#center offset:[210,-23]
spinner output "Light emission (le):" align:#left range:[1.0,50.0,1.0] fieldwidth:45 offset:[0,0]
spinner trans "Transparency:" align:#right fieldwidth:45 offset:[-90,0]
spinner distort "inpurity amt:" fieldwidth:45 offset:[-90,0] range:[0.0,100.0,0.0]
spinner purity_scale "inpurity scale" fieldwidth:45 offset:[-90,0] range:[0.01,500.0,0.1]
on create do
delegate.shaderType = 4
delegate.specularLevel = 0
delegate.glossiness = 0
delegate.opacityFallOffType = 0
delegate.opacityFallOff = 100
delegate.difuseMap = RGB_Tint()
delegate.diffuseMap.red = [112,193,255]
delegate.diffuseMap.green =[0,0,0]
delegate.diffuseMap.blue = [0,0,0]
delegate.diffuseMap.map1 = output()
delegate.selfillumMapEnable = on
delegate.selfillumMap = falloff()
delegate.selfillumMap.type = 2
delegate.selfillumMap.ior = 3.8
delegate.selfillumMapAmount = 100
delegate.selfillumMap.map2 = Noise()
delegate.selfillumMap.map2.size = 1
delegate.selfillumMap.map2Amount = 0
delegate.selfillumMap.map2on = on
delegate.selfillumMap.map2.thresholdHigh =0.615
delegate.selfillumMap.map2.thresholdLow =0.275
delegate.selfillumMap.map2.color1 = [155,155,155]


Now the problem is that when i try to evaluate or run the script i get the following error msg.

-- Error occurred in anonymous codeblock; filename: E:\Backups\GTA\xray.ms; position: 71
-- Syntax error: at ),, expected <factor>
-- In line: classID:(0x82b4cdc2,0

I generated the classID by using the random generating command in 3ds max itself....

Could someone point out where i am going wrong. As i mentioned this was my first try at scritping.

Any help much appreciated...
And thanks to all in advance..

01-28-2009, 09:17 AM
Try to write this piece

plugin material xray_shader
extend: Standard replaceGI:true


plugin material xray_shader name:"XRAY SHADER" classID:(0x82b4cdc2,0x4f77873e) extend:Standard replaceGI:true

or like

plugin material xray_shader \
name:"XRAY SHADER" \
classID:(0x82b4cdc2,0x4f77873e) \
extend: Standard replaceGI:true

Maxscript interperter reads lines and the plugin statement should be defined on a single line or with the \ , meaning the next line belongs to the previous line.


And after actually trying it, your no passing an array to the classID parameter, it should be

P.s. Please format your code in the code blocks next time (it's the # button on the toolbar).

CGTalk Moderation
01-28-2009, 09:18 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.