Event triggered by learning skills?

I have determined that it would be impossible to do this through eventing (since my skills aren't learned by level up) so I have come to request a script to this effect:

When a skill is learned, that automatically triggers a switch. Would this be possible?

Thanks!
Do you want a particular skill, or just a switch to be turned on when ANY skill is learned?


The second option means you could have a parallel process common event triggered by that switch, and then you could check each actor you're interested in, and what skills they have (without needing to know which one was just learned) and act accordingly.


To do this, just got to your Game_Actor script, and inside the unless ... end block, add $game_switches[id] = true where id is whatever switch number you want turned on.


If you only want it turned on when a specific skill is learned, or for a specific actor, then it becomes more complicated.
That should be easy enough... please try the following script, I believe it is a complete solution for you.

Spoiler
################################################################################# RSKSW - Reedo's Skill-Switch Script## Version 0.1 (beta)## September 17, 2013## By Reedo################################################################################# REFERENCES#### None. This is an original script by Reedo.################################################################################# FEATURES#### + Associates a skill id with a switch id## + Turns switch on/off when skill is learned/forgotten################################################################################### COMPATIBILITY#### Should be compatible with most other scripts.#### OVERWRITES (0)################################################################################# REQUIREMENTS#### Configure SKILL_SWITCHES hash with skill and switch ids################################################################################# INSTALLATION#### Plug-and-play#### Insert below Materials, above other add-on scripts.################################################################################# RIGHTS & RESTRICTIONS#### As with most Reedo scripts, this script is free to re-use, as-is, ## in personal, educational, and commercial RPGVX Ace development projects, ## providing that: this script is credited in writing displayed readily ## to the user of the final compiled code assembly.#### Reedo retains all rights of intellect and ownership.## You forego all rights of warranty by utilizing this script.################################################################################################################################################################ USER OPTIONS###############################################################################module RSKSW # hash of skill id and switch id SKILL_SWITCHES = { 130 => 5, }end################################################################################# MAIN SCRIPT################################################################################# EDITS BEYOND THIS POINT ARE AT YOUR OWN RISK!!!###############################################################################class Game_Actor #-------------------------------------------------------------------------- # * Learn Skill #-------------------------------------------------------------------------- alias reedo_sksw_ga_learn_skill learn_skill def learn_skill(skill_id) reedo_sksw_ga_learn_skill(skill_id) $game_switches[RSKSW::SKILL_SWITCHES[skill_id]] = true if RSKSW::SKILL_SWITCHES.has_key?(skill_id) end #-------------------------------------------------------------------------- # * Forget Skill #-------------------------------------------------------------------------- alias reedo_sksw_ga_forget_skill forget_skill def forget_skill(skill_id) reedo_sksw_ga_forget_skill(skill_id) $game_switches[RSKSW::SKILL_SWITCHES[skill_id]] = false if RSKSW::SKILL_SWITCHES.has_key?(skill_id) endend
The script could be extended to specify specific actors if needed.  As it stands, the switch will trigger for any actor that learns/forgets the associated skill.

To configure the script, simply fill out the SKILL_SWITCHES hash with skill and switch ids:

SKILL_SWITCHES = { 130 => 5, }This example sets switch number 5 for skill id 130.  Skill IDs are found in the database (the number preceding the skill name in the list on the left).

Original thread: https://forums.rpgmakerweb.com/threads/event-triggered-by-learning-skills.18142/