ID:273926
 
I want to add the skin bars from interface (.dmf) onto my game for health and stuff. I'm having a problem with the command your supposed to type in the command bar in the bar properties in the dmf file. Probably just missing something obvious but can't seem to grasp what it is. Can anyone help?
http://www.byond.com/ members/?command=reference&path=proc%2Fwinset

http://www.byond.com/docs/ref/skinparams.html
(Far right, the intersection between "Bar" and "User Interaction", there is a parameter called "value")


If you read the links this will make perfect sense.
player would be your player.
control_id would be your bar.
value would be your parameter.
In response to Gooseheaded
I knew how to do the winset() code. But when I compile and run the game, in the output it says "unrecognised or innaccessible verb: command".

The command its refferring to is located in the dmf file when you right click on the skin bar. Under the options tab there is something that says "command to run when value is changed." Am I supposed to type something specific there?

Also is there anywhere specific the winset() code has to be? Like on a specific line under a specific parent?
In response to Zerok Kaiba
Zerok Kaiba wrote:
I knew how to do the winset() code. But when I compile and run the game, in the output it says "unrecognised or innaccessible verb: command".

The command its refferring to is located in the dmf file when you right click on the skin bar. Under the options tab there is something that says "command to run when value is changed." Am I supposed to type something specific there?

Also is there anywhere specific the winset() code has to be? Like on a specific line under a specific parent?

You need to define the actual verb in the programming.

mob/verb/Command_Name()


Make sure the command name on the control matches the verb name without the parenthesis.
In response to Zerok Kaiba
If all you want to do is change a bar that measures a numeric value, just make a proc to pass the value and call it whenever the value changes.
For example, let's say we have a mob who has values of health and max_health. Then, in the dmf file we design a bar and call it (ID) "hp_bar". To update it to show percentage health we would call something like
<code> mob proc/update_hp_bar() if(!client) return winset(src,"hp_bar","value=[round(health/max_health*100)]") </code>

Then whenever thhe health value changes (say in a damage call) we can call mob.update_hp_bar() to adjust the bar.
In response to Jmurph
thank you so much I feel kind of stupid for not defining the command :P