Hi guys!
I need help with this.
I want to give a player a certain item whenever player levels up.
Problem is I don't know how to make a common event that will check if player leveled up.
I tried something with variables as player lvl but it didnt work.
Maybe there is a script that will help me? I tried to search for it too but found only something for MV version.
At the start of every battle, call a common event that stores player level into a variable and turns on a switch.
Have another common event set to autorun with the trigger being the switch used above. This common event stores the player level into another variable. Then, run a conditional branch that checks whether the 2nd variable is higher than the 1st, and if so, gives item to the player. Afterwards, turn off the switch to stop autorun.
It would still follow a similar process, just change the way it detects the end of a battle or whenever EXP is gained.
The Parallel Process in the last screenshot continues to trigger because it's not shut down. But without knowing what triggers it, not much I can say about it.
the simplest solution would be to make the common event, with no checks, and use a plugin to add the call after the level-up.
there is a function for checking the level-up, by default, and the common event itself isn't much of a challenge either, if it's just giving out an item.... so, it all boils down to adding one instruction to that level-up check.
is this something that will happen every time they level up?
who's leveling up? just the main actor, or any characters?
can this happen out of battle too?
because the actual check for level-up belongs to the actor object, and there's no actual processing within the battle itself, the battle manager lets the individual actors do their own check.
so, with that, you can do this out of battle if you need to.
Okay thanks for help I solved it by myself with a little help of Milennin idea.
I made common event that runs once when you kill an enemy. If your lvl is not higher than before killing him event turns off. If its higher you get an ITEM and level variable gets updated and event turns off also.
For example:
Im on lvl 1 and I kill an enemy.
After killing him im on lvl 2.
Common event sees that im 1 lvl higher.
I recieve item and variable get's updated to lvl 2.
If I kill more monsters up to lvl 3 everything repeats.
well, Roninator caught my idea, although I was thinking of just adding a reserve_common_event(X) call in the XP calculation and leave the processing to the common event, for ease of handling.
not a fan of using modules and customization through scripts, when the processing will be done by a common event... After a while, you get split between the two when you start changing things and it's a mess.
Moved to: RGSS3 Script Requests