PDA

View Full Version : Need to run same script 2-3 times to get it to work... what's up!?


Raeldor
02-16-2006, 06:54 PM
What's up with MaxScript. I have a script which works fine, but when I first load max I have to run it 2-3 times to get it to execute properly. It says there is errors on lines where no errors exist.

Also, when I make a change to a script I have to run it twice to get it to run the new version with the changes.

What is going on here?

Thanks

marktsang
02-16-2006, 07:17 PM
this would almost definitly be to do with the scope of some of your variables - make sure that funcitons are defined before you call them and that variables are defined also if they are not defined when first called

mark

Raeldor
02-16-2006, 07:24 PM
this would almost definitly be to do with the scope of some of your variables - make sure that funcitons are defined before you call them and that variables are defined also if they are not defined when first called

mark

So my functions need to appear in my script file before the code that uses them?

eek
02-16-2006, 07:39 PM
Its the order of your script thats key. When fns are called etc.

eek

Raeldor
02-16-2006, 07:43 PM
Its the order of your script thats key. When fns are called etc.

eek

Wow, thank you. This language is a lot more rudimentary than I first thought.

Aearon
02-17-2006, 07:26 AM
correct me if i'm wrong, but isn't this the principle of all script languages?

Raeldor
02-17-2006, 07:50 AM
correct me if i'm wrong, but isn't this the principle of all script languages?

You could be right, I am just used to programming in c++ and c#. But having said that, even run-time compiled languages like VB don't insist on having functions being in a specific place in the source file (ie, before the code that calls them). It will just take me a while to get used to.

CGTalk Moderation
02-17-2006, 07:50 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.