Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Ghazkull
Newbie


Joined: 20 Oct 2014
Posts: 3

PostPosted: Tue Oct 21, 2014 2:59 am   

Help with showing buffs in status window.
 
Hi All,

I've searched the forum for the answer to this and, while it's been mentioned a few times, the information is a bit disjointed and I struggle to understand it.

The MUD I play on has Buffs that last a set number of ticks. I don't know the exact number of ticks but you are given a message when the buff affects you and when it wears off.

for example:

c strength
You feel stronger.

<time passes>

You feel weaker.

I want my status window to already have the word "Strength" in it and coloured red to indicate it isn't cast on me or has worn off, and for it to turn blue when I cast strength on myself (or have it cast on me by someone else for that matter as the message is the same regardless).

I would like to have a stab at doing it myself if someone can point me in the right direction of a thread, or tutorial that I can look at for something similar?

There are other buffs than the strength spell but I am assuming that it would simply be a case of copying from one and changing variables and strings to match?

Thanks in advance.

Ghaz

Edit:- I have since discovered the package editor and worked out how to put stuff in the status window but i'm not sure how to tell the trigger to change the colour, or how to actually change the colour.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Thu Oct 23, 2014 3:12 am   
 
You would want to use a separate #VAR for each attribute you want to be able to change.
It doesn't like dbvars.
Then you just change the value and include your own color code.

Code:
#VAR spellStrength {<color red>Strength</color>}
_________________
Discord: Shalimarwildcat
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Oct 23, 2014 5:35 am   
 
You can alternatively just maintain variables for the colors, keeping the color tag and whatever plain text you want to see in the status window itself.

#stwin stwBuffs {<color @strength>Strength</color>...}

You would then set up triggers for your on/off messages that set the appropriate color value.

#trigger {^A mischievous immortal zips by, surrounding you with a noxious green cloud.$} {strength = "blue"}
#trigger {^With a loud and long exhale, you realize it's now safe to breathe again.$} {strength = "red"}

Note that with the color tag, you can also use RGB color values in the form of #RRGGBB, where each set of two digits is the hexadecimal equivalent of some number between 0 and 255 (red = #FF0000, blue = #0000FF, green = #00FF00). There are also color names you can use, which if I recall a complete list can be found in the #COLOR command helpfile.
_________________
EDIT: I didn't like my old signature
Reply with quote
Ghazkull
Newbie


Joined: 20 Oct 2014
Posts: 3

PostPosted: Thu Oct 23, 2014 8:24 am   
 
Thanks for the replies,

i've managed to get it working of a sort but I have an issue in that I can't work out how to clear the status window on connect, so each time I reload the client it creates a new set of status lines underneath the existing ones so I end up with something like

Code:

Strength
Armor
Bless
Strength
Armor
Bless
Strength
Armor
Bless


can someone tell me how I can clear the status window on connect? I figure i'd need to put it into an onConnect event, but how exactly do I clear the window?

Thanks,

Ghaz
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Thu Oct 23, 2014 5:58 pm   
 
Seems like you have something creating the status item for you automatically. Used a named varient so it overwrites itself

#STWIN {stuff to show} _nodef "magicStatus"
_________________
Discord: Shalimarwildcat
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Thu Oct 23, 2014 9:12 pm   
 
Or just don't create the status items by script. Much like aliases and triggers, status items are a settings object, and if you run the #stwin command from a script will create a new one every time. You only want it to run once, so running off the command line would work better, or just create them through the package editor (new -> status).
Reply with quote
Ghazkull
Newbie


Joined: 20 Oct 2014
Posts: 3

PostPosted: Fri Oct 24, 2014 3:27 pm   
 
Thankyou everyone, I finally got it working properly by removing my #stwin lines from the onconnect event and using the object editor as Daern suggested. I was halfway there at each point, just needed to use my brain for a few minutes to work it out lol Twisted Evil
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net