The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Rukishou on March 18, 2007, 08:00:57 AM

Title: [RESOLVED]Learn new attack after every "special" fight?
Post by: Rukishou on March 18, 2007, 08:00:57 AM
Hi! I'm making a pokémon game, Pokémon Marble Version, and I need to make a system where every time a gym-leader gets beaten by the player you unlock the ability to use a HM-attack!!

For example:
•Get to the first gym
•Get through the gym-maze
•Battle the gymleader and win
•Unlock the ability to use the HM01-attack, Cut!

Anyone that can help me with this? I know I could use switches, but that would be too hard... Not difficult but boring ...
I was hoping I ccould use variables but I'm not to good at that so could someone please help me?
Title: Re: Learn new attack after every "special" fight?
Post by: modern algebra on March 18, 2007, 08:45:02 AM
Can't you just include the Change Skills: Cut + command into the event that holds the boss fight?
Title: Re: Learn new attack after every "special" fight?
Post by: Rukishou on March 18, 2007, 09:55:34 AM
Probably... It's just that I'm new to rmxp and I'm not entirely sure on every function in eventing... ^^' But if this worksd... :D I'll ntry it right away!
But will this learn the player the skill or will it give him the ability to USE it?
Title: Re: Learn new attack after every "special" fight?
Post by: modern algebra on March 18, 2007, 05:54:32 PM
I understand those to be the same thing... It will be permanent knowledge of the skill so he can use it as much as he wants whenever he wants as long as he has enough mana. If you want it to be a one-time use skill, then you can make it so that the skill, when used, calls a common event which makes him forget the skill...
Title: Re: Learn new attack after every "special" fight?
Post by: Rukishou on March 18, 2007, 06:28:35 PM
okay! But, oh, one other thing!
If I want the player to be able to have the skiull before he can use it... How do I do that? So that the "special" fight (if won) will activate the powers :P
Title: Re: Learn new attack after every "special" fight?
Post by: SexualBubblegumX on March 18, 2007, 06:37:36 PM
Make a fake version of the skill, then at the boss fight replace it with the real version.


_EDIT_
I fixed it because my typing is god awful.
Title: Re: [RESOLVED]Learn new attack after every "special" fight?
Post by: Kokowam on March 18, 2007, 08:58:53 PM
Uhh... I didn't understand what Bubblegum said... Anyways, you could do a "special loss handler" or whatever it's called and make it so if you lose, you get game over-ed. If you win, then you get the spell and whatever else you want to happen. I think that's it...
Title: Re: [RESOLVED]Learn new attack after every "special" fight?
Post by: Blizzard on March 19, 2007, 12:42:47 PM
[code]SPEC_SKILLS = {1 => 15, 2 => 20, 13 => 11}

class Game_Battler
 
  alias skill_can_use_special_later? skill_can_use?
  def skill_can_use?(skill_id)
    if self.is_a?(Game_Actor) and SPEC_SKILLS[skill_id] != nil
      if $game_switches[SPEC_SKILLS[skill_id]]
        return skill_can_use_special_later?(skill_id)
      else
        return false
      end
    else
      return skill_can_use_special_later?(skill_id)
    end
  end
 
end


Use this little script. Ok, this is how you need to connect skill IDs and switch IDs:

SPEC_SKILLS = {SKILL_ID1 => SWITCH_ID1, SKILL_ID2 => SWITCH_ID2, SKILL_ID3 => SWITCH_ID3}

Turning on the switch will allow the normal use of the skill. If the switch is off, the skill is automatically unuseable, regardless if it was learned or not. It will be displayed greyed out like unuseable skills are usually are displayed. Note that the switch affect this skill of all characters.[/code]
Title: Re: [RESOLVED]Learn new attack after every "special" fight?
Post by: Forty on March 19, 2007, 04:57:38 PM
I personally think that using switches is the easiest, or Bubblegum's idea. Try common events
Make it to where you try and use the skill, it checks for the switch (say 001: Cut) and if it doesn't find it, then say that it wont work.