Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / Maxscript Beginner questions
  RSS 2.0 ATOM  

Maxscript Beginner questions
Rate this thread
 
51106
 
Permlink of this thread  
avatar
  • Geos59
  • Posted: 07 January 2011 12:30 PM
  • Total Posts: 125
  • Joined: 21 March 2008 03:16 PM

Hello everyone, I’m new to Maxscript and have some (hopefully) easy questions that need answering.

1. I was following a tutorial online (http://knol.google.com/k/introduction-to-maxscript#) and used this code:

macroScript HelloWorld category:"DAE"
(
MessageBox “Hello World”
)

The tutorial I was following says I need to drag the script onto the empty toolbar. I created the empty toolbar, but when I tried to drag the script to the empty toolbar (as the tutorial says) I get this error message:

--Compile error: Nested macroScript definitions are not permitted
-- In line: macroScript H

What exactly am I doing wrong?



3DS Max 2011
Windows Vista 32 Bit
Dell XPS M1530
Intel Core 2 Duo CPU T5550 1.83 GHz
2 GB of Ram

Replies: 0
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

Drag the script Name from the List in the Customise UI dialog to the Toolbar, not the text of the script from the Script Editor.

You can drag text from the editor, but in that case it must not contain a “MacroScript” definition - that will be added automatically (and transparently) so if the text contains the definition you end up with 2 nested definitions of the same thing, the one in the text you copied and the one added by Max, hence the error.

If you haven’t already, I would strongly suggest you open up the Maxscript help, Contents tab, and carefully read through the Introduction and the Learning MaxScript topics. They contain important information without which you may struggle to understand how and why things work - and why they sometimes don’t.



Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Attachment Attachment
Replies: 0