How do I make Skills obtained with Items only available for a few actors/Pokemon tm's system.

Ttoastty

Villager
Member
Joined
Jul 3, 2018
Messages
6
Reaction score
1
First Language
French
Primarily Uses
RMMV
Hello everyone,

In the Rpg game i'm creating, I want to make a Shopkeeper that sells books thats makes you learn a skill like in Pokemon (tm/hm)
But I want for some skills to only be available for some actors. Like for example there is a book making you learn the skill "fire"
and I want only the actor N°2 and 4 to be able to learn that skill but not the others.
I know it is possible to make the skill able for 1 actor only but I can't find a way to make it able for like 2 or 3 of them.
Does anyone know how to do that with a plugin or something?

Thanks in advance!
 

Autofire

PICNIC Solver
Veteran
Joined
Aug 4, 2017
Messages
50
Reaction score
23
First Language
English
Primarily Uses
RMMV
I depends on how you are teaching these skills. I'm also not familiar with making a skill only usable for 1 actor, like you've said. You might be able to use Yanfly's Skill Learn System. It doesn't look like it depends on any other plugins.

If you want a single-use TM system, it's easier. You can just make compatible Classes use the <Learn Skill: x> note tag, and then the Skill's <Learn Cost> would require the TM item.

If you want them to be multi-use, you'd need to use the <Learn Require Eval>, and make it only return true if the player owns the TM item. Then you would not add a <Learn Cost Eval> since it isn't removing the player's TM item. (This gets a little more complex because you'll need the JS code for the check.)

It looks pretty configurable, too. If you don't want the menu to spoil things, you can probably make it hide unavailable skills, rather than gray them out. There might be an option in the plugin's settings. Let me know if there isn't one; I can tweak the plugin and create it a setting for that.
 

Ttoastty

Villager
Member
Joined
Jul 3, 2018
Messages
6
Reaction score
1
First Language
French
Primarily Uses
RMMV
Sorry for the late reply I couldn't be there but it worked really nice! Thank you very much !
And there is no option to hide unavailable skills sadly, if you can create a setting for that I would be really thankful!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,512
Reaction score
12,002
First Language
English
Primarily Uses
RMVXA
You could do this completely without plugins, just by doing a Conditional check on the target. If it is e.g. Actors 2, 4, they learn the skill, if it's actors 1, 3, then they don't, along with a message saying e.g. "X cannot learn this skill."
 

Autofire

PICNIC Solver
Veteran
Joined
Aug 4, 2017
Messages
50
Reaction score
23
First Language
English
Primarily Uses
RMMV
You could do this completely without plugins, just by doing a Conditional check on the target. If it is e.g. Actors 2, 4, they learn the skill, if it's actors 1, 3, then they don't, along with a message saying e.g. "X cannot learn this skill."

I'm not really sure with how you'd do this with just events. (I came into RMMV with a lot of coding experience, but I'm still not the best at working with events.) I have no idea how to that kind of check when using an item. I can see calling a common event, but this common event won't know which actor we're targeting when using the TM item.

Do you think you could make an example?
 

Autofire

PICNIC Solver
Veteran
Joined
Aug 4, 2017
Messages
50
Reaction score
23
First Language
English
Primarily Uses
RMMV
@Ttoastty

Alright, here you go! This is a pretty simplistic script; it just removes stuff from the list of skills depending on the plugin settings. But you cannot do some more complex checks. If I were to add anything else to this, I'd support a notetag. Then you could more easily control which skills show up in the menu.

But this should be fine for what you need atm. Let me know if you run into an issue!
 

Attachments

  • RBP_YEPX_SkillLearnSystem.js
    4.1 KB · Views: 5

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
I'm not really sure with how you'd do this with just events. (I came into RMMV with a lot of coding experience, but I'm still not the best at working with events.) I have no idea how to that kind of check when using an item. I can see calling a common event, but this common event won't know which actor we're targeting when using the TM item.

Do you think you could make an example?

Actually, if the item is used on the menu, you can use this in the common event to get the target id to a variable which you can use to tell who the learn skill target will be

$gameParty._targetActorId

Alternatively, you can also use the damage formula for this since you can make it run any valid JS code. Basically you use the damage formula to check the target and add the skill if the target can learn it. But you will need to add a valid effect to the item or else the menu might not allow you to use it. For simplicity I use the Recover TP effect for this (set to 0 so it doesnt actually recover anything).
 

Latest Threads

Latest Profile Posts

I found an absolutely brilliant lifehack on the internet today.

Screenshot_760.jpg
It does sometimes get a little embarrassing that I often come here to ask for help with something and seldom have anything to actually show for it. If there is one thing though I can commend myself for, it's for sticking with an idea I've been tinkering with for this long now and gradually making headways. Even though I've been reserved about my progress, I can say I'm farther now than where I initially started.
I'm gonna put my project on pause for a tiny bit so I can explore the engine outside of it... Winging it can only get you so far LMFAO
Have seen some of my favorite people here posting and helping others with questions today -- love to see it!

Forum statistics

Threads
116,134
Messages
1,096,064
Members
151,555
Latest member
Fotdur
Top