![]() |
|
me or my teammate - Printable Version +- Little Fighter Empire - Forums (https://lf-empire.de/forum) +-- Forum: Little Fighter 2 Zone (https://lf-empire.de/forum/forumdisplay.php?fid=7) +--- Forum: AI Scripting (https://lf-empire.de/forum/forumdisplay.php?fid=56) +--- Thread: me or my teammate (/showthread.php?tid=9398) |
me or my teammate - pikol - 09-14-2014 I have some problem: I wnat my character to make an action when his or his ally's health is low Code: for (int i=0; i<16; ++i)
{
if ( ((self.hp<=300 || abs(self.hp-self.dark_hp)>200) && target.team==self.team && target.id==42 && loadTarget(i)==0) ||
((target.hp<=300 || abs(target.hp-target.dark_hp)>200) && target.team==self.team && target.id==42 && loadTarget(i)==0))
{
DdJ();
}
}Code: if (target.id==42 && (target.hp<=300 || abs(target.hp-target.dark_hp)>200) && target.team==self.team &&
loadTarget(j)==0)
{
//print(1+" " +target.id+" ");
DdJ();
}
else
{
if (target.id==42 && (self.hp<=300 || abs(self.hp-self.dark_hp)>200) && target.team==self.team &&
loadTarget(j)==0)
{
//print(2+" " +target.id+" ");
DdJ();
}Ok, I think I've got this... It needed something like: Code: loadTarget(i); |