I'll try to answer in order.
First things first. HungerThirst::Actor_ID
Reading thru that script briefly, there isnt really an actual variable called Actor_ID. There is a constant for ACTOR_HUNGER_VARIABLES. That constant is a Hash. The 'Key' is a Number. The value is associated with $game_variables. The 'Key' being 1, 2, 3, or 4 will correspond to which actor in which position. That way the script and the existing game code are "linked". The way to access the data stored there should be pretty easy.
HungerThirst::ACTOR_HUNGER_VARIABLES[1]
This is where
Actor.ID comes into play. I'll try to explain the difference.
class Game_Actor
def initialize(arg_id, arg_name, arg_hp)
@id = arg_id
@name = arg_name
@hp = arg_hp
end
def say_hello
print "hello"
end
end
class Game_Party
def initialize
# Actors Array
@actors = []
end
end
$game_party.actors[0] = Game_
Actor.new(arg_id = 3, arg_name = "Bob", arg_hp = 100)
Event Script:
# Temporary Variable
actor = $game_party.actors[0]
print
actor.idprint
actor.nameprint actor.hp
You could also do the same thing by saying
print $game_party.actors[0].id
ID is a property of the Game Actors. Just as Name and HP are also properties. I left a LOT of necessary stuff, but basically what happens is when you see a dot . you are looking at either a Property or a Method. A property is a Variable
like ID. A Method is a "def method_name" like say_hello. Methods also use periods to go from Object to Method. $game_party.actors[0].say_hello
Inside a Method (or a "def do_something"), you can have "Temporary Variables". Temporary Variables don't have any extra characters in front. So they are not preceeded by $ or @ or @@.
def everyone_say_hi
for actor in $game_party.actors
print
actor.name, " says Hello"
end
end
There, the word actor is a Temporary variable. So if you try to call "actor" somewhere else, it wont be there. Using the @ character, those variables stick around.
actor.id or
actor.name It allows you to access them later. $ are used as Globals. Print $game_map.inspect Globals can be called from anywhere, and are usually used to store organized Data. $bookshelf Globals usually have a lot of info contained inside of them. $bookshelf.shelf[1].book[373].page[192].line[37]
You also have what we call "Arguments". Arguments are used to get information from outside a Method to inside of a Method.
def add_numbers(arg_number_1, arg_number_2)
#Temporary Variables from sum of two Arguments
sum = arg_number_1 + arg_number_2
end
Arguments are useful especially when handling Temporary Variables to do reduntant complex code.
Next you have Arrays and Hashes. They are similar but not the same.
@some_array = []
@some_array[0] = "Mouse"
@some_array[1] = "Dog"
@some_array[2] = "Cat"
Hashes use Keys, Arrays use Indexes. Basically.
@some_hash = { 1 => "Dog", 2 => "Cat" }
Hashes and Arrays access data similarly.
print @some_array[1] or @some_hash[1] Result: "Dog"
Getting back to the issues after that monster level of training. As you see, youre working with a Hash, so it needs a Key to access what data is where. If you're messing around, try this
# Temporary Variable to hold the Actor's Id
actor_id = $game_party.actors[0].id
# Get the Game Variable ID from the Settings
game_variable_id = HungerThirst::ACTOR_HUNGER_VARIABLES[actor_id]
# Set the Game Variable by its ID to the Maximum Hunger Value - 2000
$game_variables[game_variable_id] = HungerThirst::MAX_HUNGER
print $game_variables[game_variable_id]
Before I get too far into this, does any of this make a damn bit of sense?