Event only working if call durring a level up

Hello, I have been working an a somewhat complex event; which I've had two other topics on here to help me resolve issues I've had, and I've encountered one more issue that I don't understand. This should be the last as I've gotten everything else to work.


I think it may be important so I think I should first say that I'm using the plugins: HIME_BattleActionExp, HIME_LevelUpEvents, & StatDistribution, by FrozenPhoenix.


I think next I'll give a quick explanation of the 12 events. There's all the same minus the actor involved. When the player levels up a window pops up allowing the player to choose any of their stats the wish to boost. The number of points they have to boost their stats with is a random number between 4 & 7. This part works every time. After the player had distributed their stats the event is supposed to heal the player and run through multiple conditional branches to see if the player has high enough stats to learn skills. This is the part that does not always run.


If I use the 'level up' event command to trigger a level up, everything runs perfectly. If I try and use the common event without having leveled up at the same time, nothing past the stat distribution works. (I added a text box with the text "TEST" and even that didn't run) Normally this wouldn't be an issue, but because I'm using HIME_BattleActionExp, the actors can level up mid battle which; if they level up, forces the battle to reset and brings back any already killed enemies. To get around this I set up another event that checks if the player is in battle and if the player has leveled up, if so I trigger a switch that will stop the level up event from running until the battle ends. That fixed my mid battle level up problem but for some reason, the level up common event stops running just after the start of it.


Here are a few screen shots of the event. The red line is where the event stops running if called through the common event. If call through a level up it runs perfectly.


I tried to put spoiler tags around the pictures but I couldn't find out how. Didn't there used to be a button for that?


Event_Problem_1.png


Event_Problem_2.png


Event_Problem_3.png


Stat MDF is not on there twice.


Event_Problem_4.png


Everything below that is the same just with a different stat and different points needed for them. The skill learn part isn't the problem here so I didn't think including anything below this was needed.


Thank you for any help.
Are you using different variables for each actors' stats?
Are you using different variables for each actors' stats?

No I reuse the same variables because they are set in the event before they're needed.
What happens if 2 actors level up in the same battle then?
What happens if 2 actors level up in the same battle then?

Well if the event runs as they're leveling up everything runs fine. But if the event is called from the common event call then both will only run as far as the stat distribution.
Well if the event runs as they're leveling up everything runs fine. But if the event is called from the common event call then both will only run as far as the stat distribution.

That's because the system is trying to have variables with two potentially conflicting values.
That's because the system is trying to have variables with two potentially conflicting values.

I don't think that's the case because it's the same if I only have one party member or 3 partymembers. Also I'm using "HIME Common Event Queue" so each level up event should run one after the other. There should be no variable canflict.
Could you show a screenshot of your plugins please?
Could you show a screenshot of your plugins please?



Here is a screen shot of my plugins.


Plugins List.png
Common event queue should go above level up events in the plugin manager.
Common event queue should go above level up events in the plugin manager.

Thanks, I didn't notice that before.


I switched them around like you suggested but nothing's changed. The event still stops running after the stat distribution.
Are you trying that on a new save?
Are you trying that on a new save?

Yes, I tried it from a new game and still it doesn't work.
Those variables are still gnawing the back of my mind, could you create a new project, copy the plugins in the same order and the common events but change the variables and see if that works?
Those variables are still gnawing the back of my mind, could you create a new project, copy the plugins in the same order and the common events but change the variables and see if that works?

Ok, I've tried this, I made every variable unique and it still does the same thing. If I call the common event it still stops after the stat distribution.


I really don't think the variables are the problem here, because I have a far more complex set of events (6 common events running together, each many times longer than this event.) that re-uses variables in a similar manner and that event runs fine.


That event and this event share no variables, and in no way interact, but the way they're set up in terms of variables is similar.
Just below the red line, you have a control variable 490 level up actor -=1, what happens if this were to be removed?
Just below the red line, you have a control variable 490 level up actor -=1, what happens if this were to be removed?

It makes it so that the person leveling up and learning skills is wrong.


The variable is set between 1 & 4 everytime the event is called. That number represents the character who's leveled up, position in the party. However MV reads party memeber positions starting from 0, so after I set that variable I subtract 1 so that the event runs based on the right party member.
Yes but skills are added with actor id not party id.
Yes but skills are added with actor id not party id.

That would make sense. But the actors do gain their skills correctly if I trigger a level up. Which uses the same event. It only doesn't work if this event is called through it's common event.


I will however try that and see if it fixes my issue.


Edit: I just tried changing that -=1, and nothing changed. It still stopped at the same place.
If every common event is tied to a specific actor, why are you checking for actor id in the beginning?  Also, can you get 1 actor to level up, then press f9, and look up the values for variables 489-499 and see if they match the actor's stats?

Original thread: https://forums.rpgmakerweb.com/threads/event-only-working-if-call-durring-a-level-up.60520/