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.

Quick Question about changing something in the game script

Okay, so I just got a quick question that I think probably has an easy solution, but I'm not very good at scripting.
After looking at this image,
http://i110.photobucket.com/albums/n117/gebbethlord/variables.jpg?t=1207702012[/img]
look at lines 47 and 48.
What would I need to do to change the hp from a constant to a percent?
Because what I need to do is change the script so that when I make variables I can choose an actors hp percent, not a constant.
What I'm asking for probably sounds kinda weird, please ask questions if you have any confusions about it.
Thanks.
 
Look down a couple lines for a hint...

        when 2  # HP
          value = actor.hp * 100 / actor.maxhp

although this will permanently change the output of that function.

You could just as easily do the same expression with event commands.

Your call
 
Set a variable to the actor's current hp.
Multiply the variable by 100.
Divide the variable by the actor's maximum hp.

It's a little more work, but it will do what you want.  :smile:
 

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