Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Help with object lists
Old
kimarimonku
Guest
 
Status:
Posts: n/a
Default Help with object lists - 05-04-2010, 08:33 PM

I don't know if there is an easier way to do this or I'm trying to make it too simple but here it goes.

Basically want an if/else statement that If object is within x distance of any other objects from a list it becomes true.

I tried to just do bunch of "or"s but it looked pretty sloppy and Alice didn't seem to like anything past 2 objects in the or.

I thought random would let me do this in a loop but it doesn't seem to want to work. Any point in the right direction would be much appreciated.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 05-04-2010, 10:03 PM

The ors should've worked, as that's what I often do.

You could always use the For all in order method to run through each item on the list systematically. It'll be slow, though.

If you want speed and functionality, use the ors or use a bunch of similar if/else ifs for each individual object in a do together method. It's horrible programming, but it's what works the best in Alice, I'm afraid.


(')>
   
Reply With Quote
Old
kimarimonku
Guest
 
Status:
Posts: n/a
Default 05-04-2010, 10:11 PM

Ah ok that's what I was afraid of. It did seem extremely sloppy but oh well, if my teacher questions it I'll see if she has any alternatives.

And I don't know why, it would suddenly just delete my or statements once I got past 3 or 4 and leave it as a base if/else. Alice already corrupted my save file once tonight and set me back about an hour so I'm going to call it a night and try again tomorrow.

Thanks for letting me know though. I had to spend the better part of the night trying to figure it out while I was touching up the rest of my project.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 05-04-2010, 10:34 PM

I apologize that my answer wasn't more palatable.

If you need help recovering your work or need an example of one of the methods I described, let me know.

Good luck.


(')>
   
Reply With Quote
Reply


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.