05-06-2014, 02:35 PM
How to use my bot randomly blows skills without conditions? Without spam?
Few questioins about AI script
|
|
05-06-2014, 02:35 PM
How to use my bot randomly blows skills without conditions? Without spam?
05-06-2014, 04:34 PM
Just make use of the "rand()" function:
Of course you will end up having conditions if you don't want it to work awkwardly. The conditions are the base of the whole AI stuff. A-Engine: A new beat em up game engine inspired by LF2. Coming soon A-Engine Dev Blog - Update #8: Timeout
In this case:
if( dist_between(351,500) && same_z_axis() && ( self.mp > 100 ) && ( target.state != 14 ) ) { DuJ(); return 0; } I need to put int randomval = rand(100) inside or outside this function? To put other command
05-06-2014, 05:40 PM
It doesn't really matter, but best, outside right after the "int ego(){}". This is what it would look like:
[code=AI] int ego(){ int randomval = rand(100); //returns an int b/w 0 & 100 //....other code here if( randomval <10 && (dist_between(351,500) && same_z_axis() && ( self.mp > 100 ) && ( target.state != 14 )) ) { DuJ(); } return 0; //....some code here return 1; } A-Engine: A new beat em up game engine inspired by LF2. Coming soon A-Engine Dev Blog - Update #8: Timeout
05-07-2014, 10:49 PM
Does not work :/
| |
« Next Oldest | Next Newest »
|