playMaker

Author Topic: Does anyone know how to make the blood bar?  (Read 5551 times)

naktim

  • Playmaker Newbie
  • *
  • Posts: 12
Does anyone know how to make the blood bar?
« on: January 19, 2013, 04:06:41 AM »
Does anyone know how to make the blood bar?

I us Guitexture but i don't know  how to use playmaker to sub the Guitexture's Length

someone  can help me?  please

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: Does anyone know how to make the blood bar?
« Reply #1 on: January 19, 2013, 04:36:16 AM »
Hello,

There is a great tutorial that describes the idea of health bar, the problem it is in script so you can try and translate that into Playmaker. That is of course if the health bar is what you are referring to by the blood bar.

However to do the system like he did so that you can subtract the length:

First create and assign a variable, let's name it width for now and assign the width of the screen to it (use an action Get Screen Width and store it in the variable)
Now create two other variables maxHealth (which is your maximum health) and currentHealth (current health you have now)
Create another action Int Operator now divide the width by 2 and the result by the maximumHealth and divide that as well by the currentHealth (you will need three Int Operators actions to do this)
Create a GUI Box and assign the texture you want to it (in this case this will replace the GUI Texture you made) and assign the Width the width variable we created at the very start.

That should display a rectangle with the texture you want horizontally across the screen and will change according to the amount of the current health the play has when he is hit.

I hope this helped in anyway.

naktim

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Does anyone know how to make the blood bar?
« Reply #2 on: January 19, 2013, 05:17:15 AM »
thanks u!!

so I need to do another script to finish this job ~
can't use playmaker right!?

I'll try that way!

Thanks u!   I Stuck here long time! 

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: Does anyone know how to make the blood bar?
« Reply #3 on: January 19, 2013, 05:20:12 AM »
Hello Naktim,

Actually you don't need any scripts at all, I am sorry if I made you understand that. What I am saying is that you can do it entirely in Playmaker with the steps below and if you want to know how I did it you can watch the video.
I just understood the general idea from the script and translated it to Playmaker.

naktim

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Does anyone know how to make the blood bar?
« Reply #4 on: January 19, 2013, 05:25:49 AM »
ok i konw it
I misunderstood
I just need to apply that principle
to do in playmaker!

thanks u!! 

I thought that should be a long time before someone help me
 thanks u!!!

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: Does anyone know how to make the blood bar?
« Reply #5 on: January 19, 2013, 05:31:40 AM »
You are most welcome, good luck!

naktim

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Does anyone know how to make the blood bar?
« Reply #6 on: January 21, 2013, 11:30:10 AM »
excuse me
I want to ask a stupid question

when I use the gui box

I adjustment the Width  it will  scale my  whole texture  not just Width

like my pic

sorry  and thanks!

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: Does anyone know how to make the blood bar?
« Reply #7 on: January 21, 2013, 02:39:36 PM »
Yes, it should shrink the texture according to the box's length. The code you add with Playmaker does that for you, scales the box itself not changing the texture.

naktim

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Does anyone know how to make the blood bar?
« Reply #8 on: January 21, 2013, 06:14:51 PM »
so it's weird?  not normaly!?

I need to send the e-mail to ask playmaker's Customer Service?

because I reset a new project , it's got the same problem~

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: Does anyone know how to make the blood bar?
« Reply #9 on: January 22, 2013, 12:20:03 AM »
Oh, I now know what do you mean, you want to actually resize the texture only and keep the box's size.
The method I displayed will only resize the box, unfortunately I am heading to work now so I can't check to edit my logic. Once I am back however, I will check it out for you.

By the way that isn't an error, I misunderstood your last post, sorry.

I should be back in about 8-9 hours maximum

naktim

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Does anyone know how to make the blood bar?
« Reply #10 on: January 22, 2013, 01:27:02 AM »
I am sorry to trouble you have been!   thanks u to answer my question!
I want just    subtract the  healthy bar's width but it's height  no change .
like the picture
not resize whole texture. because I have another background texture need to use.

I'm sorry I have another little question.
Did it can slowy to decrease?  not  sudden to decrease the texture to the correct width.
like we drained of water. the water will  slowy to decrease?

I am very sorry to cause you trouble.
Thank you for spending the time to help me.
I am very grateful    :)





Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: Does anyone know how to make the blood bar?
« Reply #11 on: January 22, 2013, 12:19:52 PM »
That is fine, you didn't trouble me or anyone here I would say, we are all here to help each other so you are fine ask as much as you want :D

Oh, I understand what you are getting at. However to be honest that is really strange.

Since you have the height of the box as fixed number (not a variable that can be manipulated by any means) it should stay fixed and shouldn't by any means change.
That change your are showing in the picture, I am afraid I don't know why this is happening (specially if you are using the logic I have posted before).

In this case, I would say it might be something related to Playmaker but then again I am not entirely sure. Did you try to test this without a texture?
If it is doing the same then I am leaning towards this being a bug from Playmaker and at that point yes, you might want to e-mail if no one with more experience replied to this thread.