The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: dudeguy119 on July 18, 2012, 09:42:59 PM

Title: [Solved][VX]Script Call event command to learn passives? (YEM Help)
Post by: dudeguy119 on July 18, 2012, 09:42:59 PM
So, I'm using YEM, and I have certain instances--namely, when characters age as part of the story--where I would like to be able to teach a passive skill to a character VIA an event. The reason for this is that I want the aged character (with a new field sprite, face, profile picture, and battle animation set) to have the the learned passives carry
over from the younger version of that character.

I have attempted this VIA the script function in the events editor, but I'm having trouble finding the right code to call the function of the script that would attach a
passive to that character.

I can, of course, just add the state to that character with an event, but it doesn't show the passive associated with that state as having been learned and can be selected again for learning.

I know it has to have something to do with the section with @actor.learn_passive(passive.id), but I cannot figure out how to target a specific actor with it.

If this cannot be done, I'll either have to find a way to code in a linked passive learning, or create some other way of learning these passives I created.

EDIT: Forgot to attach YEM Skill Overhaul. Unlike a lot of YEM, I have not edited this outside of the User Settings. I doubt highly that any of my changes to YEM could affect the function of this script.
Title: Re: [VX]Script Call event command to learn passives? (YEM Help)
Post by: modern algebra on July 18, 2012, 11:07:19 PM
Umm, try:


$game_actors[1].learn_passive(5)


Replace 1 with the ID of the actor who you want to learn the passive skill, and replace 5 with the ID of the passive skill.
Title: Re: [VX]Script Call event command to learn passives? (YEM Help)
Post by: dudeguy119 on July 18, 2012, 11:49:19 PM
It worked! Yes! Thank you so much. What I had was close to that, but no cigar. I feel a bit dumb for not having thought of that first.

You've already got some special thanks credit in my game (Some of your scripts sparked some original ideas of my own--no plagiarism, I promise). You've been a pretty big inspiration and help. If I had the ability to give rep, you'd have it. Again, thank you!