ID:160007
 
I have been doing some searching on the forum and around and I have yet to see anyone ask this question but that doesn't mean it hasn't be asked. But I am going to ask anyway.

When working with the included Bar in the interface how do you code the control portion in order to get it to adjust properly. Thanks sorry if it is not more specific. But im not sure how to word it any better.
Smokymcpot wrote:
When working with the included Bar in the interface how do you code the control portion in order to get it to adjust properly. Thanks sorry if it is not more specific. But im not sure how to word it any better.

That's kind of a shame, because I have absolutely no idea what you're asking. What do you mean by "control portion" and "adjust properly"?

Lummox JR
In response to Lummox JR
Yea sorry I couldn't be more clear in my questioning allow me to reiterate.

The Interface Bars if I have a bar setup

with the name health_bar and the command set to run health_bar() after the value changes how in the code portion do i edit the value part of that bar to get it to change to represent the var health.

I sure hope that helps somewhat.

In response to Smokymcpot
Greetings Smokymcpot.

mob
var
Health = 45
MaxHealth = 100
proc
UpdateBar()
var/newWidth = (Health\MaxHealth)*100
winset(src,"default.HealthBar","value=[newWidth]")


This has not been tested, tell me how it goes.

Basicly I get the width of the health according to the bar via percentage and then I set it...

Thanks Much.
Haywire
In response to Smokymcpot
I suggest looking up winset(), together with consulting the skin reference, especially the "value" of a bar.

[Edit: *sighs* Just seconds short on Haywire!]
In response to Haywire
Sorry, for var/newWidth = (Health\MaxHealth)*100 I had done the wrong slash, Please replace it to var/newWidth = (Health/MaxHealth)*100.
In response to Haywire
Thank you anyway. I really was having issues. For some reason going from 3.5 to 4 has been a bound for me..when it comes to interface thanks guys