View Single Post
Any From List Command Questions
Old
DonnySN
Junior Member
 
Status: Offline
Posts: 5
Join Date: Sep 2011
Question Any From List Command Questions - 09-22-2011, 07:24 PM

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.
   
Reply With Quote