Stuck on simple rollouts

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 03 March 2013   #1
Unhappy Stuck on simple rollouts

Hi all,

Hmm, kinda frustrated here, I had started learning maxscript stopped and started again, everything was going fine, I had been working on a script, anyway now I'm having a problem and it seems so simple. I'm just trying to add another rollout to my floater. And everytime I do, nothing works. I have checked manual and syntax etc...I can't figure it out!? I have stripped back the code to just the rollouts, if I take the test rollout out it works...so Im stumped.

Keep getting

-- Type error: addRollout requires RolloutClass, got: undefined


My code

 try (closeRolloutfloater CharacterGen) catch()
 CharacterGen = newrolloutfloater "Character Generator" 700 700
 addrollout Create CharacterGen
 addrollout Test CharacterGen
 
 rollout Create "Create"
 rollout Test "Test"	
 (
 )


Bonus Question, why can't I do math on array counts e.g array1.count * array2.count??

Help and tips appreciated!

Thanks

Last edited by Animare : 03 March 2013 at 01:56 PM.
 
Old 03 March 2013   #2
MAXScript is not a compiled language. You are trying to add a rollout before you've defined it.

Try it this way:

 try (closeRolloutfloater CharacterGen) catch()
 CharacterGen = newrolloutfloater "Character Generator" 700 700
 
 rollout Create "Create"
 (
 )
 rollout Test "Test"	
 (
 )
 addrollout Create CharacterGen
 addrollout Test CharacterGen

Originally Posted by Animare: Bonus Question, why can't I do math on array counts e.g array1.count * array2.count??


You most certainly can, post specific code. I'm betting on either a type issue or a parentheses issue.
 
Old 03 March 2013   #3
Wow thanks! That helps alot!

With the array so for example I have 2 arrays of objects define as

BoxArray = $Box* as array
SphereArray = $Sphere* as array

Label Lb_Text "Answer Goes Here"


Then I want to do maths calc with them such as

BoxArray.Count * SphereArray.Count = Lb_Text.text


I even tried adding the following code

Boxes = BoxArray.Count as Integer
Spheres = SphereArray.Count as Integer

Boxes * Spheres = Lb_Text.text


What am I doing wrong?
 
Old 03 March 2013   #4
Lb_Text.text = (BoxArray.Count * SphereArray.Count) as string
 
Old 03 March 2013   #5
Ahhh...perfect! Thanks!
 
Old 03 March 2013   #6
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:36 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.