How to display a description?

sez
Hi,

What is the best way to print a description of a room and of an object?

At present I'm using this for rooms:

OutputTextNoBr ("Looking out the front window you see the small-holding outside.")
foreach (obj, ScopeVisibleNotHeldForRoom(smallholding)) {
if (HasAttribute(obj, "inroomdescription")) {
msg (obj.inroomdescription)
}
}


But its horribly over-wrought, and it doesn't expand TextProcessor entries that are in those "inroomdescription" entries.

I don't yet have a solution for objects.

I was sure there'd be some dynamic template or something I could activate?
UPDATE: This function FormatObjectList(...) looks like it should be most of a solution but I can't get it to work:

http://docs.textadventures.co.uk/quest/ ... tlist.html

When I paste in the exact sample code I get an error

> look out
Error running script: Error evaluating expression 'FormatObjectList("You can see", player.parent, "and", "in this room.", false)': Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index

Pertex
So you want to print the description of a room the player is not in?

The Pixie
I am not sure of a couple of things. Firstly, using msg as you do, the inroomdescription TextProcessor entries should get processed. Is it perhaps an error in the entry that is the issue here?

When I first read your post, I thought this was the description when you enter a room (and these things should be built-in), but I think it is actually what the player sees when looking through a window. Is that right?

I suspect this is more-or-less the best way to do it. If you have several windows to look out, you could set a general LOOK OUT command that checks and uses attributes, so you only need that code once (I can talk you through that if you want), but I cannot think of any better way besides that. Looking out of windows is a bit too specific to individual games.

sez
Hey guys - yes, its the description of a room the player is not in. Obviously things in an adjoining room can change - in my case there is a horde of pitchfork waving villagers that will show up. Also some items - the cart, the donkey - might be moved from there.

Regarding TextProcessor entries - if I go out to the garden and look, the entries embedded in the inroomdescription is displayed just right, nice hyperlinks, all good. But using the msg command as given not at all.

Pertex
Strange, I copied your code and my text processor tags within inroom descriptions are evaluated. Perhaps you could post a demo game showing your problem?

XanMag
I am fascinated by the difference between how code-experienced players and code-noobs solve problems. If this were MY game (and I am a code-NOOB...), sez, I would add an object in the current room - let's say a window - and add the command 'look through window; look in window; look at window" that ran a flagged/unflagged script that printed message for whatever you wanted the player to see when looking through the window.

Anyway, I will stop being not helpful. :lol:

Good luck!

sez
Hi All,

Thanks heaps for your comments. Its good to know there clever folks out there using Quest, coders and story tellers alike. Even when concrete solutions do not come flooding forth, venting/sharing frustrations is very helpful!

There' a demo here of the issue:

http://textadventures.co.uk/games/view/ ... ookproblem

and the code for that is here:

https://gist.github.com/sarah-j-smith/a ... 13060d3f5a

You can see that if you look from the room none of the object links work.

Here's my suspicion - something about the Scope rules is defeating the object links - they only work for objects in this room. I noticed that {command:blah} links work but anything that tries to interact with something in the next room fails.

@XanMag - your ideas are good. Nice and straightforward. The issue that concerns me is that if the garden changes the hard-coded printed messages for looking through the window would not reflect that. I need a way to print an up-to-date description of the garden while looking at it through the window.

Regarding looking out of windows being too specific. Well perhaps it is. But isn't then the whole idea of having a "look only" direction - a special modality for exits that is all about being able to look through them rather an utter waste of time?

That flag/check box should probably just be removed if the whole thing is such an perilous rabbit-hole.

Oh well!

Pertex
sez wrote:
Here's my suspicion - something about the Scope rules is defeating the object links - they only work for objects in this room. I noticed that {command:blah} links work but anything that tries to interact with something in the next room fails.


That's right, links are only shown for objects in the player room. It's not a bug, it's a feature

sez
OK, cool. I see now.

I might seem like I'm complaining. I'm actually hugely impressed by what Alex has done with Quest: its a huge project, and there's a lot of functionality here. Its just a case of running into these road blocks and eventually understanding how it works. Thanks again for the help.

By the way here is the work-in-progress on my game:

http://textadventures.co.uk/games/view/ ... s-daughter

Does't do much yet.

sez
Oh, one more thing - anyone know how to get FormatObjectList(...) to work? I haven't been able to get it to do anything.

The Pixie
I have a feeling it has changed, and the documentation has not. It now only takes four parameters, the Boolean at the end has gone.

XanMag
Sez,

Check your in box. Nice work so far on your WIP, btw. Good writing! A look forward to more.

XanMag
Meh... I tried to give you a sample of code for what I meant in my previous post but ended up with a full, fun little game.

http://textadventures.co.uk/games/view/ ... by-mcquack

Good luck!

sez
That is a very cool little game Mr Xanadu Magoo! I can see you know your way around Quest, and I like the pot-boiler style. For a while I didn't realize the world was changing - and I still don't know if it was a timer, or the passage of turns - but then I just went into a "sit back and watch the world unfold outside my windows" state.

Re the sample code - very much appreciated. I'm not sure how to check my inbox tho' ...?

EDIT: Ah, saw the PM. Thanks for the idea - will check into it this weekend.

XanMag
@ Sez... Dr. Freud would be would be disappointed in your outcome in my little game. Perhaps you should watch Inception? =)

sez
Ah - OK. I found that a certain command only starts working once its been hinted by text printed in the game, after the second phone call.

Its an interesting puzzle. Thanks for the hint.

sez
OK, I figured out how to escape the room with that hint. Nice little game!

I've added some more to "The Witches Daughter". Mostly setup stuff around the story, via conversations with our heroines mother.

http://textadventures.co.uk/games/view/ ... s-daughter

Thanks for ConvLib - nice work there. Very useful!

XanMag
Just an FYI, which you probably already know about...

When I climb the chest I get the following:

> climb chest
Using the leather straps as footholds you climb onto the top of the chest.

A chest

you climb down from theObject: chest_window

at which point I cannot do anything in the game. Like I said, I assume you know about it being the game is a WIP but thought I should inform. Everything else looks good. This seems like it will be a good finished product!

At this point if you want game testers, you should start a thread on the game announcement page. We'll be glad to test and offer feedback!

Good luck.

XanMag

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums