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 do I add hp for each stat?

Using VX, I've changed my agility attribute to Stamina. Now without scripting, I want it to add 10 hitpoints for each stamina point the player has. How would I go about doing this? So far, I've set the stamina to a variable. Then multiplied that variable by 10 so I have the amount of hp that needs to be added. But now, how do I add that variable in a common event without making it add that to the hp over and over again?

Thanks in advance.
 
That.... is not what I'm asking. Stamina/Agility is not going to affect a single skill. I want 10 hitpoints to be added per agility point. That's all I'm asking. How would I do that without scripts and without adding the amount over and over again?
 
Wouldn't it be tons easier just to stick a line in the base_maxhp function (or whatever VX has) that adds 10 * base_agi? o_o
It'd be like 1 line of code, and the event alternative would be... all over the place. Not even sure how you'd go about doing it with events <_<;
 
Yes. Well... I know absolutely nothing at all about scripting. And I've found that people don't answer script requests. But if you know how to do this for VX, I'd definitely be thrilled.

Aside from that. No one seems to script for VX.

Oh. Abreaction, I'd do that, but I plan to add stamina using gear and spells. Which would be pointless to add those stats if I just added hp.
 
I'll give it a shot.
How do you want it set up?

As in, should it apply to both actors and enemies, or just actors?
Should it be affected by armor/states/weapons/etc. or just by the base stat?

Edit-
Nevermind, finished.
Code:
class Game_Actor < Game_Battler

  

  def maxhp

    return [super + (10 * agi), maxhp_limit].min

  end

  

end
Just change the 10 to however much HP per stamina point you want. If you want it to ignore boosts from states, change agi to base_agi.

You can just throw it anywhere below Game_Battler.
 
Yeah. It really is "def maxhp" Sorry about that. Its not working though. I'd give you a screenshot, but i'm on the wrong computer. Its exactly how you posted it though. I copied and pasted it exactly. Did you try it in your own project before you sent it over?
 
Alright. Here we go. Screenshot time.

The error occurs as soon as I start the game.

s2.jpg


I have it set right here:

s1.jpg
 

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