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.

Increasing/Decreasing Stats By A Value, Not A Percent

I'm not sure if this should go in the scripting help, or here because I don't know if this could be done without scripting. As the title suggests, I want to increase Phys Defense, Magic Defense, Strength, etc. by a specific value as opposed to a percentage. I want to boost the actor's strength, for istance, by 5 points, instead of increasing it by 5%. How would I go about doing this, using a script or otherwise?
 

poccil

Sponsor

That can be done with the "Change Parameters" event command.  Alternatively, using a script:

Code:
   actor=$game_actors[1] # actor 1
   value=5
   # Adds 5 to all parameters
   actor.maxhp += value
        actor.maxsp += value
        actor.str += value
        actor.dex += value
        actor.agi += value
        actor.int += value

Actually, upon closer inspection, PDEF (physical defense) and MDEF (magical defense) both depend on the weapon and armor used, and states inflicted.  The same applies to ATK, HIT, and EVA.  These are not parameters, so they can't be set in the same way.  Strength (STR), however, is indeed a parameter, which can be set using the above code.
 

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