Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Any From List Command Questions (http://www.alice.org/community/showthread.php?t=7267)

DonnySN 09-22-2011 06:24 PM

Any From List Command Questions
 
Ok, the project I'm working on I have a simple problem with a not so simple solution. In short I have civilians running in panic in a city, I cant have them running through buildings so I put in a script to along the lines of
"""
for (int index=0; index<infinity times;index++){

If(person.isCloseTo 10 meters, of building{
//This makes them turn around if their close to building
doTogether {
person.move(forward, 5 meters
person.turn(left_or_right.getRandomItem(), .5 revolutions
}
}else{
//This makes them run around aimlessly
doTogether {
person.turn(left_or_right.getRandomItem(), .1
person.move(forward, 5 meters)
}
}
}


That part of the script works great, now to the problem. I have a LOT of buildings in this city. I need to get a script that checks distance from all buildings. Then I need to get a script that turns away from the closest building on the list.

Please help!!!!! I'm at a stand still 'til I can figure this out.


All times are GMT -5. The time now is 08:04 AM.

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