Only show a child object when looking at parent...

SpaceMidget75
I have a Room with an object (Painting) in it. The painting is hanging on the wall by a Nail. I don't want the Nail to be listed as an object in the Room unless they're looking at the Painting.

I created the Painting object and the Nail object which is set as a child of the Painting object. In the "look at" text of the painting I've put the following:

"The painting it hanging on the wall by a {object:Nail}"

This seems to be parsing the attribute as text "Nail" but isn't an interactive object, it's just plain text.

What am I missing?


An end result of something like this is what I'm trying to achieve:

"You're in a room. A [painting] is hanging on the wall"

> Look at painting

"The [painting] is hanging on the wall by a [Nail]"

> Take nail


Thanks

Silver
Isn't the painting hanging ON the nail thus making the nail the parent? (like a book on a shelf)

That might further complicate it actually.

SpaceMidget75
Not for what I'm trying to achieve, I don't believe so.

When you get the room description I don't want the Nail listed as an item and the Painting not. I wan't them to inspect the painting and noticed that there's a nail holding it to the wall. It's to add a bit more game, rather than them simply seeing everything they need in the initial room description.

As I mentioned, this is what I want to see happen:

"You're in a room. A [painting] is hanging on the wall"

> Look at painting

"You notice that the [painting] is hanging on the wall by a [Nail]"

> Take nail


If I swap the parentage around would the room description show a Nail and when I look at the Nail, then see a painting?
Either way, simply adding one as a child of the other and then using {object:Name} in the description of the parent doesn't seem to work?

I suppose another way to ask this question would be "why doesn't {object:Name} parse as a link?"

Thanks

jaynabonne
Make the nail scenery. Then it will not show up in the room's object list, but you'll still be able to interact with it (including taking it - and if you drop it thereafter, it will no longer be scenery). I wouldn't bother with containment in this case.

If it still doesn't show up as a link, then posting your game here (or a corresponding example showing the problem) would help.

jaynabonne
Actually, I'll go the other way. Here is a sample that I think does what you want.

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="nailtest">
<gameid>47b9594e-356f-4232-9a97-beb4db932433</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="nail">
<inherit name="editor_object" />
<scenery />
<take />
</object>
<object name="painting">
<inherit name="editor_object" />
<look>The {object:painting} is being held by a {object:nail}.</look>
</object>
</object>
</asl>

SpaceMidget75
Yes, that's done it thanks. Annoyingly that was going to be my first tactic but then thought that nesting the object would make more sense architecturally from a navigation point of view:

You're looking at a room and see a painting -> you're looking at a painting and see a nail.

As an aside, can you tell me what would be the point of child objects?
And shouldn't the {object:Nail} still have worked as when adding the attribute Nail came up in the selectable list?

Thanks again!

Silver
Child objects can be set to only be revealed when the parent object is examined. eg:

You are in a room and there is a shelf on the wall.

>x shelf

It's old, dusty and made from solid oak.
You can see a book.

Is that what you were asking about the point of child objects?

SpaceMidget75
Silver wrote:Child objects can be set to only be revealed when the parent object is examined. eg:

You are in a room and there is a shelf on the wall.

>x shelf

It's old, dusty and made from solid oak.
You can see a book.

Is that what you were asking about the point of child objects?


That's exactly what I am/was trying to do (and assumed what child objects were for). Unfortunately I couldn't get the book to be a link where it says "You can see a book."

Silver
In the example I gave, you would have to tick the box in the features tab for the shelf (in your case the parent which is the painting) called 'container: object is a container or surface or can be opened or closed' which then creates the container tab.

In the container tab you then tick the boxes that say 'Hide children until object is looked at' and 'list children when object is looked at or opened'.

You should be able to do the same as looking at the object just reveals the child, but play around with the prefix at the bottom of the container tab - in the book on shelf example you'd write 'upon it there's' in that box. In yours you might write 'it is hanging from the wall fitted to a' (which you can get away with as there's only one child. Might prove awkward if you add something else like dust to the picture lol).

Edit: if you've got that far but it's the hyperlink not displaying that you're struggling with, unfortunately an object won't display as a hyperlink if it's scenery until it's been picked up (iirc) so you may need lessons on code from Jay.

SpaceMidget75
Thanks both of you for your help. It seems that both solutions will work with their own benefits.

Have them all at the same level (a bit more messy) and set to scenery means you can be flexible with descriptions using {object:name}

Have a nested object and use a container (tidier but more configuration) but means you're a bit more limited with text - prefix etc.

I had a look at the xml of a test project I created and given that rooms are just (sort of) parent objects I'm surprised this doesn't just work the way it is:


<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Test Methods">
<gameid>6f83f6c3-4ab7-4792-9ec0-08247102c2ac</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<description>Child of room works = {object:Shelf}</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="Shelf">
<inherit name="editor_object" />
<look>Child of Shelf doesn't work = {object:Book}</look>
<object name="Book">
<inherit name="editor_object" />
</object>
</object>
</object>
</asl>


The parent node room is happy to find a child node Shelf and parse it, but the node Shelf can't parse it's own nested node of Book.

Thanks again guys.

Silver
No worries. Be sure to stick around and give advice when others need to know things you've learned!

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

Support

Forums