heyho,
ok the problem is not that easy but I can hardly find information about that. At least nothing that helps me.
I have several functions in my .ms file
They are not inside of anything.
Now I want to create some macroscripts that call these functions instead of putting the function itself inside the macroscript.
Now how do I tell max to parse all the functions first? Because after starting max I can not call these functions because they are not defined. But if I evaluate the script they are defined (of course) and so I can call the functions from the macros
Replies
Basically it is the 'include' command. But Bobo describes it way better than I ever could
include "fnctions.ms"
at the start of my macroscripts
thx!
This allows the script to access a function that is not yet defined.
Similar to the following article.
http://docs.autodesk.com/3DSMAX/15/ENU/MAXScript-Help/index.html?url=files/GUID-FAE5BB27-C3B2-46B4-B0BA-FF7CA80969A8.htm,topicNumber=d30e91632
Actually, against logic, the Macroscript and UserMacro folders are evaluated before the Scripts/Startup and UserStartup folders. (The name suggests the opposite.) This is because Startup scripts, unlike macros, have access to the viewports and can create and manipulate objects.
If you want to use functions in MacroScripts they need to go in the stdplugin/stdscripts folder.
http://docs.autodesk.com/3DSMAX/15/ENU/3ds-Max-Help/files/GUID-C372E124-2B7E-41BB-94B0-5FF945D51095.htm
I've a function and want to include some code but get an error when i execute master.ms Any ideas?
MASTER.MS
SLAVE.MS
ERROR
This works for me.
Thank you, monster! Never had thought that this is the problem.
MASTER.MS
SLAVE.MS
OUTPUT
for sure? that would be really really "WTF?!"
You'll need to use a global variable with fileIn.
Typically I'll make a global struct and house all my variable in there. That way you only have one global. I'll even put the functions in it.