Room Description
Dmcg12
27 Nov 2012, 15:41Hi all,
Before i go into my problem, would like to say how much i've loved using the software so far, makes doing such complex things seem so easy, it's a joy to use
I wanted to ask, i've been trying to make the game only show a room description upon the players first time on entering a room, afterwards there would be no description unless i wanted it for special reasons, is there anything i can do to make this happen?
Thanks,
Dan.
Before i go into my problem, would like to say how much i've loved using the software so far, makes doing such complex things seem so easy, it's a joy to use

I wanted to ask, i've been trying to make the game only show a room description upon the players first time on entering a room, afterwards there would be no description unless i wanted it for special reasons, is there anything i can do to make this happen?
Thanks,
Dan.
sgreig
27 Nov 2012, 18:41Yep, there's two ways you could do this that I can think of.
1. You could leave the room description blank and instead write the room description as a print message command under the "When entering the room for the first time" script section.
2. You could change the room description drop down from text to script, and then write a script that only displays the description once. Something along the lines of:
I think the syntax is correct there. I've been doing a lot of online JavaScript courses so I'm hoping I haven't mixed it up, lol.
1. You could leave the room description blank and instead write the room description as a print message command under the "When entering the room for the first time" script section.
2. You could change the room description drop down from text to script, and then write a script that only displays the description once. Something along the lines of:
if (room.descriptionRead = false) {
msg("This is my room description!");
room.descriptionRead = true;
}
I think the syntax is correct there. I've been doing a lot of online JavaScript courses so I'm hoping I haven't mixed it up, lol.
The Pixie
27 Nov 2012, 21:07I was going to suggest number 1, but you really need the description to appear when the user types LOOK.
A better way might be to modify OnEnterRoom, like this:
Go into code view (click on the last but one button on the tool bar), and paste all that in to the code, just above the last line (which will be </asl>).
I think this should be added as an option to Quest; I would guess it would be quite popular.
Edit:
Here is a little library I have updated to include this feature. Add the library to your game, check that "Show room description when entering a room" is ticked on game options, and create a new attrribute on game "called showdescriptiononfirstenter", a Boolean set to true. Also allows the player to toggle this mode using TERSE and VERBOSE.
A better way might be to modify OnEnterRoom, like this:
<function name="OnEnterRoom" parameters="oldRoom"><![CDATA[
game.displayroomdescriptiononstart = false
if (IsDefined("oldRoom")) {
if (oldRoom <> null) {
if (HasScript(oldRoom, "onexit")) {
do (oldRoom, "onexit")
}
}
}
on ready {
if ((not GetBoolean(player.parent, "visited")) and HasScript(player.parent, "beforefirstenter")) {
do (player.parent, "beforefirstenter")
}
on ready {
if (HasScript(player.parent, "beforeenter")) {
do (player.parent, "beforeenter")
}
on ready {
request (UpdateLocation, CapFirst(GetDisplayName(player.parent)))
roomFrameExists = false
if (HasString(player.parent, "picture")) {
if (LengthOf(player.parent.picture) > 0) {
roomFrameExists = true
SetFramePicture (player.parent.picture)
}
}
if (game.clearframe and not roomFrameExists) {
ClearFramePicture
}
if (not GetBoolean(player.parent, "visited")) {
ShowRoomDescription
}
if ((not GetBoolean(player.parent, "visited")) and HasScript(player.parent, "firstenter")) {
do (player.parent, "firstenter")
}
on ready {
if (HasScript(player.parent, "enter")) {
do (player.parent, "enter")
}
}
set (player.parent, "visited", true)
}
}
}
]]></function>
Go into code view (click on the last but one button on the tool bar), and paste all that in to the code, just above the last line (which will be </asl>).
I think this should be added as an option to Quest; I would guess it would be quite popular.
Edit:
Here is a little library I have updated to include this feature. Add the library to your game, check that "Show room description when entering a room" is ticked on game options, and create a new attrribute on game "called showdescriptiononfirstenter", a Boolean set to true. Also allows the player to toggle this mode using TERSE and VERBOSE.

Pertex
27 Nov 2012, 21:15I wouldn't change such a core function. In q5.3 the player object will be replaced by game.pov so you will have to change your gamefile, if Q5.3 comes to public

Pertex
28 Nov 2012, 09:24The Pixie wrote:
Edit:
Here is a little library I have updated to include this feature. Add the library to your game, check that "Show room description when entering a room" is ticked on game options, and create a new attrribute on game "called showdescriptiononfirstenter", a Boolean set to true. Also allows the player to toggle this mode using TERSE and VERBOSE.
Hi The Pixie,
it would be great if you could provide a new single library for this feature (in a new forum thread). I think, this function does not belong to the MetaLib functionality and some people only want to include this function into their game. Then we could link it in the wiki
Dmcg12
10 Dec 2012, 14:13I tried your suggestions, and had great success, thanks a lot everyone 

tbritton
22 Nov 2013, 18:56Just wanted to check if there where any updates to this issue, or if I should just go with the metalib solution. My preference would be to add a library just for this functionality.
Just my opinion, but it would seem to me this should really be in core functionality. If you have a large game and things can change over time, you really can't expect the player to read every room description every time they enter a room just to catch one small, but possibly important, change.
Just my opinion, but it would seem to me this should really be in core functionality. If you have a large game and things can change over time, you really can't expect the player to read every room description every time they enter a room just to catch one small, but possibly important, change.
The Pixie
22 Nov 2013, 19:54I have created a specific library for doing this on a new thread. The player can choose how descriptions are displayed with TERSE, BRIEF and VERBOSE.
http://forum.textadventures.co.uk/viewtopic.php?f=18&t=4016
http://forum.textadventures.co.uk/viewtopic.php?f=18&t=4016
tbritton
22 Nov 2013, 23:07Thanks a lot pixie. I really did search before I posted the question.