|
hole Newbie
Joined: 31 Jan 2005 Posts: 5
|
Posted: Wed Feb 02, 2005 11:51 am
#CW : coloring a @ (variable) |
Suppose my HP-bar is
HP: 100/150
and the trigger to capture the variables is
HP: @hp/@maxhp
What i want to do is color the @hp variable a certain color (for example: red) when it's below a certain value
What i've come up with is this:
#if (@hp<50) {#cw @hp high,red}
Which works..but..it will (and i know its supposed to do that) substitute the current value of the @hp and color that..
For example.. when my hp bar looks like HP: 30/150, it wil color the value 30 in the hp bar red (= good), but it will also color every "30" in the screen red (=bad)
Is there a way to ONLY color the @hp var in the HP bar red when below a certain value? |
|
|
|
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Wed Feb 02, 2005 4:12 pm Re: #CW : coloring a @ (variable) |
hole wrote: |
Is there a way to ONLY color the @hp var in the HP bar red when below a certain value? |
Yes. Here is one way of doing it:
#TRIGGER {HP: &%n{hp}/&%d{maxhp}} {#if (%1<50) {#psub {%ansi( high, red)%1} %x1}} "" {case}
Used Pretty Print
Syntax Colourizer |
|
|
|
|
|