Confused with Container showing objects

Grids
I am confused. I followed the instructions for a container (letterbox) but after opening the letter box the children objects (junkmail, postcard) don't display if I type look at letterbox or look. I am sure it will be something very simple but I just can't work it out.

Would anyone please shed some light on this? Thanks guys.

Here is the code:

<object name="Front Yard">
<inherit name="editor_room" />
<description>A large palm tree is swaying in the ocean breeze. Your Dad's red Lamborghini is parked in the driveway. </description>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<prefix>the</prefix>
<object name="Letterbox">
<inherit name="editor_object" />
<inherit name="container_closed" />
<look>It is a sleek, platinum letterbox.</look>
<feature_container />
<takemsg>I guess you 'could' blow up the base of the letterbox using tips from the 'Anarchist Cookbook' diskette and then take it in your backpack but that would be kinda stupid. So you leave it where it is.</takemsg>
<drop type="boolean">false</drop>
<take type="boolean">false</take>
<openscript type="script">
msg ("You open the classy letterbox and see some glossy junkmail and a postcard.")
</openscript>
<listchildren />
<hidechildren />
<listchildrenprefix>It contains</listchildrenprefix>
<object name="Postcard">
<inherit name="editor_object" />
<look>It is a postcard showing a beautiful Californian beach. The airbrushed waves look so enticing. The back of the postcard is strangely blank.</look>
<take />
</object>
<object name="Junkmail">
<inherit name="editor_object" />
<look>It is a glossy brochure for place called 'Captivate', a high class jeweller in the city.</look>
<take />
</object>
</object>

TM123
I tried your code and got the same results. I made a new container and got the same results.
If I remove the "openscript" then looking at the open letterbox works properly.
Why an "openscript" would affect looking at an already open container doesn't make sense, which seems to indicate either:

A. it is a bug
B. it is a feature that doesn't make sense.

I assumed it is "B." Features that don't make sense have solutions that don't make sense, so I tried this, which doesn't make sense:

I changed the "openscript" to:
msg ("You open the classy letterbox and see some glossy junkmail and a postcard.")
OpenObject(Letterbox)

Now looking at the open letterbox works properly!

However, the script prints a message stating the letterbox contains things. If you take the things out, close it and open it, it will still print the message stating it contains things, which isn't a very good design.
I would simply remove the "openscript." It works fine if you remove it -- it lists the contents when you open it and when you look at it.

XanMag
An unfinished sample from my tutorial game I'm slowly working on.

I think what you need to try is a limited container. I have my best luck with those.
 <object name="container room">
<inherit name="editor_room" />
<object name="letterbox">
<inherit name="editor_object" />
<inherit name="container_limited" />
<look type="script"><![CDATA[
if (not letterbox.isopen) {
msg ("It's a box that looks like it might store letters or stationary.<br/><br/>Currently, it is closed.")
}
else {
msg ("It is an opened letterbox.")
}
]]></look>
<feature_container />
<isopen type="boolean">false</isopen>
<hidechildren />
<listchildren />
<onopen type="script">
HelperOpenObject (letterbox)
</onopen>
<onclose type="script">
HelperCloseObject (letterbox)
</onclose>
<object name="junk mail">
<inherit name="editor_object" />
<look>It's some junk mail, none of which looks too exciting.</look>
<takemsg>Nah. It's junk, hence the name 'junk mail'.</takemsg>
</object>
<object name="postcard">
<inherit name="editor_object" />
<look>It's a postcard from your Aunt Kiki. It's from Hawaii. On the back, she has written, "With much love. Wish you were here! Love, Aunt Kiki"</look>
<take />
</object>
</object>
<object name="Magoo">
<inherit name="editor_object" />
<inherit name="editor_player" />
<look>You're Magoo. A simple being trapped in a test game.</look>
<attr name="pov_look">You're Magoo. A simple being trapped in a test game.</attr>
</object>
</object>


Make sure you add the open object and close object scripts under 'after opening/closing' box in GUI. Also, add an 'If' script in the description box. If object is open, print message "blah blah blah" and else, print message 'blah blah blah'.

Let me know if this helps!

XanMag

Grids
Thanks guys I will try these ideas out.

HegemonKhan
I think there's some feature toggles too in the 'game' Game Object and the individual Objects too:

~ 'display child objects' ... on opening or whatever options there are with this

that you might want to look into as well.

--------

'parent~child' basic container heirarchy:

greatest parent (outermost)
grandfather1+grandmother1 and grandfather2+grandmother2
-> father1+mother2
->-> son1+daughter2
->->-> grandchild1+grandchild2
...........................greastest child (innermost)

outermost
planets
-> earth
->-> plates
->->-> oceans
->->->-> pacific
->->-> continents
->->->-> europe
->->->->-> countries
->->->->->-> france
->->->-> asia
->->->->-> countries
->->->->->-> china
-> mars
-> venus
-> mercury
-> jupiter
-> saturn
-> uranus
-> pluto
........................innermost

outermost
treasure chest 1
-> candy
-> chocolate
-> pupui grass
treasure chest 2
-> earth coin
-> fire coin
..............innermost

outermost
HK
-> pants (with pockets for the wallet, lol)
->-> wallet
->->-> $1
->->-> $5
..............innermost

HK is the main (root) parent, the direct parent of pants, and the indirect parent of wallet+$1+$5

pants is the direct child of HK, the direct parent of wallet, and the indirect parent of $1+$5

wallet is the indirect child of HK, the direct child of pants, the direct parent of $1+$5

$1 is the direct child of wallet and indirect child of HK+pants

$5 is the direct child of wallet and indirect child of HK+pants

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

Support

Forums