oblomov:
The answer to your question depends on how you've constructed your game so far. While I assume you've used the built-in container functionality, it is not impossible (because it is neither difficult nor unwieldy to do so) that you've whipped together your own containers from scratch. In either case, it would be helpful if you could post your ASL file (in full, or, if it is large, as an attachment). As Freak has mentioned, a sample transcript would be nice, too.
IE:
> look in box
*poof*! Stuff magically appears.
insidethecircle:
The for-each loop construct can handle printing objects. This is it's basic form:
for each object in <#quest.currentroom#> {
msg <#quest.thing#>
}
But that won't give you pretty results (try it!), so here's a general purpose procedure which you can hack...
'parameter1 = any room
define procedure <ShowObjects>
set string <sRoomObjects; >
set string <sLocation; $parameter(1)$>
set numeric <i; 0>
if (#sLocation# <> inventory) then {
msg <In the room you can see |xn>
}
else {
msg <In your inventory you have |xn>
}
for each object in <#sLocation#> {
if not property <#quest.thing#; hidden> then inc <i>
}
if (%i% <> 0) then {
set numeric <n; 0>
for each object in <#sLocation#> {
if not property <#quest.thing#; hidden> then {
inc <n>
if (%n% = 1) then {
if ($lengthof(#(quest.thing):prefix#)$ > 0) then {
set <sRoomObjects; #(quest.thing):prefix# #@quest.thing#>
}
else {
set <sRoomObjects; #@quest.thing#>
}
}
else {
if (%i% = %n%) then {
if ($lengthof(#(quest.thing):prefix#)$ > 0) then {
set <sRoomObjects; #sRoomObjects# and #(quest.thing):prefix# #@quest.thing#>
}
else {
set <sRoomObjects; #sRoomObjects# and #@quest.thing#>
}
}
else {
if ($lengthof(#(quest.thing):prefix#)$ > 0) then {
set <sRoomObjects; #sRoomObjects#, #(quest.thing):prefix# #@quest.thing#>
}
else {
set <sRoomObjects; #sRoomObjects#, #@quest.thing#>
}
}
}
}
}
set <sRoomObjects; #sRoomObjects#.>
msg <#sRoomObjects#>
}
else {
msg <nothing.>
}
end define
To see the function in action, you can download the following ASL file, and try the commands 'look room' and 'i' (for inventory). Pick up some objects, then try the commands again.