Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Doesn't work in survival
#1
My character AI doesn't work in Survival Mode but work perfectly in Versus Mode. Any ideas what could be the problem?
Reply
Thanks given by:
#2
Nope. What about stage mode?
Are you using an unmodified lf2?
Reply
Thanks given by:
#3
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...
Reply
Thanks given by:
#4
Show us the AI then.
Reply
Thanks given by:
#5
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; }
Reply
Thanks given by:
#6
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.
Reply
Thanks given by:
#7
Ok, I removed the "if(loadTarget(i)==0)" part in for and it works now. Don't know why :D
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)