AI/random reactions

You must understand the Game Editor concepts, before post here.

AI/random reactions

Postby j2graves » Thu Jan 01, 2009 5:16 pm

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?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: AI/random reactions

Postby BlarghNRawr » Thu Jan 01, 2009 7:28 pm

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
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: AI/random reactions

Postby Troodon » Thu Jan 01, 2009 10:43 pm

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. :)
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Re: AI/random reactions

Postby DST » Thu Jan 01, 2009 11:05 pm

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!
Attachments
bossattack.png
bossattack.zip
(352.26 KiB) Downloaded 144 times
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: AI/random reactions

Postby Bee-Ant » Mon Jan 05, 2009 1:35 pm

DST...youre back!!! :D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: AI/random reactions

Postby Kalladdolf » Wed Jan 07, 2009 11:40 am

sorry, but LOL this demo is hilarious.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest