|
Problem with item function %object%.Contents
Issue Type: |
Status: |
Priority: |
Date Submitted: |
Votes: |
Bug |
Open |
High |
Sat 19th Dec 2015 |
3 votes
|
|
Found in version: |
Last Updated: |
Completed in version: |
Date Completed: |
Track Changes: |
5.0.34.1 |
Sat 19th Dec 2015 |
|
|
Log In |
|
saabie | | Sat 19th Dec 2015 01:51 |
This function returns the keys of all of the objects and characters inside of a container object, and can be used with the .Count and .List functions to print the number of objects and what they are.
The first problem is that it includes static objects which are "part of" the objects and characters.
It is very unlikely that anyone would want to count or list a characters eyes or the cover of a book as separate objects.
The second problem is an incompatability with the .List function.
If this container contains 2 pens and a box which itself contains another 2 pens then %object%.Contents.List will print:
"Inside the bag are 7 objects: the blue pen, the red pen, the silver box. Inside the silver box are a purple pen and a green pen, the purple pen, the pentop, the green pen and the silver latch"
The list function by default prints the contents of the silver box, but because the Contents function is also listing them, they get printed twice.
The .Contents function should only return the items directly inside the object, leaving it to the List function to list the items nested inside those objects.
For those occasions when it is useful to get the keys of everything the player is carrying, an option similar to that used for ".List" can be used. eg: .Contents(True)
But the "part of" objects should still NOT be included.
|
|
ElliotM | | Sat 19th Dec 2015 03:10 |
Good testing, Saabie.
For reference, the original discussion was posted in this thread: http://forum.adrift.co/viewtopic.php?f=14&t=11346&p=100673 |
|