I was just wondering if it's possible to add more variables in your game while the game is in play?
I am trying to make a smart NPC were it can memorize what you have typed earlier during the game so you may have a history of your trading past.
You type "Hi" to the NPC "Sam" now "Sam" will add the variable "Player=Hi" to itself. If the Player "You" type another word it would add another variable "Player1=Buy" if you typed buy to "Sam". I would like to know how it can detect the last variable name it added and add 1, 2, 3, 4 etc... to it then following with the = and the keyboard_string.
Example:
Player=Hi
Player1=buy
Player2=sword
Player3=no
Player4=wand
Player5=yes
Note: I know how to add more variables during game play to the NPC "Sam" I just don't know how to change the name of the variable if it's already in use by adding 1, 2, 3, 4 etc... to it before the equal sign.
If you don't understand plase reply and I will retype this thank you in advance!.
Edited by Invero, 07 December 2011 - 09:43 PM.











