Skill learn sound

● ARCHIVED · READ-ONLY
Started by ScoopJohn 6 posts View original ↗
  1. Hi guys, is there a scriptlet that lets you play a sound for everytime you learn a skill?
  2. Bump
  3. Bump
  4. Here is a snippet for you:

    Spoiler
    class Game_Actor < Game_Battler alias add_learn_se8875 learn_skill def learn_skill(skill_id) unless skill_learn?($data_skills[skill_id]) # ("filename",volume,pitch) # [switch ID] RPG::SE.new("Sword4",80,100).play if $game_switches[400] end add_learn_se8875(skill_id) end end
    Change the sound effect you want to play by editing the line below the comment line.

    PS. You should not bump your topics that often. o.o
  5. I want to use this, but I noticed a weird bug: it also plays the sound effect when you're loading a file. (I'm using the Yanfly Save Engine, so maybe it's an incompatibility with that?)
  6. Wow, never thought that would be an issue. o_O


    It happens because the 'learn_skill' method is run at the initialization of the actors.


    I edited the snippet to not play any sound effect unless a switch is turned ON. This way it won't trigger the sounds until you turn the switch ON.


    You can change the switch ID where I marked it (it is set to 400 in the snippet).