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.

[VX] Medical Centre

ikos

Member

Alright, in my game I'm not using Inns.
I'm using medical stations that charge per service.

I have every service working except HP/MP restoration.
I want it to where it charged 1lucre for every HP restored.
(So x=y, where x is missing hp, y is lucre charged)
I know it's going to need variables, I'm just not very skilled with them yet.

Any suggestions?

~Ikos out :thumb:
 
Hmm...

One possible solution would be to set up a variable that is set to the HP the actor has before they are healed. Then you could set up another variable that records the actor's Max HP. You could then subtract their Max HP from their current HP and make that variable the money charged. You'd have to do so for each party member and their MP as well. I'm testing this as we speak to see if it will work.
 

ikos

Member

Dadevster":27asqqyd said:
Hmm...

One possible solution would be to set up a variable that is set to the HP the actor has before they are healed. Then you could set up another variable that records the actor's Max HP. You could then subtract their Max HP from their current HP and make that variable the money charged. You'd have to do so for each party member and their MP as well. I'm testing this as we speak to see if it will work.

That's what I had in mind, just not idea how to do it. I'm not too adept with Variables.
I'm getting better though.
 
missy no":2loebnah said:
its "center"
It's "it's", not "its".  I never thought I'd see you correct grammar.

Anyway, this is how you would do this:
Code:
I'll be using two variables.  To make this easier, I'll just refer to them as V1 and V2.

V1 = Character's MaxHP
V2 = Character's HP
V1 - V2
Conditional Branch: If V1 = 0
   Your health is full.
Else
   It will cost you \V[1] gold to heal.

You could also change the gold amount if you don't want it to be 1 gold/HP.  Just divide or multiply V1 by a number after the subtraction.

You can just do that with HP and MP.  Let me know if you need me to explain further. :thumb:
 
Calm down, people.  U.S. spelling uses "Color" and "Center," U.K. spelling uses "Colour" and "Centre," and the two have been going their separate ways for more than two hundred years, so it's pointless to argue about it.

Edit:  And I see that the very next post features somebody who didn't read this far.  Sigh.
 
ikos, just ignore him.  He's trying to get you mad at him now.  Originally, it was about his whole "America is the only country" whatever, but now he's going to be stubborn because we took his bait.  As a general rule, if he's being spammy and pointless, he's looking for an argument.
 

ikos

Member

Guardian1239":3dbn6lvf said:
ikos, just ignore him.  He's trying to get you mad at him now.  Originally, it was about his whole "America is the only country" whatever, but now he's going to be stubborn because we took his bait.  As a general rule, if he's being spammy and pointless, he's looking for an argument.

Okay, thanks for the advice. Oh, and your method worked.
Sadly enough, I ditched the idea. I came to realize something.
When I have 7 party members, each with ~6500HP, it's going to get bloody expensive.
I might just go with the standard Sundries/Armoury/Inn system. *sigh*
 
Well, you could always divide the number by the character's level.  That way, you'll have something like this:

Actor 1 is level 1, has 500 MaxHP, and 250 HP left.  It'll cost 250 gold.

Actor 2 is level 5, has 1,000 MaxHP, and 250 HP left.  It'll be 750/5, which is 150.  Hm... that's too little.  Maybe the level/2?  So it would be 750/3, which would be 250 gold.
I used a quote because the code uses a slider bar instead of jumping to the next line. :\

Well, you can play with it if you want, or you can go with the traditional system if you like.
 

ikos

Member

Guardian1239":1v3f4ivy said:
Well, you could always divide the number by the character's level.  That way, you'll have something like this:

Actor 1 is level 1, has 500 MaxHP, and 250 HP left.  It'll cost 250 gold.

Actor 2 is level 5, has 1,000 MaxHP, and 250 HP left.  It'll be 750/5, which is 150.  Hm... that's too little.  Maybe the level/2?  So it would be 750/3, which would be 250 gold.
I used a quote because the code uses a slider bar instead of jumping to the next line. :\

Well, you can play with it if you want, or you can go with the traditional system if you like.

How would I line this up? Just descending vertically?
Like:

\V1=HP
\V2=MHP
\V3=Level
\V2-\V1
\V2/\V3
It'll cost \V1 gold?
 
Well, in that case, it'd be \V2 gold, but that's the idea.  You could also insert something like this:

ikos":efr63fse said:
\V1=HP
\V2=MHP
\V3=Level
\V2-\V1
\V3/number
\V2/\V3

That would divide the level by a number, which I'd recommend because the cost would greatly decrease with each level otherwise.
 

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