YEP_SkillRewards: giving EXP

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
796
First Language
French
Is it possible to have one of the rewards give EXP?
For instance if the skill kills the enemy, a given amount of EXP is awarded to the actor (could be in a variable too).
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,653
Reaction score
1,105
First Language
EN
Primarily Uses
RMMV
Adding experience via script goes like this:
JavaScript:
actor.gainExp(100);
So, following the pattern of the other entries in the parameters of the Skill Rewards plugin, I'm guessing this sort of thing will do what you're after (untested):
JavaScript:
} else if (data.match(/([\+\-]\d+)[ ]EXP/i)) {
  // "+X EXP" - add fixed amount of experience
  if (user.isActor()) {
    value = parseInt(RegExp.$1);
    user.gainExp(value);
    animation = animation || miscAnimation;
  } else skip = true;
} else if (data.match(/([\+\-])V\[(\d+)\][ ]EXP/i)) {
  // "+V[X] EXP" - add experience equal to current value of game variable X
  if (user.isActor()) {
    value = v[parseInt(RegExp.$2)] || 0;
    if (RegExp.$1 === "-") value *= -1;
    user.gainExp(value);
    animation = animation || miscAnimation;
  } else skip = true;
Try adding that to the Effect Code parameter in the Plugin Manager (just above the "Add new effects above this line" part), stick something like a <Defeat Reward: +100 EXP> notetag into your skill's notebox, save your project (to apply the Plugin Manager changes) and test~ :kaophew:

For reference, the "match" parts of the code are regular expressions; technical details here:
 

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

Latest Threads

Latest Posts

Latest Profile Posts

What are your experience on trying to boost a MV project on an Android 7+ phone to a constant 60 fps? It's very hard for me(mine is 720x1440 px with Octa-core 1.8 GHz Cortex-A53 and Adreno 506), especially with an ATB system plugin. The best minimum I can get is 30+ fps :)
MZ Spoiler Thread: Blah, blah, blah, blah...
Me: :kaoslp:
Mog: Star Ocean Battle system!
Me:
:MV1:
Hosting a private game jam...might have smthng to post soon if I can fix these dang parallaxes.
Oof it's been a while...well I'm back to stay!

Forum statistics

Threads
99,245
Messages
963,372
Members
130,829
Latest member
Fn02
Top