Little Fighter Empire - Forums
Doesn't work in survival - 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: Doesn't work in survival (/showthread.php?tid=9256)



Doesn't work in survival - pikol - 06-08-2014

My character AI doesn't work in Survival Mode but work perfectly in Versus Mode. Any ideas what could be the problem?


RE: Doesn't work in survival - YinYin - 06-08-2014

Nope. What about stage mode?
Are you using an unmodified lf2?


RE: Doesn't work in survival - pikol - 06-09-2014

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...


RE: Doesn't work in survival - YinYin - 06-09-2014

Show us the AI then.


RE: Doesn't work in survival - pikol - 06-10-2014

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; }



RE: Doesn't work in survival - YinYin - 06-10-2014

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.


RE: Doesn't work in survival - pikol - 06-17-2014

Ok, I removed the "if(loadTarget(i)==0)" part in for and it works now. Don't know why :D