RPG NPC's

Started by
0 comments, last by djsteffey 23 years, 8 months ago
I was just wondering how most of you that are working on a RPG or any other game with NPC''s, how do you do the code for them. Do you just hard code the logic into the game. Like when you load a town map or whatever, do you have a place in the file to load like an NPC struct for each NPC in the town. And in this struct you might have things like
    
struct NPC
{
  BYTE  type;   // like merchant, soldier, or normal townsperson
  char* talk;   // what the person says when you talk to them

                // i know they could say different things depenindg on game situation but lets make this easy for now

  bool walks;   // do they walk around or stand still

  int x, y;     // position on the map;

};
    
or do you all use some kind of scripting language, and if you do then I would like to know how. Is this method above a bad way to implement it, or is a scripting language the only way to go (I hope not). Because right now i really dont want to learn how to make a scripting language + interpreter + all the other stuff you need for it. Unless someone wants to help me out with this and make me one "Now go away or I shall taunt you a second time" - Monty Python and the Holy Grail themGames Productions
Advertisement
sorry i accedentally put this in the graphics forum, i thought i clicked on general programming forum
I am gonna post it there so just delete this when you see it mr./mrs. moderator



"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

This topic is closed to new replies.

Advertisement