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.

How to Set Parameters Based on Class not Actor

I am trying to implement a class choice system in my game. While I can get the player to be able to choose a class, I want to have it so that their parameters change along with the class. Basically, if my main character is a Cleric I probably don't want them to have the health of a tanky Fighter. I can't figure out how to do this. There is a Change Parameters event command, but I can't use that as I would need to input EVERY value for EVERY level for EVERY class and have it be called whenever a character levels up or something like that (I'd like to avoid such a brute-force approach). Does anyone else have a solution of theirs they would like to share? :biggrin:

I have an idea though. I was thinking of setting up an actor that represents the class, and in the Game_Actor script I modify it so that, for instance, line 188 (to get maxHP) goes from this:
Code:
return $data_actors[@actor_id].parameters[0, @level]

to something more like this (I'm not familiar with RGSS1, so if syntax is wrong I'm not too worried):
Code:
case @class_id

   when 1 #fighter

      return $data_actors[2].parameters[0, @level]

   .

   .

   .

   when 9 #Cleric

      return $data_actors[10].parameters[0, @level]

end

I think a solution like this for each of the scaling stats (HP, SP, etc) would work. I guess my only real question about this potential solution is will this actually get the correct class number? Is this the proper syntax if I want to get the class id for the current actor?
 
Solution
This is a feature you get with VX and VXA.

The way I'd replicate it is take advantage of the Element Efficiency or State Efficiency parameters. I'd add elements such as "150% Intelligence" or "50% Defence" and stuff like that and read them off in script (You could probably come up with a naming system that could be read back in RGSS1 so you won't have to tweak the script each time you tweak a class's stat changes).

Treat them as buffs rather than changes to base stats.
This is a feature you get with VX and VXA.

The way I'd replicate it is take advantage of the Element Efficiency or State Efficiency parameters. I'd add elements such as "150% Intelligence" or "50% Defence" and stuff like that and read them off in script (You could probably come up with a naming system that could be read back in RGSS1 so you won't have to tweak the script each time you tweak a class's stat changes).

Treat them as buffs rather than changes to base stats.
 
Solution
Yes, I think that'll work. But there are other challenges you might have to address.
Current HP/MP percentages, you know when someone's at 50% health and you increase their MaxHP you'll want them to stay at 50%

Changing equipment. You'll want to use the inventory add - remove methods so you aren't duplicating or deleting items.

Skills. You can either learn - forget skills every time you change classes. Or have it so all skills "learned" but hidden depending on their level and class. Like if you have a class specific skill that's obtained with an item and not based on character level - you might lose that skill when changing classes if you're not careful. But hiding skills based on conditions can be equally messy business.

And of course there all the Menu and status windows updates. Assuming you want the player to see the stat changes.
 

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