my messy code

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 11 November 2013   #16
for me as novice this code was most transparent

select geometry
mycontrollerlist=#(Position_XYZ,audioposition)

for o in selection do
(
local controller = classof o.position.controller

for item in mycontrollerlist do
(
if item == controller then
(
messagebox "I found my controllers"
exit
)
)

I check it on geometry with Position_XYZ controllers
But don't work.
 
Old 11 November 2013   #17
Quote:
Originally Posted by kredka
Without your help I would't be able to do much

Code:
( -- make a test scene delete objects which = #(Box, Sphere, Cone, Teapot) for k=1 to 100 do which[random 1 4] name:(formattedprint k format:"03d") -- do a check for n in objects do ( i = finditem which (classof n) case i of ( 1: format "%:\t-> Box\n" n.name 2: format "%:\t-> Sphere\n" n.name 3: format "%:\t-> Cone\n" n.name default: format "%:\t-> X3\n" n.name ) ) )
 
Old 12 December 2013   #18
simplest list compare case

ok, let say I have such a case: I have numbers in list and I what popup if I found on of object from my list. Code is:

objlist=#(2,4,5)
for i =1 to 10 do
(
print i
if i==objlist then messagebox "sss" --<--- here is my action but don't work
)

and second case:

I want loop in exception(exclude) of my objlist=#(2,4,5)

so it should be:
for i=(from 1 with exception of objlist)? to 10

I know it's simple but I know I'm very close with first one however something is missing. Second case may be totally wrong.
 
Old 12 December 2013   #19
Quote:
Originally Posted by kredka
ok, let say I have such a case: I have numbers in list and I what popup if I found on of object from my list. Code is:

objlist=#(2,4,5)
for i =1 to 10 do
(
print i
if i==objlist then messagebox "sss" --<--- here is my action but don't work
)

and second case:

I want loop in exception(exclude) of my objlist=#(2,4,5)

so it should be:
for i=(from 1 with exception of objlist)? to 10

I know it's simple but I know I'm very close with first one however something is missing. Second case may be totally wrong.

First case
Code:
for i = 1 to 10 where findItem objlist i != 0 do print i

And second case (opposite)
Code:
for i = 1 to 10 where findItem objlist i == 0 do print i

BTW read about "Array Values" topic in mxs help
__________________
Looking in the right side. [bgaTools]
 
Old 12 December 2013   #20
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.
 
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 05:31 PM.


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