Little Fighter Empire - Forums
How to: script Artificial Intelligence - 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: How to: script Artificial Intelligence (/showthread.php?tid=7946)

Pages: 1 2 3 4 5 6 7


RE: How to: script Artificial Intelligence - AmadisLFE - 05-18-2014

Idk, when I tried it the first time it actually worked without problems, afterwards it didn't.


RE: How to: script Artificial Intelligence - pikol - 06-19-2014

Is there some variable to find out if the character is visible? I meat something like Rudolph's invisible move?


RE: How to: script Artificial Intelligence - YinYin - 06-19-2014

.blink

both blinking after getting up (leaving state 14) and Rudolfs invisibility use that same value.


RE: How to: script Artificial Intelligence - mrsmallbee - 02-11-2017

how to know what is the char id?


RE: How to: script Artificial Intelligence - Gad - 02-11-2017

If you want to check for target id, just do :

If (target.id == 0) print('template');


RE: How to: script Artificial Intelligence - Tabul - 04-07-2017

Hi,

is here some way how to add new move to existing original character without delete original AI? When I use ego() function, it deleted all moves except D>A (Firen's fireball).
I read somewhere it's not possible. How is it now in 2017?

Thanks.


RE: How to: script Artificial Intelligence - Gad - 04-07-2017

Not really an option. You can either rewrite whole ai or add a part before original script. For now you could optionally use other id that's simply doing all basic moves but no special attacks and add new ai for these.


RE: How to: script Artificial Intelligence - Tabul - 04-07-2017

Add a part before original script? That's what I need. Where can I find original script? (I mean original scripts for Firen, John etc., not mean scripts of custom characters)


RE: How to: script Artificial Intelligence - Gad - 04-09-2017

(06-11-2012, 01:42 PM)YinYin Wrote:  Note that the ego() function is not the main AI function of your character and thus needs to 'report back' to the function it has been called from. This is done with return 0;. The 0 will give the control back to the basic AI (the id() function). If you write return 1; you can retain control in the ego() function.


Simply run the script and at the end return 1. As program ends interpreting your script, it will give control back to the original ai till the end of frame.


RE: How to: script Artificial Intelligence - Tabul - 04-09-2017

You mean like this(?):
Code:
int ego(){
if (self.hp < 400){
DdA();
}
return 1;
}
It's just stand and use it when <400.


When I use this:
Code:
int ego(){
if (self.hp < 400){
  DdJ();
}
return 0;
}
It's working and without original special moves (except D>A).

Can you code it please how do you mean it?