Original Post
Hey :) I'm working on a simple little rpg, and i can't seem to figure out how to do the npc system at all. I Want to have functions like Say(who, what), TakeGold, GiveGold, etc. So, i tried to make a simple function, like, Chat() that calls those in order to make a fun chat system. The problem is, when i do that they all fire off at once, causing big chaos. I Also cant have the functions wait until the button is pressed, because then none of the rendering, gui, or other logic would work, which would be epic fail. My first system was ugly, an generally a wreck. What i did was have an int ResponseNum, and did something like this: // in the loop: switch(ResponseNum) { case 1: Say("bob", "Hey"); break; case 2: Say("you", "Hey, bob"); break; // etc }; if(ButtonIsPressed) { ResponseNum++; } so that was pretty dirty, and i didnt really want to do that. Also, if i wanted to have forks and such(choose an option), that would epic fail. My next try was simple, have a CMessage class that holds a who,what and when Say() is called, add one of those to a list of them. Then, when the button is pressed, pop one off of the list and draw it, but this also left no room for forks. So, if anyone has experience with npcs or has an answer to my problem, that'd be greatly appriciated :) -DudMan