I'm having the age old problem of Maxscripts not working the first time they are run (from a cold start) because the functions need to be declared before they are used.
The following script will fail the FIRST time it is run:
fOne()
function fOne =
(
fTwo()
)
function fTwo =
(
messageBox ("Hello world!")
)
We get the error : "Type error: Call needs function or class, got: undefined". Second time around, the script will run fine.
However, adding a forward declaration to the script, we no longer get an error. Horrah! BUT the function is no longer called. Boo!
-- declare function names before calling them!
function fOne = ()
function fTwo = ()
fOne()
function fOne =
(
fTwo()
)
function fTwo =
(
messageBox ("Hello world!")
)
So, how does forward declaration really work in Maxscript?