Ok so i made a game_variables class called game_rep to track the players reputation with each npc in the game. I was wondering how i can use text as the id instead of a number if you get what i mean.
EX: instead of using $game_rep[1] += 1 i want $game_rep["Lana"] += 1.
That way it will be easier to modify rep per npc instead of having to remember the id number for thousands of npc's.
If you want to see how i have the script its really simple. Its just a name change of the default variables.
class Game_Rep
#--------------------------------------------------------------------------
def initialize
@data = []
end
#--------------------------------------------------------------------------
def [](variable_id)
if variable_id <= 5000 and @data[variable_id] != nil
return @data[variable_id]
else
return 0
end
end
#--------------------------------------------------------------------------
def []=(variable_id, value)
if variable_id <= 5000
@data[variable_id] = value
end
end
end
Ok so i made a game_variables class called game_rep to track the players reputation with each npc in the game. I was wondering how i can use text as the id instead of a number if you get what i mean.
EX: instead of using $game_rep[1] += 1 i want $game_rep["Lana"] += 1.
That way it will be easier to modify rep per npc instead of having to remember the id number for thousands of npc's.
If you want to see how i have the script its really simple. Its just a name change of the default variables.
Thanks in advance :D
Share this post
Link to post
Share on other sites