 |
SBG Novice
Joined: 05 Mar 2003 Posts: 44 Location: Australia
|
Posted: Mon Jul 28, 2003 8:55 pm
blinking hp |
this is what my mud looks like..
You are in the General Store of Templeton, whose specialties include just
about any kind of equipment or supplies a budding adventurer could need.
Shelves full of rations, rope, and other miscellaneous supplies are on and
numerous tables and counters throughout the store. The street exit is to
the west.
A grocer stands at the counter, with a slightly impatient look on his face.
[*]<570hp 396sp 547st>
ok, from the prompt I get my @hp @sp and @st
what I would like to do is have it so when any of my stats fall below say 170
that stat and only that stat blinks in red, is this possible ?
I've tried a few different thing but I'm have problems with it.
eg if the hp goes into the red the other stat disappear from the screen altogether.
thanks for any help.
Mark |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Jul 28, 2003 11:03 pm |
#trigger {~[~*~]~<(%d)hp (%d)sp (%d)st~>} {#variable hp %1;#variable sp %2;#variable st %3;#sub {%ansi(blue,bold)~[~*~]~<%if(@hp<=@hplow,%ansi(red,blink),%ansi(green,bold))@{hp}hp %if(@sp<=@splow,%ansi(red,blink),%ansi(green,bold))@{sp}sp %if(@st<=@stlow,%ansi(red,blink),%ansi(green,bold))@{st}st}}
Don't forget, it's a prompt trigger so be sure you've got all the appropriate options set correctly. |
|
|
 |
SBG Novice
Joined: 05 Mar 2003 Posts: 44 Location: Australia
|
Posted: Tue Jul 29, 2003 11:24 am |
Many thanks Mattlofton for your input, it was just what I need to get things underway,
the only problem I had with it is that is doesn't work on the present prompt,
when you hit the enter the prompt at the end of the page was as it normally is and
the prompts left up the page were the only changed so, armed with you're version and the
a half baked one of mine I started over and came up with this one.
this changes the prompt straight way and you don't needed to rebuild the whole prompt altogether,
it leaves the other stuff alone, I forgot to mention that the prompt changes colour as is, by commands
from the mud itself eg . when you are at max hp/sp/st the numbers in it are offwhite or grey
as you lose hp/sp/st the numbers go yellow and at 20% of your stat it goes red, the text itself
hp/sp/st always stays blue as do the prompt marks, the [*] at front of the prompt is not always there
either, it's to show when you are invisible. so this is what I came up with, if you or anyone can see
any problems with this please let me know, me <-- n00b at work :P
Pattern:
(%d)hp (%d)sp (%d)st
Value:
#VARIABLE hp %1
#VARIABLE sp %2
#VARIABLE st %3
#IF (@hp <= @hplow) {#PSUB %ansi( blink, high, red)@hp %x1} {}
#IF (@sp <= @splow) {#PSUB %ansi( blink, high, red)@sp %x2} {}
#IF (@st <= @stlow) {#PSUB %ansi( blink, high, red)@st %x3} {}
you just need to set your own "@xxlow"'s up and off you go
Sorry about the layout, I've not worked out how to do the one line thing you did with yours.
so now when I hit the magic number of "Flee you fool" the stat now blinks in red.
I've found out that you can also put in a sound file to play as a warning when that number
is reached too.
Value
#VARIABLE hp %1
#VARIABLE sp %2
#VARIABLE st %3
#IF (@hp <= @hplow) {
#PSUB %ansi( blink, high, red)@hp %x1
#PLAY soundfilename.mp3
} {}
#IF (@sp <= @splow) {#PSUB %ansi( blink, high, red)@sp %x2} {}
#IF (@st <= @stlow) {#PSUB %ansi( blink, high, red)@st %x3} {}
just need to workout how to have it so the soundfile only plays every 2nd or 3rd call and not
every call, as it can be a little annoying as you could imagine :p
Thanks again, Mark. |
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|