Alice Community  

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

Thread Tools Display Modes
Any From List Command Questions
Junior Member
Status: Offline
Posts: 5
Join Date: Sep 2011
Question Any From List Command Questions - 09-22-2011, 06: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
//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

array, close, list

Thread Tools
Display Modes

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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.