YEP Skill Mastery effective also out of battles?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
796
First Language
French
Unless I'm very mistaken, for a skill to gain points and in turns levels, it needs to be used in battles.
But I was wondering if it'd be possible to allow some skills to gain points (and levels also whenever they are cast on the map?
 

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
51
Reaction score
40
First Language
English
Primarily Uses
RMMV
I quickly put this together and it seems to work, if you're using Skill Core you can slap it on whatever skills that are usable outside of battle.

<After Eval>
if (!$gameParty.inBattle()) {
user.gainSkillMasteryUses(item.id, 1);
}
</After Eval>
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
796
First Language
French
Definitely seems to work on my side too.
Thanks for your help and brilliant knowledge!
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
796
First Language
French
@zaraku
The way I read this bit:
user.gainSkillMasteryUses(item.id, 1);

I have the impression it could be used with Skill Rewards too?
Like a specific condition (eg Killing, Critical etc) gives an extra +1 to the skill mastery.

Is it something you could insert to the usual Skill Mastery tags like for instance
<Defeat Reward: X>
?
 

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
51
Reaction score
40
First Language
English
Primarily Uses
RMMV
@zaraku
The way I read this bit:
user.gainSkillMasteryUses(item.id, 1);

I have the impression it could be used with Skill Rewards too?
Like a specific condition (eg Killing, Critical etc) gives an extra +1 to the skill mastery.

Is it something you could insert to the usual Skill Mastery tags like for instance
<Defeat Reward: X>
?
Hmm.. I'm not using that plugin and there seems to be no way of inserting your own code effect for those conditions. I think editing the plugin instead of using Skill Core/Buff & States Core tags might be easier depending on how many conditions you want to apply this to. Something like:

<Defeat Reward: +1 Mastery>

I'll see if I can do that tomorrow, but can I ask what conditions that you want to increase skill mastery with, just in case it doesn't work out?

EDIT: I'm blind, I didn't see that you can add more effects via plugin parameters. No need to edit the plugin directly.
 
Last edited:

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
796
First Language
French
I'm thinking of these 3

  • Defeat
  • Critical
  • Weakness

Thanks!
 

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
51
Reaction score
40
First Language
English
Primarily Uses
RMMV
I'm thinking of these 3

  • Defeat
  • Critical
  • Weakness

Thanks!
Open up the "Effect Code" in the Skill Reward plugin parameters, and add this snippet near the bottom, above the "Add new effects above this line" comment.

JavaScript:
// ----------------
// Mastery
// ----------------

} else if (data.match(/([\+\-]\d+)[ ]MASTERY/i)) {
if (isSkill) {
    var gain = parseInt(RegExp.$1);
    user.gainSkillMasteryUses(skill.id, gain);
    animation = animation || miscAnimation;
} else {
    skip = true;
}
It should work like the earlier example: <Defeat Reward: +x Mastery>.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
796
First Language
French
@zaraku
This one doesn't seem to work.

I did the following and use the tag <Defeat Reward: +1 Mastery> but nothing happened.

1591341993482.png
 

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
51
Reaction score
40
First Language
English
Primarily Uses
RMMV
@zaraku
This one doesn't seem to work.

I did the following and use the tag <Defeat Reward: +1 Mastery> but nothing happened.

View attachment 146641
It won't work if you put it in the js file, you have to set it here, but it's my mistake for mentioning earlier that you'd have to edit the plugin.

 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
796
First Language
French
Now working, brilliant addition, thank you.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
796
First Language
French
@zaraku
I've thought something, and please do let me know if I'm getting annoying.

Is it possible, via the Note field again, to add effects only if the skill has reached a given level of Mastery.
For instance (just for the sake of giving a concrete example), if Mastery level > 6, the skill adds a debuff to the enemy?
 

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
51
Reaction score
40
First Language
English
Primarily Uses
RMMV
@zaraku
I've thought something, and please do let me know if I'm getting annoying.

Is it possible, via the Note field again, to add effects only if the skill has reached a given level of Mastery.
For instance (just for the sake of giving a concrete example), if Mastery level > 6, the skill adds a debuff to the enemy?
It's probably better to use Skill Core notetags in that case, unless you want to edit the Skill Rewards effects, but that would mean you can't ever use those effects for skills that have a master level <= 6.

An example of the former would be:

<Post-Damage Eval>
if (user.skillMasteryLevel(item.id) > 6) {
target.addDebuff(0, 2); // debuff mhp for 2 turns
}
</Post-Damage Eval>

For the latter, go to the effect code that you wish to alter (again, this will apply universally). In this case we're adding a debuff:

JavaScript:
} else if (data.match(/ADD[ ](.*)[ ]DEBUFF,[ ](\d+)[ ]TURN/i)) {
  var str = String(RegExp.$1).toUpperCase();
  var turns = parseInt(RegExp.$2);
  var paramId = DataManager.getParamId(str);
  if (paramId >= 0) {
    user.addDebuff(paramId, turns);
  } else {
    skip = true;
  }
  animation = animation || debuffAnimation;
If there's already an if condition, you can just add "&& user.skillMasteryLevel(skill.id) > 6" to it, like this:
if (paramId >= 0 && user.skillMasteryLevel(skill.id) > 6) {

If not, just add "if (user.skillMasteryLevel(skill.id) > 6)" right before the code(s) that add the effect:
if (user.skillMasteryLevel(skill.id) > 6) user.addDebuff(paramId, turns);

Also be aware that for checking mastery level, skill core would use "item.id" while skill rewards uses "skill.id".
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

have another character sheet! ill probably add some more details before i make my thread for this project
Every time the official RMWeb account makes a post, I think it's @Eliaquim writing it!

It's driving me crazy, but it's also wonderfully hilarious.
// Looks at Elfkisser, realizes he'd have to either install Windows 10 or compile it for Linux
// Didn't install Elfkisser.
Too much effort for a curiosity. :popcorn:
I was just high-fiving myself for all I've learnt in the engine, and how far I've come, only to forget to remove the Immortal state from a semi-scripted battle. Now the enemy never dies and I feel so smart >.>
Playtest your stuff. Always playtest.

Forum statistics

Threads
99,224
Messages
963,227
Members
130,813
Latest member
Gremter
Top