Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to: script Artificial Intelligence
#51
Idk, when I tried it the first time it actually worked without problems, afterwards it didn't.
Spoilered Spoilers (Click to View)

You're just dying if you're living and thinking about a betrayal, revive yourself.
Think about that one person that has trusted you forever, not the thousand people that have betrayed you.
Reply
Thanks given by:
#52
Is there some variable to find out if the character is visible? I meat something like Rudolph's invisible move?
Reply
Thanks given by:
#53
.blink

both blinking after getting up (leaving state 14) and Rudolfs invisibility use that same value.
Reply
Thanks given by:
#54
how to know what is the char id?
Reply
Thanks given by:
#55
If you want to check for target id, just do :

If (target.id == 0) print('template');
Reply
Thanks given by:
#56
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.
Reply
Thanks given by:
#57
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.
Reply
Thanks given by:
#58
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)
Reply
Thanks given by:
#59
(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.
Reply
Thanks given by:
#60
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?
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)