![]() |
|
|
AI script doesn't work - 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: AI script doesn't work (/showthread.php?tid=9389) |
|
AI script doesn't work - LéoSilva - 09-05-2014 Well, when I use this function only in AI it works normal. Quote:int ego(){ However when I try to add any other function, it runs in the game and is as without AI It was just what I wanted to configure ![]() Quote:int ego(){ Can you help me with this? Note: I just started using this system
RE: not work - Ramond - 09-05-2014 Quote:int ego(){ Try this. Your code must still be within the "int ego" bracket, you put it outside so it wasn't read anymore. ![]() PS: Would you mind reducing the size of your signature a bit, it should be limited to 150-200 pixels. Some people will easily get annoyed if your signature takes up so much space when they scroll through posts.
RE: AI script doesn't work - LéoSilva - 09-05-2014 Unfortunately not worked well: / As for the signature, was decreased RE: AI script doesn't work - Ramond - 09-05-2014 Well, it really depends. What did you try? The way you built the second function, it will only trigger when the target is LEFT of the AI character (regardless of direction he's facing). If you want it to work on both sides, you need to include an "abs" (absolute) function, which will check the general x distance to your character, not only into one direction. Also: if ((target_y - self_y)*(target_y - self_y) < 81) This means, if your y distance to the enemy is maximal 9. It's a bit of a tight condition as well (though disregardable when on ground), so maybe you just didnt quite get it to work due to situational circumstances. Did you test your script with your enemy standing to the right of you? (Plus he needs to have full HP as well.) RE: not work - Som1Lse - 09-05-2014
First things first, have you checked the console? (black window that pops up) It reports error messages there. If you don't get one when you start LF2 download and use the Debug version of the DLL. On top of that I'd just like to point out that target_x is incorrect. The correct syntax is target.x. The same thing goes for self. RE: AI script doesn't work - LéoSilva - 09-05-2014 Was using the debugger version of the dll lf, however the dll that I used did not show the black window, now I've changed had been easier to identify the problem.
|