Hi!
I'm sure this is a really simple question, if you know how, which I obviously don't.
I've just started playing around with RPG Maker VX Ace, and have been spending maybe five hours all in all so far. At least I have a map and a character up and running in my game. Now I wanted a feature, that when I level up, I wan't the character to recover all his HP and MP. I thought I would start out easily, by using the predefined "Recover All" when making a Common Event, and then work my way down to only recovering the HP and MP, not all "stats".
To do this, I had an idea of making a common event, that I then call from the script Game_Actor under the def level_up-section. It looks like this:
def level_up
@level += 1
# * Level Up - Run a common event on level up (my event)
$game_temp.reserve_common_event(1)
self.class.learnings.each do |learning|
learn_skill(learning.skill_id) if learning.level == @level
end
end
Since I guess that this part is executed/run for each character that levels up, I want to be able to "catch" the right "actor" from my common event. That means, when I want to use "Recover All" (for now), I want it to be executed for the current actor that has leveled up. I then thought i could use global variables, or at least instance variables, like &actor_id, @actor_id, &level and @level. But I am probably missing something really obvious when trying to use those variables, or I am doing something totally wrong. Any idea on how I should do this? Preferably without adding any (more) scripts of my own. I mean, global variables should be accessible in events, right?
Best Regards
The1stOne
I'm sure this is a really simple question, if you know how, which I obviously don't.
I've just started playing around with RPG Maker VX Ace, and have been spending maybe five hours all in all so far. At least I have a map and a character up and running in my game. Now I wanted a feature, that when I level up, I wan't the character to recover all his HP and MP. I thought I would start out easily, by using the predefined "Recover All" when making a Common Event, and then work my way down to only recovering the HP and MP, not all "stats".
To do this, I had an idea of making a common event, that I then call from the script Game_Actor under the def level_up-section. It looks like this:
def level_up
@level += 1
# * Level Up - Run a common event on level up (my event)
$game_temp.reserve_common_event(1)
self.class.learnings.each do |learning|
learn_skill(learning.skill_id) if learning.level == @level
end
end
Since I guess that this part is executed/run for each character that levels up, I want to be able to "catch" the right "actor" from my common event. That means, when I want to use "Recover All" (for now), I want it to be executed for the current actor that has leveled up. I then thought i could use global variables, or at least instance variables, like &actor_id, @actor_id, &level and @level. But I am probably missing something really obvious when trying to use those variables, or I am doing something totally wrong. Any idea on how I should do this? Preferably without adding any (more) scripts of my own. I mean, global variables should be accessible in events, right?
Best Regards
The1stOne