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 ➜ MUDs ➜ General ➜ Looking for Ideas... Show / Hide Room Description

Looking for Ideas... Show / Hide Room Description

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


Posted by Altered   USA  (7 posts)  Bio
Date Fri 20 Feb 2009 03:19 AM (UTC)

Amended on Fri 20 Feb 2009 03:21 AM (UTC) by Altered

Message
Hello all,

Earlier, I was looking through my flag_types to make sure they matched with the defines in merc.h. This is what brought me to the room flags. Messing around, I create a new ROOM_LVLONE so that I could set this on the entrance to mud school. If the player is above level one, they can no longer enter..

Ok.. All is well so far.. Now, (Stock merc area) when standing in the temple of midgaard, the UP exit isn't shown anymore.. Still ok so far.. But now, the last little paragraph in the room description still mentions going up to mud school...

---
Equally large steps lead UP through a small door into the ENTRANCE to MUD SCHOOL. (type 'up' to go to MUD SCHOOL.) A small plaque is on this wall.
---

This is what I am trying to brainstorm about and looking for ideas for.. What do you think the best way to show or hide certain sections of a room description?

This in turn would be handy for other room flags such as ROOM_HERO_ONLY.. Maybe you want mortals to see a cetain room description, but if the player is a Hero, they get a new exit showing to the east, and now there is a small paragraph at the bottom of the room description with details about the new hero entrance to the east..

I'm drawing blanks... Anyone have any ideas on how to achieve this?

Thanks for your time,
Chris
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 20 Feb 2009 04:09 AM (UTC)
Message
Isn't there an "on enter" room prog? In that you could test the player level, and if in a certain range, show a description.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Baron Sengir   USA  (29 posts)  Bio
Date Reply #2 on Fri 06 Nov 2009 05:57 AM (UTC)
Message
I realize this is an old post, but being rather new to the forums I thought I'd throw up an idea in case someone else sees it and feels it will fit for them.

On a MUD I used to play I borrowed the head coder's idea that supplanted a new description if certain flags were met. Let me break it down a little, forgive me if I get too confusing.

The coder added a new flag to players that allowed them to phase shift into another dimension, we'll call it PHASED (assume all proper flag declarations, included on tables, etc). What this did was twofold, the pertinant information is this. In each room where Phasing was useful, he had me simply add a new 'extra' description (we used OLC, it was Rom base), and we named it "room_phased_desc". Once in the editor with that extra name, I wrote a completely new room description: ex.

Room desc:
The temple of Mota has been erected near the central square of town for ease of access by the local citizens. Heavy traffic passes through the main entryway of the temple, having stood the test of time for years untold. Songs of praise drift in the from the east, while the center of town remains to the south.

room_phased_desc:
The temple of Mota lies in ruins; vines scramble up the walls as the concrete crumbles away. A somber haunting melody drifts in from the east through a narrow passageway. To the south, the center of town can be reached.

The next part was in the code that shows room to your character (I don't remember offhand, it may have been in do_look() ), an ifcheck was added so that basically the idea was this:

If (player is phased)
Then (do_look(room_phased_desc))
else
do_look [as normal]

It allowed the player to see only the new description, and not the general room description. It worked well (as long as you didn't tell the players what the special keyword was, or they can use 'look room_phased_desc' to see it).

I expanded upon that with another code that utilized "Enhanced Senses". In every room that I thought something would be hinted at with superhuman senses (water dripping in the background, a draft from behind the curtain on the far wall, the faint smell of old blood behind the chest), I created a new extra description named "enhanced_senses_room_desc" and wrote a two or three line addition. Example from above, adding:

enhanced_senses_room_desc:
The stench of urine and sweat permeates the cobblestones as the throng of humanity shuffles by daily.

After the ifcheck for Phased, it shows the normal room description; added directly after that was basically:

If (player affected by Enhanced Senses)
Then (appends 'enhanced_senses_room_desc')

Now, shouldn't you simply be able to do the same thing by combining the two with a check on each exit?

If (north->newbie_only & playerisnewbie)
Then (append 'extra_desc')

Of course, this would mean you would have to have the same 'extra_desc' keyword set up in each room that has exits leading out. Perhaps one for newbie, one for hero, etc.? Anyway, it is a lot of work, but it would work I believe for a simpler MUD that doesn't have RoomProgs (as ours didn't, and neither does the current one I am working on).

Enough rambling now... Feel free to butcher, discuss, berate...etc. I might learn something new!

Baron Sengir
aka Co-Admin/Head Coder of "Dark Ages: Legendary Secrets"
Currently in R&D Phase
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.


12,817 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.