Author Topic: freakin' automatic doors!  (Read 1889 times)

0 Members and 1 Guest are viewing this topic.

Offline Xqzzy Rcxmcq

freakin' automatic doors!
« on: October 03, 2003, 10:36:29 AM »
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.

Code: [Select]
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!


Pathfinder. After I finish CIMS 2004.

Kon-Tiki

  • Guest
Re:freakin' automatic doors!
« Reply #1 on: October 03, 2003, 11:27:03 AM »
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:
Code: [Select]
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.

Offline Eigen

Re:freakin' automatic doors!
« Reply #2 on: October 03, 2003, 01:18:59 PM »
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
Artificial Intelligence Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.028 seconds with 22 queries.