Change Mob Color

Post Reply
Sloan
Posts: 11
Joined: Sat Apr 07, 2018 3:23 pm

Change Mob Color

Post by Sloan »

I am curious if someone can help me out. I started playing a MUD called Imperium and previously used ZMUD. I am wondering if there is a way to keep the room text the default color but to change the items and mobs in the room to be something else?


Screenshot is attached.
Capture.PNG

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Change Mob Color

Post by Vadi »

Is there a MUD setting for this? Typically there is.

Sloan
Posts: 11
Joined: Sat Apr 07, 2018 3:23 pm

Re: Change Mob Color

Post by Sloan »

No there is no setting in the MUD

YourCyborg
Posts: 1
Joined: Sun Apr 08, 2018 11:50 am

Re: Change Mob Color

Post by YourCyborg »

Probably a cleaner way to do this, but you could:

Prompt detector trigger. It looks for a line that begins with < and it has this to run if true:

killTrigger("whatever")

A trigger that detects the exits and fires for several more lines. It runs:

enableTrigger("whatever")

--This trigger has a child that highlights lines that start with 'A', i.e."whatever." There's probably a cleaner way to do it, but I think that'd work.

Edit: Two further considerations.
The highlighting trigger could enable another trigger to highlight lines that start with 'The.' It would also need to be killed/enabled along with the other one. This would be useful if you want your mobs to have different colors than your items. Alternatively, you could set the first highlighting trigger to fire for several more lines.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Change Mob Color

Post by Jor'Mox »

I would trigger off the prompt, and then look backwards through the lines and highlight after the fact. Skip over blank lines going up one line at a time, then start highlighting lines that start with "A" or "The" and end with ".", and stop at the first line that doesn't match the pattern. You would have low odds of the last line of a room looking like that, but even if you did, the line before it is almost certain not to. Doing it that way, you wouldn't have to worry about accidentally highlighting lines in the middle of the description.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Change Mob Color

Post by Nyyrazzilyss »

I had to do something similar on TorilMud getting my mapper to properly recognize rooms. Not changing mob name colours, but locating the room description / room name in a text stream with no particular markers.

Your prompt line is a unique marker. The 'Exits:' line also tends to be unique.

Jor'Mox 's description of working backwards from the prompt using lines that start with an article (A, An, The) should be reasonably successful. I wouldn't do this on every prompt though, only the first prompt to arrive after a Exits: line.

Sloan
Posts: 11
Joined: Sat Apr 07, 2018 3:23 pm

Re: Change Mob Color

Post by Sloan »

I hate to be a burden but could someone help create the necessary trigger. I am coming from an old version of zMUD so this interface is very new to me.

Post Reply