Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ai for any char
#1
:) 
Finally i am on the lfe forum, for so long i was having problems with registering on this forum, but i am now here to give lf2 chars human thinking ai to defeat any human player and also to do more things. Now this is the ai i have been making for int ego ai, about dodging attack which is very simple:


    AI-Code:
int ego(){
 
//DODGE ENEMY ATTACK
if (target.state == 3 && abs(target.z-self.z) < 19
&& (self.x-target.x)*((self.facing?1:0)*2-1) > 0
&& (self.x-target.x)*((self.facing?1:0)*2-1) < 70){
down(1,1);return 1;
}
if (target.state == 3 && abs(target.z-self.z) > 19
&& (self.x-target.x)*((self.facing?1:0)*2-1) > 0
&& (self.x-target.x)*((self.facing?1:0)*2-1) < 70){
up(1,1);return 1;
}
 
return 0;
}



So now you can select it and copy and paste it to try it out for any char.
Reply
Thanks given by:


Messages In This Thread
ai for any char - by open source nature - 11-11-2018, 03:19 AM
RE: ai for any char - by Silverthorn - 11-11-2018, 08:23 AM
RE: ai for any char - by open source nature - 11-11-2018, 03:24 PM
RE: ai for any char - by Uri - 11-11-2018, 03:51 PM
RE: ai for any char - by open source nature - 11-11-2018, 06:32 PM
RE: ai for any char - by Uri - 11-11-2018, 07:56 PM
RE: ai for any char - by open source nature - 11-12-2018, 12:09 AM
RE: ai for any char - by Uri - 11-12-2018, 12:42 AM
RE: ai for any char - by open source nature - 11-18-2018, 07:11 AM



Users browsing this thread: 2 Guest(s)