Can't make a item that gives user Exp

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
444
Reaction score
226
First Language
English
Primarily Uses
RMMZ
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,125
Reaction score
10,639
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
31,365
Reaction score
7,675
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
399
Reaction score
221
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

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top