(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.