Need help with turning a repetitive event into a Common Event

Status
Not open for further replies.

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
676
Reaction score
2,033
First Language
English
Primarily Uses
RMMV
I've managed to finally create a custom level up system using variables, but, I realized that I'll be copying/pasting them in every rest event in battles maps. I want to turn it into a Common Event where I won't have trouble with it, but that might mean more tedious planning since I've made a custom token for leveling up using a variable:
1st page
Event01.png
Next page (Autorun) [SwitchA]
Event02.png
Next page [SwitchB]
Event03.png
 
Last edited:

magnaangemon01

Miles Montgomery
Veteran
Joined
Jun 7, 2014
Messages
447
Reaction score
237
First Language
English
Primarily Uses
RMVXA
I know one of the RPG Makers had a way to recall a certain event. You could always try that.
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
49
Reaction score
27
First Language
English
Primarily Uses
RMMV
One approach would be to combine all of the levelup logic into a single common event page. Here's an example from one of my creations that checks 'Callus' (the equivalent of XP) :

hand_up.png
hands_up2.png

I believe you'd need to incorporate one additional switch or variable that reflects the current level (the equivalent of 'Has_Scuffed_H' and 'Has_Callused_H above) which verifies that the player doesn't yet have that level.

With that, you could have a single page that checks for Maintain_Mana, then takes the appropriate levelup action based on the current level and mana.

A Common Event may take some time to configure, but ultimately could save you a ton of time if you want to adjust the behavior at some point, and as you said when you create new rest events.

Also sorry if I'm misunderstanding your objective.
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
676
Reaction score
2,033
First Language
English
Primarily Uses
RMMV
So... I'd create a long lost of conditional branches?
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
49
Reaction score
27
First Language
English
Primarily Uses
RMMV
So... I'd create a long lost of conditional branches?
Exactly right! A single Common Event full of conditional branches, each handling one of the levels, each also checking for some switch/variable/condition indicating that the level hasn't yet been obtained, and that the prerequisites for the level exist.

Then, have your rest events reference the Common Even, which does the rest.

