Does anyone know how to create a health bar in cmud?
If so -- can you provide a step by step explanation for someone who is not tech savvy (that would be me)
Thanks!
Cmud Help Needed - Health Bar
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Cmud Help Needed - Health Bar
If something I wrote sounds confusing ... assume you misunderstood it.
Re: Cmud Help Needed - Health Bar
I have this in a status window. See the attached xml
Then enable status window on Window menu.
Then enable status window on Window menu.
- Attachments
-
- statuswindow.xml
- (1.3 KiB) Downloaded 373 times
Re: Cmud Help Needed - Health Bar
I'm not sure how to do it properly, but a clunky way to do it is:
Two divs; one nested in the other; exact same size; no padding or margin.
Use JS to adjust the nested div's width compared to its parent.
(It's been a while, but I'm pretty sure you just use percentages for this..)
Tie width values to specific heath points (In JS) Example:
Health at 15 out of 20; "width: 75%;" or better: "width: 15/20;" And it should do the maths itself.
Or, for a more Genesis-like system:
Health at 'Very Hurt' ; "width: 45%;" (or whatever)
This would require a lot of recursive if/else/then's, though.. (I think.) (<--Wrong.. A string list works better. Thanks for the reminder, Jooli )
With the number system, all you need are replaceable variables.
Hope this helps/gives some ideas.
EDIT: Herp, that's a much better way than mine, Jooli..
Two divs; one nested in the other; exact same size; no padding or margin.
Use JS to adjust the nested div's width compared to its parent.
(It's been a while, but I'm pretty sure you just use percentages for this..)
Tie width values to specific heath points (In JS) Example:
Health at 15 out of 20; "width: 75%;" or better: "width: 15/20;" And it should do the maths itself.
Or, for a more Genesis-like system:
Health at 'Very Hurt' ; "width: 45%;" (or whatever)
This would require a lot of recursive if/else/then's, though.. (I think.) (<--Wrong.. A string list works better. Thanks for the reminder, Jooli )
With the number system, all you need are replaceable variables.
Hope this helps/gives some ideas.
EDIT: Herp, that's a much better way than mine, Jooli..
Last edited by Melarec on 10 Feb 2017 20:44, edited 2 times in total.
Re: Cmud Help Needed - Health Bar
There is code for that here. It works like the web client.
Re: Cmud Help Needed - Health Bar
thanks guys -- i'll take a look and see if i can implement
If something I wrote sounds confusing ... assume you misunderstood it.
Re: Cmud Help Needed - Health Bar
I tried to get both to work, but neither of them want to keep my health or the enemies health updated for some reason. Just copied to notepad and saved as xml for both, but they have the same problem. Any fix for it?
Re: Cmud Help Needed - Health Bar
For my script it gets update when you do health enemy, so make a trigger to do health enemy together with your combat special
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/