Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → AI change Cog
AI change Cog
2000-10-03, 12:45 PM #1
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"
Clarinetists, unite!

-writer of Bloodwing
(a work in progress)
2000-10-03, 3:20 PM #2
Code:
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...

[url="mailto:no_oneatall@hotmail.com"]mailto:no_oneatall@hotmail.com[/url]no_oneatall@hotmail.com</A>
ICQ 81116825
===========================================
Evil Cog master of the Western TC!
cogs dont kill people. people kill people...

mailto:no_oneatall@hotmail.comno_oneatall@hotmail.com</A>
ICQ 81116825
==============================================
((Evil Cog Master))

↑ Up to the top!