void() plat_center_touch = { if (other.classname != "player") return;
and change it to:
void() plat_center_touch = { if (other.classname != "player" && other.classname != "bot") //TutorBot PLATS return;Does this look familiar - yep, it's the old "Player Only" sign on the washroom door again. There's just one more to do and that is where you see:
void() plat_outside_touch = { if (other.classname != "player") return;
and change it to this:
void() plat_outside_touch = { if (other.classname != "player" && other.classname != "bot") //TutorBot PLATS return;See? That was simple. You can save and close that file and compile away to your hearts content. Or, if you want to make the bots pause when they get on the lift, you can do the following steps.
if (other.classname == "bot" && time > other.pausetime + 5) { other.pausetime = time + 5; other.think = bot_wait1; other.nextthink = time + 0.1; }The platform actually has some AI in it right here. You see, if the bot has not paused recently, the platform actually tells the little guy to execute his waiting sequence. If we didn't check the bot's pausetime, he would loop in this sequence, since he'd always be touching the lift.
if (other.classname == "bot" && time > other.pausetime + 5) { other.pausetime = time + 5; other.think = bot_wait1; other.nextthink = time + 0.1; }Save and close that file. Since plats.qc comes before tutor.qc in out progs.src file, we will be calling bot_wait1() before we write it. That is a no-no. We must define it first. Thus, open up defs.qc, and at the very, very end, add this:
void() bot_wait1;That's done. Finally, open up tutor.qc and slip down to the end of your animation scenes. There, paste this new waiting sequence:
void() bot_wait1 =[ $stand1, bot_wait2 ] {}; void() bot_wait2 =[ $stand2, bot_wait3 ] {}; void() bot_wait3 =[ $stand3, bot_wait4 ] {}; void() bot_wait4 =[ $stand4, bot_wait5 ] {}; void() bot_wait5 =[ $stand5, bot_wait6 ] {}; void() bot_wait6 =[ $stand1, bot_wait7 ] {}; void() bot_wait7 =[ $stand2, bot_wait8 ] {}; void() bot_wait8 =[ $stand3, bot_wait9 ] {}; void() bot_wait9 =[ $stand4, bot_wait10 ] {}; void() bot_wait10 =[ $stand5, bot_wait10 ] {if (self.enemy == world) bot_walk1() else bot_run1();};Now he'll stand for one second when he gets on a lift. If he has an enemy, he'll run at the end of this; if not, he'll walk. Feel free to tweak, add, or delete. That's today's lesson.