Need help with turning a repetitive event into a Common Event

1. The event page looks fine to me, just one question; what exactly does \autoevent do? I am not familiar with that. It's probably not the problem but the more information the better.
2. So which variables are now 50, 51 and 52? I mean what are their associated names
3. What about the common event page for "LevelUP"? That seems to be the likely problem then.

Also sidenote; wouldn't it be more comfortable for the player if that event was "player touch" instead of "Action button". That one is just a suggestion.
\autoevent is a text position using Yanfly's Message Core+Pack
Variables now:
50: \i[72] Mana
51: Level Up
52: \i[73] Next lv

wouldn't it be more comfortable for the player if that event was "player touch" instead of "Action button".
Not really. Player Touch are not always a good idea for an event unless you'd make a cutscene out of it.
Okay then. could you post another screenshot of your current "LevelUP" common event then?
That is likely where the problem lies since your event page looks fine to me.


Another sidenote; You could also put the entire content of that event page into another common event because no element in there is dynamic. That way, if you need to change something about it later, ALL of your existing "Save Points" will be affected.
Now, this is how the current Common Event looks like after your instructions.
Spoiler: Common Event
Common Event.png

I never save my playtests. I always start New Game. Even if I've saved, I'd make sure to delete it/them immediately after.
#1 The first "Control variables" command still references variable 7, that might cause the issue.
It should be variable 50.
#2 Make sure that the variables referenced in your conditional branch at the beginning are also correct.
Variable 50 >= Variable 51

#3 Also, in the else-branch you need to swap the + and - from the "control variable" commands
-> Next Lv.: += Level UP!
-> Next Lv.: -= Mana

That should - emphasis on should - do the trick.
After all that, the result is still the same..
Even the Else part doesn't work..

Am I still missing something?
recheck @ScorchedGround image and double check is correctly, double check
the variables and the variable check as conditional branch (+Common events)
if you use it there as well. if you miss 1 thing, it doesn't work.

are you really sure everything is correctly with the variables?
@Elliott404 Okay, sorry for bugging you so much, but please send me another screenshot of the common event with the changes you made. 😐

Did you make sure the conditional branch is set up correctly?
Variable 50 \I[73]Mana >= Variable 51 Level UP!

Important:
Did you set the Variable 51 Level UP! to a "starting value" like 100?
That needs to happen before you call the common event.

Other than that, are you sure that the variables are not manipulated anywhere else in your game?
You could use the "event searcher" tool to make sure.
@ShadowDragon I did... 😢

@ScorchedGround Actually, I should apologize for all the trouble, sir 😢
Spoiler
Common Event.png
Hmm... that does look correct this time. This is starting to become strange :kaomad2:
What actually happens when you call the common event right now?

Here are some things I would like to test out to get to the bottom of this:

#1 create a new empty map
#2 put the player starting position there.
#3 copy one of your "save point" events somewhere in the map
#4 create an event on parallel process that sets variable 51 (LevelUP) to 100 and variable 50 (Mana) to 0.
-> (don't forget to delete that event after it resolves ("Erase Event" command)
#5 create another event that gives you mana points when you talk to it. (Variable 50 (Mana) += 50 for example)
#6 test the game and activate the save point, test it out with different amounts of mana.

If that does not work, try creating a new project altogether and try the previously mentioned steps again.
Remember to make backups of your game just to be safe.
Make sure at Test start Variables like Level Up got the correct Values, else the Branches would not work.

You could include that Math directly, than it could look like this:
(Not my intention to bring more confusion into this Topic, but i thought maybe its ok to show)

1st Block calculates the needed Mana for each Level, i assume i used something like your Formula, just with Event alternative instead of Scriptline + The Player Level plays into this or was that not needed?
LV1 = 100 Mana needed, Lv2 = 200, Lv3 = 300, Lv10 = 1000

manalvupfantaawesomia42.PNG
Sorry.. I had to sit back, take some rest, and rethink about the Common Event. And I've realized that the script call had nothing about leveling up besides math for variables, which could be a reason why the level up part didn't work.
Yeah, the script call is only there to increase the cost for leveling up.
And you only need to make a script call if you want the cost to increase in a custom curve.

You don't need the script call if your needed mana goes in a flat curve like
lvl 1 = 100 Mana
lvl 2 = 200 Mana
lvl 3 = 300 Mana
etc.

In that case you can just increase variable 51 by 100 each time you level up.

I thought I made that clear in my first post on this thread (in the attached picture I made comments in the event page to clarify that)

If you use a script call to change you variable, you are not restricted by the default "control variable" command. You cannot easily multiply by 1.5 for example when using the default command.

And you can use all mathematic operators and all kinds of formulas in a script call.
@ScorchedGround You did? I'm sorry, I think I've missed it since I'm not good with codings.
I also missed the part where you wanted me to explain about the level up system.

Basically, every enemy (depends on their level) gives the actor Mana (custom EXP) if they won the battle. The witches/wizards have to maintain their mana for level up, and to balance their use of magic (improve m.atk/m.def), as well as being able to learn more magics (using Yanfly's Skill Learn).

So, I want script call that levels the players up if the amount of mana needed is met when they pick 'maintain mana' in the rest area(s). Otherwise, they'll be told that the mana is not enough.
In that case, my method should still work (in theory)
See the attached file, that is what it should roughly look like.

If it still does not work, go through this list again and check everything:

- Check all of your variables used in the common event and make sure they are all correct
- Make sure the involved variables are not manipulated elsewhere (except your mana of course which changes after each battle and when leveling up) The "event searcher" in the "tools" section can help.
- Make sure all the commands are in the right order (check the attachment)
- If it still does not work, refer to my earlier post:
Here are some things I would like to test out to get to the bottom of this:

#1 create a new empty map
#2 put the player starting position there.
#3 copy one of your "save point" events somewhere in the map
#4 create an event on parallel process that sets variable 51 (LevelUP) to 100 and variable 50 (Mana) to 0.
-> (don't forget to delete that event after it resolves ("Erase Event" command)
#5 create another event that gives you mana points when you talk to it. (Variable 50 (Mana) += 50 for example)
#6 test the game and activate the save point, test it out with different amounts of mana.

If that does not work, try creating a new project altogether and try the previously mentioned steps again.
Remember to make backups of your game just to be safe.

Sidenote; I am not really a coder either (atleast not in javascript), but there are a lot of useful "code-snippets" you can utilize with ease even if you are not a coder.
Kind regards
@ScorchedGround why not make a tiny demo for her that is works, so see can see it
ingame and test that out, that way, she can check hers with yours and see what events
or common events used to make it work that you explained 🙂

To be honest, I want to save that demo for my own as learning process 🙂
No.. You don't have to bother yourself with my problem any further.
Sure, I'll leave you with your game then, @Elliott404 .
I am sorry I can not be of more assistance. Good luck with your project! 😂

If you do decide to pick my system up again, feel free to come back at me.
And if not, I wish you the best in finding a system that works for you!

@ShadowDragon I don't mind making a demo, but I never uploaded such a demo before, do you know how I would go on about that? I'd like to post it here in the case @Elliott404 decides to also take a peek.
Thank you very much for everything, sir! I'll close this thread for now.

Closed at OP's request.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-turning-a-repetitive-event-into-a-common-event.124773/