PDA

View Full Version : AI change Cog



GeneralRamos
10-03-2000, 03:45 PM
Once again I am requesting a cog. As i've said over and over, I'm terrible with cog. Anyhow, here's what I need...

I need a cog that will change a friendly's .ai file to Gan_soldiermove.ai upon seeing an enemy. Once the enemy dies, it should return back to pedroam.ai. it should be able to switch back to GAN_soldiermove if it sees a new enemy.

*NOTE* This is for MotS. I need this so that I can use the "sidekick" cog to have the friendly follow the player around.

------------------
You should know my title by now, but if you didn't, it's

_,-'The Bazooka Floydist'-,_

"Troops, don't fire till you see their eye textures switch from affine to perspective!"
"If you're takin' your girlfriend out tonight, you'd better park your car well out of sight. For if they catch you in the backseat trying to pick her locks, they're gonna send you to mother in a cardboard box, you'd better run[-run-run-run]!"~Pink Floyd, from "Run Like Hell"

Fernando_the_Hunn
10-03-2000, 06:20 PM
symbols
thing helper
thing potential local
cog follow_cog

ai attack=GAN_soldiermove.ai local
ai walk=pedroam.ai local

message startup
message pulse
end

code
startup:
SetPulse(0.5);
return;
pulse:
potential = firstThinginView( helper, 280, 5, 0x4);
if(potential == -1)
{
AISetClass(helper, walk);
SendMessage(follow_cog, user1);
}
else if(potential != helper)
{
AISetClass(helper, attack);
SendMessage(follow_cog, user0);
}
return;
end


and you can have user0 and user1 messages in the cog that makes the helper follow you to turn it off and back on again if you want.

http://forums.massassi.net/html/smile.gif

------------------
There are no evil coggers, only evil cogs...

mailto:no_oneatall@hotmail.comno_oneatall@hotmail. com</A>
ICQ 81116825
===========================================
Evil Cog master of the Western TC!