Page 1 of 1

AI/random reactions

PostPosted: Thu Jan 01, 2009 5:16 pm
by j2graves
I wanna make it so that some enemies will do random attacks in this way:

when an enemy is within a cirtain radius of me, he'll do one of 3 distance attacks,
when an enemy is within a smaller radius of me, he'll do one of 3 close range attacks.

could someone help out with this?

Re: AI/random reactions

PostPosted: Thu Jan 01, 2009 7:28 pm
by BlarghNRawr
you could have 2 invisable circles around your player and when an enemy colides with one, then a variable goes from 0 to 1, or from 1 to 2... then they do random ranged attacks when in the var1 and random cloae attacks when in the var2 :)

i think

Re: AI/random reactions

PostPosted: Thu Jan 01, 2009 10:43 pm
by Troodon
Test with the if-function if the distance is more or less 3. Then use random variables which give results with 1,2 or 3. Then define what weapon to use in each randonm result. :)

Re: AI/random reactions

PostPosted: Thu Jan 01, 2009 11:05 pm
by DST
In this demo, I show you a very easy way to coordinate boss ai.

Instead of timers and animations, all animations are stopped, and there is only one timer.
This is the only timer the boss will ever need!

Take a look. The boss cycles thru moves, but you can reassign the next move whenever you want. So I told the boss to throw ice blocks at player if player is far away, but to try to jump on the player if he gets too close.

All the bosses moves are now in one script window, which makes it very easy to coordinate. You can add more moves at any time by adding more cases to the 'limit' switch.

Hope this helps you on your quest!

Re: AI/random reactions

PostPosted: Mon Jan 05, 2009 1:35 pm
by Bee-Ant
DST...youre back!!! :D

Re: AI/random reactions

PostPosted: Wed Jan 07, 2009 11:40 am
by Kalladdolf
sorry, but LOL this demo is hilarious.