11-11-2018, 03:19 AM
(This post was last modified: 11-11-2018, 07:36 AM by Silverthorn.
Edit Reason: added code-tags for better readability
)
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:
So now you can select it and copy and paste it to try it out for any char.
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.