Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Splitting color state across multiple lines

Splitting color state across multiple lines

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Samson   USA  (683 posts)  Bio
Date Tue 06 Feb 2007 04:41 AM (UTC)
Message
http://www.mudbytes.net/index.php?a=pastebin&s=view&pid=221

I have that function as part of AFKMud 2.0. It has a slight bug, which probably wasn't readily noticed. But when the room descriptions are split up based on how large the mini-map segment is. But when this splitting is done, the color codes don't carry over to the next line the way they should.

So I was hoping someone better with strings than I am could help with this. Valid color tags in AFKMud are &, {, and }. Ideally the last color tag change in a line should carry over as the first color tag on the next line's text.

Sample output of a room description with the mini-map:
+-----------+ A thunderous roar echoes through the sky..... and suddenly 
|           | you are transported into this tiny room! An odd blue mist 
|           | begins to slowly fill the room, clouding your vision and giving 
|           | you a very strange sensation...... After a few minutes, the 
|           | mist clears away and suddenly you notice your body has been 
|     @     | altered! You are no longer in a physical form! From somewhere 
|           | high overhead a deep booming voice shouts: "Welcome stranger! 
|           | Examine the paintings before you and choose your new race 
|           | by saying its name out loud. For example, if you wish to become 
|           | a High Elf, you would type: say high-elf to do so. Refer to 
+-----------+ the website for further information on races and classes 
located at http://www.alsherok.net&c. You may also get a brief overview of 
which classes are allowed by examining the scrolls here."


This description begins life as cyan, tag &c, but that only goes out to the end of the first line at which point everything reverts back to default.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Tue 06 Feb 2007 04:45 AM (UTC)
Message
Hmm. To be clear on what the problem is:

Is the problem that when you go to a newline and start drawing the map, when you're done drawing the map, you need to switch back to whatever color was last set in the description?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #2 on Tue 06 Feb 2007 01:08 PM (UTC)
Message
Yes. When the room description has color tags in it, they don't carry over into the next line of the description text.
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #3 on Tue 06 Feb 2007 03:26 PM (UTC)
Message
Davion found a solution and posted it on mudbytes, but I'd still be interested to see if there's another alternative.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,783 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.