Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - HintBook user

#1
Thanks!

It works perfectly now.
#2
What happens is that when Aaron_stamina is equal to Aaron_stamina_max, it fills the bar normally, but if Aaron_stamina is any less than Aaron_stamina_max, the rectangle shows as only one pixel wide.

All of the lines of code are part of seperate functions, which are called whenever their value is changed.

Just to check, I put in displays showing what the values changed to, and they are correct.
#3
Thanks for the welcome.

Here is the code for the other meters.

Code: ags
a_sp.DrawRectangle(0, 0, ((Aaron_stamina/Aaron_stamina_max)*80)-1, 4);

e_hp.DrawRectangle(0, 0, ((Enemy_health/Enemy_health_max)*80)-1, 4);

e_sp.DrawRectangle(0, 0, ((Enemy_stamina/Enemy_stamina_max)*80)-1, 4);


I basically copied and pasted the function for Aaron's health and changed the words around, so I'm not sure if this explains anything.
#4
I'm making an RPG with health and stamina bars (using the DrawRectangle function), similar to the ones in Quest for Glory.

The problem is that the character will level up, and their maximum amount of health and stamina will change, but I want the bars to stay the same length.

I tried writing the DrawRectangle function like this:
a_hp.DrawRectangle(0, 0, ((Aaron_health/Aaron_health_max)*80)-1, 4);

It works fine for Aaron's health, but not for the other bars.

Anybody know what I'm doing wrong?
SMF spam blocked by CleanTalk