06-08-2014, 09:18 PM
My character AI doesn't work in Survival Mode but work perfectly in Versus Mode. Any ideas what could be the problem?
|
Doesn't work in survival
|
|
06-08-2014, 09:18 PM
My character AI doesn't work in Survival Mode but work perfectly in Versus Mode. Any ideas what could be the problem?
06-08-2014, 10:05 PM
Nope. What about stage mode?
Are you using an unmodified lf2?
06-09-2014, 10:49 AM
It doesn't work in stage either. But only this one, every other AI works. I've tried changing ID, but it didn't help. I use my own LF2, with my characters, skills, AIs and everything, but like I said, every other works...
06-09-2014, 11:22 AM
Show us the AI then.
06-10-2014, 12:58 PM
Code: //Kyouraku
bool face()
{
if(self.facing==target.facing)
{
return true;
}
else
{
return false;
}
}
//true if within z range
bool zdst(int range){
if(abs(self.z-target.z)<=range){return true;}
else{return false;}
}
//true if within x range
bool xdst(int close, int far){
if(abs(self.x-target.x)>=close && abs(self.x-target.x)<=far){return true;}
else{return false;}
}
//turn against
void turn(){
if(face()){if(self.facing==true){right();}else{left();}}
}
//true if within frame range
bool frame(int first, int last)
{
if(self.frame>=first && self.frame<=last)
{
return true;
}
else
{
return false;
}
}
//true if target within frame range
bool tframe(int first, int last)
{
if(target.frame>=first && target.frame<=last)
{
return true;
}
else
{
return false;
}
}
//---------------------------------------------------------
int ego(){
//reiatsu_charge
if (self.mp < 150 && self.clone ==-1 )
{
DJA();
}
//reiatsu_charge_stop
if (self.mp >= 500 && frame(372,373))
{
D(1,0);
}
for (int i = 0; i < 399; ++i)
{
q=rand(2);
if(loadTarget(i)==0)
{
//takaoni
if (abs(self.x-target.x)>500 && target.hp>0 && q==0 && target.team!=self.team)
{
DuJ();
}
//kageoni
if (abs(self.x-target.x)>500 && target.hp>0 && q==1 && target.team!=self.team)
{
DdA();
}
//takaoni_around
if (xdst(0,250) && zdst(30) && target.hp>0 && target.team!=self.team)
{
DuA();
}
//bushogoma
if (xdst(0,500) && abs(10*(self.z-target.z+15)/((self.x-target.x)*((self.facing?1:0)*2-1))) < 50 && target.hp>0 && !tframe(130,144) && self.mp>210 && target.team!=self.team)
{
if (self.x-target.x > 0)
{
DlA();
}
else
{
DrA();
}
}
//irooni
if (xdst(0,250) && zdst(30) && target.hp>0 && target.team!=self.team)
{
if (self.x-target.x > 0)
{
DlJ();
}
else
{
DrJ();
}
}
}
if(loadTarget(i)==3)
{
//takaoni_far look out!
if (abs(target.x-self.x)<=375 && target.team != self.team && zdst(16) && target.y<50)
{
DuJ();
}
}
}
return 0;
}
06-10-2014, 02:06 PM
Alright - I don't see why it should specifically not work in stage mode.
Go add some print("blah"); commands into the ego function to check whether it truly dosn't run - and if it does run - how far it gets and what choices it takes. The print will appear in the console if you are using the debug version.
06-17-2014, 12:00 PM
Ok, I removed the "if(loadTarget(i)==0)" part in for and it works now. Don't know why
|
|
« Next Oldest | Next Newest »
|