maxscript help, help

maxscript help, help

andrewmcadam1402
Advocate Advocate
1,089 Views
8 Replies
Message 1 of 9

maxscript help, help

andrewmcadam1402
Advocate
Advocate
Hello good people,

Just started learning max script last night, thought it's about time. I'm going through the help and have got to the sectio"Learning max script - Manipulating the box - more box tranformations"
There is a bit of script near the bottom:-

animate on
(
at time0 (mybox.pos = ; mybox.scale = )
at time100 (mybox.pos = ; mybox.scale = )
)


I enter it and get the following error

-- Syntax error: at ), expected <factor>
-- In line: )


I have copied it straight from the max script help document so why does this happen?

Cheers
Mac
0 Likes
1,090 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
Just add a space between the reserved word time and the effective time value parameter :


animate on
(
at time 0 (mybox.pos = ; mybox.scale = )
at time 100 (mybox.pos = ; mybox.scale = )
)


A tiny mistake in Max Script online documentation.

-amarhys
0 Likes
Message 3 of 9

andrewmcadam1402
Advocate
Advocate
Still getting the same error lad,

animate on
(
at time 0 (mybox.pos = ; mybox.scale = )
at time 100 (mybox.pos = ; mybox.scale = )
)
-- Syntax error: at ), expected <factor>
-- In line: )
0 Likes
Message 4 of 9

Anonymous
Not applicable
When the Area server is busy, it may takes time to answer .. clicking more than one time the submit button does not accelerate things .. and worst than that the message is posted for each click. You have to be patient.

To come back on the thread subject, I tried the same code under Max 2012 and it works fine. I did not manage to reproduce the same error.

Is your mybox variable really pointing an object ? What is displayed in the MaxScript listener when you just type :

mybox


You should see something like that :


$Box:boxname @


Try also to type the code yourself (and not copy/paste it from the help), some hidden characters might be the cause of the problem.

-amarhys
0 Likes
Message 5 of 9

andrewmcadam1402
Advocate
Advocate
tried all that, just the same 😞
Tried just inputting 1 line

at time 0 (mybox.pos = ; mybox.scale = )

and this works fine, also fine with second line

at time 100 (mybox.pos = ; mybox.scale = )

"animate on" appears to do nothing when executed, but from what i was reading i shouldn't notice any difference with this when using maxscript, only the end result.

It's just when i do it all together. Is there a chance i'm executing the script wrongly?
Earlier in the documentation there was a section that asked me to put in the following lines

mybox.lengthsegs = 10
mybox.widthsegs = 10
mybox.heightsegs = 10
mybox.mapCoords = true


and i had a similar issue where it only executed the final line"mybox.mapCoords = true" and so i had to input it all in seperatly.

Actually re-thinking about this again, maybe the reason i'm getting the issue is becuase it's only running the last line, which in this case is ")"
0 Likes
Message 6 of 9

andrewmcadam1402
Advocate
Advocate
Just tried putting it all into 1 line and it works fine. So why does it have a problem using mulitple lines. Have i clicked something on?
0 Likes
Message 7 of 9

Steve_Curley
Mentor
Mentor
Several points Andy.

Apart from server timeouts the most likely cause of duplicate comments is refreshing your browser window. The comments are handled by javascript, not by the normal submit mechanism, so every refresh repeats the last operation. Click one of the links at the top (forum home, max, maxscript, thread title) to break out of that viscious cycle so you can then refresh with impunity.

Always wrap any posted code inside CODE tags - the forum displays are not copy/paste friendly unless you do. It also separates code from the rest of the post making it easier to read.

The Listener is useful for the odd quesy or test, but once you get over a couple of lines it can be a pain. Open the Maxscript Editor and do all your work in there - you will have a lot less problems and the editing is much better. If you must execute multiple lines in the Listener they MUST all be selected, and press the Enter on the Numeric Keypad, not the normal one. Failure to execute all relevent lines at once can cause the Listener to become unresponsive - especially if you have DO loops split over a number of lines as it waits for the closing ")" which it never sees.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 8 of 9

andrewmcadam1402
Advocate
Advocate
Cheers Steve, the editor works fine and this has solved my issue. Thats really annoying that all this time spent being stuck is to do with the listener, and max help says to use it!

Ah well, moving onto the next section now 🙂
0 Likes
Message 9 of 9

Anonymous
Not applicable
Hey Andy,

if you really want to learn Max Script, i suggest you learn it from other sources than the Max Script help.

Since a few month there is a tutorial online for FREE from the creator of Max Script, John Wainwright. Its called 101 Max Script Tutorials.
You can watch it at Vimeo.

Heres the Link: 101 Max Script Tutorials

Have Fun.
0 Likes