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 variables as actors take damage.

Hello. Here's yet another script requests from me. lol

Okay, what I'm wanting exactly is to be able to assign different variables to each actor, and for that variable to increase by by a small percentage of the damage each time that actor is attacked and a specified switch is on. Right now I'm thinking I want it to increase by 1% of the damage taken rounded up to the nearest whole number so that the variable is guaranteed to increase by at least 1, though I'd appreciate it if you set it up and commented on it so that I could change it later if I wanted to.

Rewording it to make sure you understand.
When a specified switch is turned on, each time an actor takes damage, 1 percent of the damage rounded up should be added to a specific variable assigned to that actor.
So. Any amount of damage below 100, even if it's just 1 will increase the variable by 1. 101 up to 200 will increase the variable by 2 and so on.

Thanks a lot.
 

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