Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Class change at level-up ... ?

Cheers, fellow RPG Makers!

Anywho, I have a little something in mind that I would like to implement, if possible. ^^;;

The deal is, as the characters in my game level up, I eventually want their classes to change, and automatically promote at the target levels.

I'll use the character Celestia as an example:

She'll start off being a Fighter at level 1. At level 30, I would then want her to promote to Knight. And then promote once more at level 60 to Paladin.

Now, I did see an event that lets you change a character's class. But, how would I go about telling the game that I want the class changes to automatically happen at the target levels?

With all that said, any assistance would be greatly appreciated.

Also, I'm working with the XP version, if that helps. ^^;;
 
If you're using event based enemies (rather than random encounters), you could call a common event at the end of each battle that checks levels, and advances the actors accordingly. (Normally, EXP & Level only increase during battle).

If you're using random encounters, or want the class change to occur immediately (while in battle), then some scripting would be required.
 

Jason

Awesome Bro

Can't you just make a common event and set it going at the start of the game, that checks the players level in a variable, and if it equals a set variable, their class changes ? You could even get it to notify them, although it'd happen outside of battle o.O
 
Velocir, sure you could. But if you're going to do that you might as well just write the level check as a script itself.

JB, You could do that, but do you want the common event running all the time? Makes more sense to only have it running when it's needed (after battle).
 
Scene_Battle2, line 173

Add this line after 173:

$game_switches[1] = true

Where 1 is the number of a new switch.


Then do a common event, condition: switch 1 is on, type: autorun

Have this do your class change, and then set switch 1 to off.


Should work; haven't tested.
 
Brewmeister":nyt5tmit said:
If you're using event based enemies (rather than random encounters), you could call a common event at the end of each battle that checks levels, and advances the actors accordingly. (Normally, EXP & Level only increase during battle).

If you're using random encounters, or want the class change to occur immediately (while in battle), then some scripting would be required.

Yeah, I'm looking for the promotions to happen as soon as the target levels are achieved.

So, let's say you have level 29 Fighter Celestia in battle. At end of said battle, assuming she gains enough exp to hit 30, she'd then automatically be a level 30 Knight. Same goes for the same promotion from intermediate to advanced class at 60.

And oh yeah. For now, I'm planning on all non-boss enemies to be random encounters. ^^;;
 
Couldn't you in # * Frame Update (after battle phase) at the bottom of Scene_Battle2
turn on a switch ($game_switches[switch_id] = true) and then run the common event when that switch is on
:huh: :huh: :huh: :huh: :huh: :huh:
 
It depends on whether you want to make the player aware on the battle screen or on the map.

If you want "Celestia is now a Knight!" to appear in the battle screen after she levels up, you're going to need a script. In that case, you should make a topic in this forum.

If you don't mind the message appearing on the map, after a battle is completed, then you can event it with a little time. I did something similar with skills, where after a character used the skill enough it would "level up" so Blast I became Blast II...I'm getting off track. Instructions:

Make a Comment Event
Set the Trigger to "Parallel" and use a switch that you turn on in the beginning of the game (this doesn't cause any problems, from my experiences)

Event Code:
 
@> Control Variables: [0001: Celestia's Level] = [Celestia]'s Level  #Records Celestia's level
@> Conditional Branch: Switch [0001: Celestia Knight?] == OFF  #This stops it from repeating constantly
   @> Conditional Branch: Variable [0001: Celestia's Level] >= 30  #Checks if Celestia is the right level
      @> Change Actor Class: [Celestia], [Knight]  #Change Celestia's class
      @> Text: Celestia is now a Knight!  #Letting the player know ;)
      @> Control Switches: [0001: Celestia Knight?] = ON  #Turning on the switch so it doesn't repeat
   : Branch End
: Branch End

Just repeat that for each class change and character. Keep in mind, though, that weapons equipped as the first class will be removed if the second class can't wield them. I don't think it'll be a problem in this situation, but I thought I'd let you know. That's the basic eventing way.

You could also go for some combination using Wyatt (Commodore Whynot)'s suggestion. Insert that piece of script,

Commodore Whynot":28nwr2ou said:
Scene_Battle2, line 173

Add this line after 173:

$game_switches[2] = true

Where 2 is the number of a new switch.

then change the common event Trigger to "Autorun" and add this at the end of the common event code:

@> Control Switches: [0002: Check Class] = OFF

Using the combination method will probably be easier on the engine, so I'd recommend you make the quick changes. :wink:
 
Thanks, dude!

Every thought out thing you have going there. I'll definitely try it out. ^^

And no worries. I plan to make it so that all characters will be able to equip everything no matter their class. Or, rather, set them all up so that whatever they could use in one class can be used in another. Thankfully, I only have three characters to worry about in that regard! XD

Well, at least I have that coding bit in the middle so far! XD Just gotta put the rest in.

Again, thanks dude! ^__^
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top