Notifications
Clear all

[Closed] Script works fine on 2011 not on 2009

just like it says…my friend created a mse script for me where it works fine in his max 2011 but not on my max 2009…when i run the script it shows something like syntax error…any idea why??

11 Replies

 	on roll open do
 	(
 		btn.enabled = false
 		(
 			if (something is here) !=  undefined then
 			(
 				btn.enabled = true
 			)
 			case btn.enabled of
 			(
 				true : btn.tooltip = "You got it"
 				false : btn.tooltip = "oops..sorry man..come to me this evening"
 			)
 		)
 	)
 )

will this structure work in Max2009 or is it something new to Max 2011

no one???

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

post full code and get the answer. If you like to have the code encrypted ask your friend for fix. There are many functions and interfaces in MAX 2011(2010) which do not exist in 2009.

Thanks for the reply denist. the script actually contains some checkboxes and buttons and basic functions for that. what i doubt is the structure in my second post. this is the error i get when i run the script.

but it runs fine on Max2011. can u please tell me what maxscript elements in 3dsmax2011 could possibly trigger error in max 2009 or previous versions?

you can download MXS Help for MAX 2011 and check New in MAXScript topic.

At first glance it seems odd to have the if and case statements in parentheses, but that might not be the cause of the syntax error.

Shouldn’t

on roll open do

say

on rollout open do

If “roll” is the name of the dialog, then it is fine:

on <item_name> <event_name> [ <argument> ] do <expr>
1 Reply
(@raytracer05)
Joined: 11 months ago

Posts: 0

Yep you’re right. I was trying to make sense of the error message, “syntax error: at on,”

guys…this works in 3dsmax 2010 but not on 3dsmax 2009

rollout adjust "Adjust Me" height: 70 width: 100
 (
 	group "Adjust Me"
 	(
 		spinner spnh "Up/Down" range: [70,115,70] type: #integer align: #left
 		spinner spnw "Side:" range: [100,160,100] type: #integer align: #left pos: [16,45]
 		
 		on spnh buttonup do
 		(
 			adjust.height = (spnh.value as integer)
 		)
 		
 		on spnw buttonup do
 		(
 			adjust.width = (spnw.value as integer)
 		)
 		
 		on spnh entered do
 		(
 			adjust.height = (spnh.value as integer)
 		)
 		
 		on spnw entered do
 		(
 			adjust.width = (spnw.value as integer)
 		)
 		
 	)
 )
 createdialog adjust

when i evaluated in Max2009 this is what i get:

– Syntax error: at on, expected <rollout clause>
[b]– In line: on s

[/b]also if i delete the whole spinners and values and add buttons and add functions to them and evaluate same error comes up…any idea why

i changed like this and now it works in 2009…a simple parentheses was causing the probem

rollout adjust "Adjust Me" height: 70 width: 100
(
	group "Adjust Me"
	(
		spinner spnh "Up/Down" range: [70,115,70] type: #integer align: #left
		spinner spnw "Side:" range: [100,160,100] type: #integer align: #left pos: [16,45]
	)
		
		on spnh buttonup do
		(
			adjust.height = (spnh.value as integer)
		)
		
		on spnw buttonup do
		(
			adjust.width = (spnw.value as integer)
		)
		
		on spnh entered do
		(
			adjust.height = (spnh.value as integer)
		)
		
		on spnw entered do
		(
			adjust.width = (spnw.value as integer)
		)
)
createdialog adjust