Good luck!!
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
676
Reaction score
2,033
First Language
English
Primarily Uses
RMMV
I think I need a liiiittle help :LZSlol: :LZSlol:
So.. This what I've created so far:
This is for the amount of level up tokens
CommonEvent02.png
This is for the amount of tokens needed if the player leveled up:
CommonEvent03.png
This is for requirements text if the conditional did not meet its requirements:
CommonEvent01.png
I feel like using a script for the player's level in conditional script would be easier .__.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,484
Reaction score
400
First Language
German
Primarily Uses
RMMV
Can you explain how this Mechanic plays out in the Game?
Iam not getting all the details of what shall happen while playing.
And is this after Battles or when talking to a NPC?`What are Tokens in this Scenario?
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
676
Reaction score
2,033
First Language
English
Primarily Uses
RMMV
This is for collecting tokens (Mana, which it's a variable) after battles, depends on battles. Once they get, lets say, 150 Manas, they can use 100 as the price for leveling up.
This how it'd look like in the menu with Yanfly's Menu Variable:
027faef22cd6d87ffc560444f59e50e5.png
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
49
Reaction score
27
First Language
English
Primarily Uses
RMMV
Here's an outline of what I was thinking:

level_up.png

So, a series of nested conditional branches which first check what the Level UP! value is, then check for sufficient mana, then take the level up steps if it's all good.

You'd just need to set the initial Level Up! value to '1' at the start of the game, you could use a parallel event on the starting map for this that flips to an empty page after doing so.

You may be right that a script would be easier, but I am alas not a great coder.

EDIT: In the second conditional branch, the Level UP! value would be changed to 3, rather than the 2 shown.
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
206
Reaction score
321
First Language
German
Primarily Uses
RMMV
@Elliott404
Hey, Elliott

Maybe this can help you and you don't even need to configure each and every level up:

3 Variables:
ManaCurrently = stores the players current mana.
ManaToLevelUp = stores the amount of mana needed to level up.
ManaNeeded (optional) = shows the player how much more mana is needed to level up.

If your game does not have a flat mana curve, you can use this script call to do a custom mana curve:
$gameVariables.setValue(X, CURVE);

You can replace CURVE with any formula like this one:
$gameVariables.setValue(X, Math.floor($gameVariables.value(X) * 1.5));

X is the variable ID of ManaToLevelUp

With that formula the mana needed for each level up is increased by 50% each time.
level 1 = 100 mana
level 2 = 150 mana
level 3 = 225 mana
etc.
 

Attachments

Last edited:

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
676
Reaction score
2,033
First Language
English
Primarily Uses
RMMV
@akoniti Tried that in a new Common Event list (After disabling the current ones), nothing happens.

@ScorchedGround I've disabled the EXP since I don't need it, and I had problem with it that the minute the player gained EXP, it'll automatically level up without the variable needed so I've removed it. Thank you tho. I'll try it out.
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
206
Reaction score
321
First Language
German
Primarily Uses
RMMV
Hmm? But I thought you wanted to put your leveling system into a common event right?

What I proposed there was made with your mana system in mind.
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
49
Reaction score
27
First Language
English
Primarily Uses
RMMV
@akoniti Tried that in a new Common Event list (After disabling the current ones), nothing happens.
When you tested it, what were the Level UP! and Mana values? Remember, you'll need to set Level UP! to 1 at game start for this to work- if it's at 0 nothing will happen, since the Common Event begins by checking if its equal to 1.

I use the Debug tool included in this package to set and check things like var and switch values during testing:


EDIT: I'll also say that from the looks of it, @ScorchedGround has far greater engine and code knowledge than myself (as well as a hilarious signature)!
 
Last edited:

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
676
Reaction score
2,033
First Language
English
Primarily Uses
RMMV
@ScorchedGround Sorry, I didn't see your reply till I've replied to akoniti. Now that I've tried your suggestion, it wasn't much effective. It kept the 150 Mana without leveling up.
EDIT: Hold up, I forgot to add something
EDIT2: Nope, nothing happened. I've definitely made an error:
ce.png
My knowledge of code is below amateur
 
Last edited:

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
206
Reaction score
321
First Language
German
Primarily Uses
RMMV
@Elliott404
Just to make sure, are you going with a custom mana curve or a flat mana curve?

Because you seem to use both right now (one under a false variable ID).

Assuming you are using the custom curve, try this:
 

Attachments

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
676
Reaction score
2,033
First Language
English
Primarily Uses
RMMV
It does nothing but adding Mana :LZSlol:
Would you like for me to tell you how the system should work?
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
206
Reaction score
321
First Language
German
Primarily Uses
RMMV
@Elliott404
Ok, let's play through the entire event, assuming that we have 127 mana and leveling up costs 100 mana.
Keep in mind, that you have to set the leveling cost for the first time (In this case 100) elsewhere.

Now, we call the common event:

#1 The conditional branch checks if we have enough mana -> 127 >= 100?
We do have enough mana, so we proceed to leveling up.
#2 We subtract the mana needed (100) from our 127 because we just spent 100 mana
#3 The message plays, saying how much mana we spent and how much we have left.
#4 Then we increase the amount of mana needed to level up again.
-> Assuming you are using my formula, the mana needed jumps from 100 to 150.
-> $gameVariables.setValue(X, Math.floor($gameVariables.value(X) * 1.5));
X is the variable ID of your Level UP! variable
#5 If you call the common event again, we have 27 mana left, but now leveling up costs us 150 mana.


#6 Else-branch:
This one is optional, we can calculate (for comfort) how much more mana the player needs to level up.
1. For that we set a third variable to 0.
-> that would be your \I[73]Next Lv.
2. Then we add the amount of mana needed for the next level up
-> \I[73]Next Lv. + \I[72]Mana
3. Then we subtract the amount of mana we have ; we get the amount we need to aquire to level up.
-> \I[73]Next Lv. - Level UP!
4. We play the message


Also Make sure all the variable ID's are correct, this is very important
it seems you swapped the variables in the script call, you need to put your Level UP! variable in there.

Edit: @Elliott404 Here is how it should look for you, But make sure to change all variable ID's to their correct ones. Try to make it 100% identical. (see the attachment)
 

Attachments

Last edited:

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
676
Reaction score
2,033
First Language
English
Primarily Uses
RMMV
Weird.. I did exactly as how you've instructed yet, nothing happens.
It just shows this, even after I've added a dummy event for the 150Mana:
iiii.png

EDIT: Yes, I've changed the Variables IDs
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
206
Reaction score
321
First Language
German
Primarily Uses
RMMV
Could you send another screenshot of your event? Because it works perfectly for me.
I'll look if I can find any bugs.

Also just for my clarity, could you tell me which variable ID your "Level UP!" variable had?
Because that is not obvious from your previous screenshots and it could help me.

Edit: also I seem to have misread a previous statement you made:
Would you like for me to tell you how the system should work?
Please explain your system if you want to, it could help me aswell.
I thought you wanted me to explain what my common event was supposed to do.
 
Last edited:

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
676
Reaction score
2,033
First Language
English
Primarily Uses
RMMV
Sure:
This event will be placed for several rest areas in battle map(s)
Event Editor.png
It used to be Var.05,07,09. I've changed them just now to Var50,51,52 for better solution.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

One 3-day jam and a Game Awards... this month is moving... \o/
Maker-ing has been being the best thing that happened to me this year so far. it is so good to rescue some old skills fo creativity and the people I have met are really incredible. I love my coffelanders and tocudos buddies. Maybe one day I will reach other countries folks too. S2
Well... My game plays better at 1920x1080, so I guess that's the new resolution. Still runs at 60FPS. :LZSexcite: Also... I really want a boss to be able to build new maps around the player... Mostly because it's visually spectacular! I'm er... not quite sure yet how I can do that without making MV explode.... But I'll find a way, anything in service to the "sparkles"! :kaopride:
How to change your netbooks screen resolution

Forum statistics

Threads
100,791
Messages
979,586
Members
132,436
Latest member
jefigeb851
Top