Can't make a item that gives user Exp

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
391
Reaction score
178
First Language
English
Primarily Uses
RMMV
I'm trying to make items that gives the user Exp, but it seems impossible by default. I tried using a common event using the Change EXP option but there's no way to apply the effect directly to the user & there's no option to target the user by default. The only way I see to get around this without a plugin would be to use a script call to either directly give the user Exp or to detect the user's Actor ID & store that in a variable.

Does anyone know if such a script call exists?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,066
Reaction score
10,364
First Language
Czech
Primarily Uses
RMMV
What about damage formula? a.gainExp(30); or something, not sure now what is the exact method as I don't have the script with me (although can be found inside the core scripts)

Then just add ;0; to make sure the eval returns 0 and doesn't heal your character.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,082
Reaction score
7,052
First Language
German
Primarily Uses
RMMV
or you could do what others do when needing to target an skill-event on an actor:
have the skill add an invisible and useless state to the user, and then use conditional branches to check which actor got the state. It's a bit more complicated than the solution above (it needs one conditional branch per actor), but it works even when the effect doesn't fit into the damage formula.
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
394
Reaction score
212
First Language
English
Primarily Uses
RMMV
a.gainExp(x) is the correct method.

If you're looking to pass information about the user or target to a common event from a skill you can assign their id to a variable using the damage formula as well, then you can just use event commands by designating with said variable.

Code:
$gameVariables.setValue(x, a.actorId())
Replace x with the variable id you want to use.

This avoids the need for any conditional branches.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

If you had some musical requests in line with me.. feel free to re post! Corona has killed me and have recently got my internet back <3
I'm now working on procedural generated World Maps for my own project.
Is there anyone who's interested in having this Plugin for his own game?
I have a dream where RMer are not blinded and too dependant on published script / plugins...
RM MV ACE? 2020? Super? Legends? Sword and Shield? 2.5D? RM Pixel? RM 2: Revenge of Squared RTP tiles? Don't mind me, I'm just wondering about what will be the name of the next engine.


So I came up with a new look for the paths, and along the way realized health bars are so overrated, so now a crazy red light trail follows her and gets shorter as her life decreases. :LZSexcite:

Forum statistics

Threads
98,212
Messages
950,360
Members
129,507
Latest member
ghost01zx
Top