Exp tree switch

Goodday all,

I have been breaking my head over something.

I've been trying to get 2 classes have different exp counters, as in one character has multiple classes/jobs. Yet I seem to get a strange loop-esque effect where variables shift.  Where Variable 2 = X / Variable 3 = Y then by force of "magic" Variable 2 suddenly becomes 0 Variable 3 becomes X and then on the next cycle Variable 2 = Y and Variable 3 is 0.

And I can't seem to figure out why. Any suggestions? Am I just blind?

Thanks in advance.

[IMG]http://s20.postimg.org/ye1f6mv21/Rpg_loopy_exp.jpg[/IMG]
Have you initialized the variables somewhere else? They should be both be set to 0 at the start of the game or before activating the event for the first time.
Dear EatYourBeetS,

They are unused anywhere else.

I tried to set them to 0 as soon as you enter the game. Same result unfortunately.

Thanks so far, could have been a possible thing.
Ok I got it to work, do something like this:

Spoiler
stuff.png
and change stuff accordingly. 🙂

Edit: Oops, typo in the first script, the second if statement is for v[3]
Thank you very much.

Also I notices something very dumb in my first attempt.

Changing classes after XP swap does not work. Apparently it resets it when changing classes.

That seemed to be causing the XP switch. From V2 into V3 / V3 into 0 \then\ V3 into V2 / V2 into 0. And so on. :|

But once again thank you. 👍 🙂
Are you SURE those variables aren't used anywhere else? Have you added any scripts? Have you checked to see if the scripts use variables? Have you ensured you're not reusing the same variables that the script uses?


If they choose the first swap, V2 gets set to XP, then XP gets set to V3, which is 0 at the start of a game.
Dear Shaz,

It works the way EatYourBeetS suggested. My comment addition was to notify any readers of the fact that class change has to happen before the EXP swap.
Quickly said:

1.Save EXP of current class

2. Make EXP 0 of current class

3. Swap class

4. Add EXP of other class

Original thread: https://forums.rpgmakerweb.com/threads/exp-tree-switch.37927/