vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Wed May 22, 2013 12:16 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: NPC AI Tutorial
PostPosted: Thu May 28, 2009 5:12 pm 
Carmack's Pimple

Joined: Sat Mar 21, 2009 6:53 am
Posts: 69
Hello,

There are 5 basic types of AI's that I'd like for my attackable NPCs:

1. Mobile & aggressive (currently exists; case 3)
2. Mobile & non-aggressive (walks around, but doesn't attack until attacked)
3. Immobile & aggressive (doesn't walk around, but attacks if you get close enough)
4. Immobile & non-aggressive (doesn't walk around, and doesn't attack until attacked)
5. Coward (doesn't attack and runs away unless it's fighting. this could be case 4 if I removed the "attack" code, right?)

Can anyone tell me where there is a tutorial for editing or making your own NPC AIs?

If not, I'd appreciate it if someone could tell me how here.

Thanks in advance,

Joe


Top
 Profile  
 
 Post subject: Re: NPC AI Tutorial
PostPosted: Thu May 28, 2009 9:00 pm 
Slave to the BB

Joined: Sat May 12, 2007 6:20 am
Posts: 3842
Location: Behind you!
http://vbgore.com/Adding_NPC_AIs


Top
 Profile  
 
 Post subject: Re: NPC AI Tutorial
PostPosted: Thu May 28, 2009 11:40 pm 
Carmack's Pimple

Joined: Sat Mar 21, 2009 6:53 am
Posts: 69
notexistant wrote:
http://vbgore.com/Adding_NPC_AIs


Yes, thank you. I've been reading that, trying to understand it all. :P

Ok, I can see that if I set "Hostile" to 0 and the AI to 2, the NPCs walk around and don't attack me.

However, when I attack them they don't do anything. They just sit there and let me hit them. What would I add to case 2 to make them fight back after being attacked?

Is there a general command that I can put in there so that all AIs will fight back upon being attacked?

I'm guessing it would look similar to this line:

Code:
If NPCList(NPCIndex).Hostile Then b = NPC_AI_Attack(NPCIndex)


but I'm not sure yet how to detect an attack on the player's part?

Joe


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group