I'm doing a project and I want the player to receive an item whenever the variable based on his XP reaches a certain value, in this case, the value 5,000
So, when the player reachs 5,000 XP he will get the item, and when he reachs 10,000 XP he will get the same item again, and the same thing will happen when he reaches 15,000, 20,000, 25,000, creating this loop.
I tried to do a event with this concept, but it didn't work the way I wanted it, whenever the player reached any value above 5,000 he won the item.
I would like to know if it is possible to make the variable only activate the event when it accumulates a value that in this case would be 5,000 to 5,000.
You could do it with multiple events, one for each level. Then when the event for 5k runs, have it self-switch to a blank page and do nothing ever again...
If you're using a common event - you can't do that. You could create a second variable which tracks the rewards given. 1 for 5k, 2 for 10k, and have it check the second variable as well.
Something like :
Conditional: if XP>=5k
Conditional: if XPRewards < 1
then
do 5k reward
XPReward +1
End Conditional
Conditional: if XP >= 10k
Conditional: if XPRewards < 2
then
do 10k reward
XPReward + 1
End Condtional
etc...and so on for the rest of the reward tiers.
several ways, depending on what exactly you want.
the main problem is that the event condition that you are most likely using is var >= value - there is no equal condition in the event page. If you want to continue using event page condition, you would have to make pages for the between - >5000, >5001, >10000, >10001 and so on.
better solutions would be to not use page conditions but conditional branches on one page, but that would require constant checking.
another alternative is using two variables for comparion, or the modulo operation in control variable and a few more variabts.
If you can show us a screenshot of your current event, it would help deciding which way is best for you as your current description is a bit small.
Depends on when you want it ran. On the world map outside a battle, I'd have a parallel event running to check the XP levels, when it hits a threshold, run the commands you're wanting, and set a variable for the number of times it's ran (so that it doesn't run all the time), or a switch for each threshold.
For example, since you want it ran every 5k, I'd have the variable for your threshold count set at 1 at the beginning of the game, and checking to see if the actor's XP is over 5k * the variable, if it is, run the event, and at the end of the event, increase the variable by 1.
Haven't tested any of that and I'm fairly new to this myself, but that's how I would first attempt it.