Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loops?
#4
the problem is that the outer if function limits it to 50 mp or whatever you set.

the solution would be to use a condition.
    AI-Code:
int ego(){ 
if (((target.x-self.x) >= 300) && self.mp < 50 && charging=false) {
  charging=true;
  DJA();
  }
 
if(charging) { 
  if(self.mp >=500 || (target.x-self.x) < 300) ) {
    charging=false;
  }
  A(1,0);
  }
 
}

i think this should work.
i don't know if you need to define or create this condition somewhere first (never actually did AI programming).
Reply
Thanks given by:


Messages In This Thread
Loops? - by bashscrazy - 05-07-2014, 03:30 PM
RE: Loops? - by Silverthorn - 05-07-2014, 04:11 PM
RE: Loops? - by YinYin - 05-07-2014, 05:26 PM
RE: Loops? - by Bamboori - 05-07-2014, 07:51 PM
RE: Loops? - by YinYin - 05-07-2014, 10:49 PM
RE: Loops? - by A-Man - 05-08-2014, 09:52 AM



Users browsing this thread: 1 Guest(s)