I working for friendly ai cog, based on cog downloaded from massassi temple, but those cog have simple bug: Actors with that cog attack other friendly actors... So i wrote something like this:
but its bugged, when level starts game break to windows..
Also i will need battle cog - ie enemies attack friendly actors and vice versa. It will not work on this cog and that downloaded from massassi - enemies dont attack frendly, so this cog is unusefoul.. help need
------------------
Code:
symbols
message startup
message touched
message killed
message pulse
thing friendly0 mask=0x408
thing friendly1 mask=0x408
thing friendly2 mask=0x408
thing friendly3 mask=0x408
thing friendly4 mask=0x408
thing friendly5 mask=0x408
thing friendly6 mask=0x408
thing friendly7 mask=0x408
thing friendly8 mask=0x408
thing friendly9 mask=0x408
thing friendly10 mask=0x408
thing friendly11 mask=0x408
thing player local
thing enemy local
ai passive_ai=pednarsh.ai
ai angry_ai
int i local
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
For(i=0; i<11; i=i+1)
{
AISetClass(friendly, passive_ai);
}
return;
touched:
if(GetSourceRef() != player) return;
SetPulse(1.0);
return;
killed:
SetPulse(0.0);
return;
pulse:
For(i=0; i<11; i=i+1)
{
enemy = FirstThingInView(friendly0, 170, 12, 0x4);
if((enemy == friendly0) || (enemy == friendly1) || (enemy == friendly2) || (enemy == friendly3) || (enemy == friendly4) || (enemy == friendly5) || (enemy == friendly6) || (enemy == friendly7) || (enemy == friendly8) || (enemy == friendly9) || (enemy == friendly10) || (enemy == friendly11) || (enemy == player) || (!enemy))
{
AISetClass(friendly, passive_ai);
return;
}
AISetClass(friendly, angry_ai);
AISetFireTarget(friendly, enemy);
AISetMoveThing(friendly, GetThingPos(enemy));
AISetLookPos(friendly, GetThingPos(enemy));
AISetMode(friendly, 0x202);
AIClearMode(friendly, 0x1000);
}
return;
end
but its bugged, when level starts game break to windows..
Also i will need battle cog - ie enemies attack friendly actors and vice versa. It will not work on this cog and that downloaded from massassi - enemies dont attack frendly, so this cog is unusefoul.. help need
------------------

![http://forums.massassi.net/html/tongue.gif [http://forums.massassi.net/html/tongue.gif]](http://forums.massassi.net/html/tongue.gif)
).