freakin' automatic doors!

Xqzzy Rcxmcq Let's see...I'm making some automatic Star-Trek doors (to where when the ego approaches the door, it opens...when he gets farther away from the door (and it was open) it closes. I have been able to get it to open.


distance(ego,o1,v27);
if (v27 >= 15) {
end.of.loop(o1,f16);
}


NOW...how in the world can you get the sucker to close? Could somebody please post the code for automatic doors? THANK YOU!
Kon-Tiki Ok, this might not be the best solution (I'm a bit rusty on my AGI), but it sure is a solution. Try this code:

distance(ego,o1,v27);
if (v27 >= 15) {
end.of.loop(o1,f16);
}

else {
if(isset(f16)) {
reverse.loop(o1);
end.of.loop(o1,f17);
}
}
if(isset(f17)) {
reset(f16);
reset(f17);
}


Hope that helps.
Eigen Why not use if(posn(near door

if(posn(o0,10,20,30,40)){ //posn to open door
if(!isset(f100)){
set(f100);
end.loop(o1);//door
return();
}
}
if(posn(o0,10,40,30,50)){ //close door, below the open door posns.
if(isset(f100)){
reset(f100);
reverse.loop(o1);
return();
}
}

This should work.

-Eigen