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: 1)

Latest Threads

Latest Profile Posts

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!
Gosh I hate fireworks. Especially if you cant even see em. Its just noise. Noise that scares my pets.
Some (totally) differfent (more traditional) Goblin faces...

what do you guys think?
My game = 4.5k hours, 4 years+ and should be done in 3 weeks!!

OMG so excited!

I plan to finish before my b day, July 21st.

Forum statistics

Threads
99,238
Messages
963,314
Members
130,820
Latest member
viewtifuljoe
Top