Inventory scenery?
playinful
07 Jun 2016, 16:21I have some items in my game that act as scenery but can be indirectly picked up (picking up the "book" also gives you "page" and "cover"), but when the objects are displayed in the inventory pane, the scenery objects are displayed along with the object itself. So what I'm asking is, where does the game decide exactly what items are put into the inventory pane, so I can add an exception to remove scenery objects from that list. Note that these objects do not appear in the "places and objects" pane, nor do they appear when the inventory command is typed. They only appear in the inventory pane itself.
The Pixie
07 Jun 2016, 17:00In the hierarchy on the left, are page and cover inside the book object? If so, moving the book will move them too. Anything in the inventory will be considered not scenery.
Would an option be to have "cover" and "page" as alternative names for the book, or do they need to be separate items?
Would an option be to have "cover" and "page" as alternative names for the book, or do they need to be separate items?
playinful
07 Jun 2016, 17:06I've already made it so that the "cover" and "page" move with the book, and all three items behave a bit differently. I'm really just asking how I would go about removing objects labelled as "scenery" from the inventory.
Worse comes to worst, I could always just add a second attribute, I just need to know how these things are handled.
Worse comes to worst, I could always just add a second attribute, I just need to know how these things are handled.

XanMag
07 Jun 2016, 20:28I think Pixie answered how they are handled, right? But, you could, when the book is picked up, use the 'remove object' script to remove those scenery objects entirely, but are the children scenery objects necessary for the game?
playinful
07 Jun 2016, 22:49They are not technically necessary, but it would feel strange to be able to interact with an object while you are not carrying it and not while you are carrying it. Additionally, if I were to remove the object from the game entirely, I would be left with something like this:
>open book
You open the book to a random page.
>read page
I don't see that. (page)
Now, that just doesn't make sense to me, and probably wouldn't for the player either. I need a way to have objects that are not displayed in the inventory pane, yet are still interactable. It can be done in the Places and Objects pane, so I know it's possible, I just need to know how.
>open book
You open the book to a random page.
>read page
I don't see that. (page)
Now, that just doesn't make sense to me, and probably wouldn't for the player either. I need a way to have objects that are not displayed in the inventory pane, yet are still interactable. It can be done in the Places and Objects pane, so I know it's possible, I just need to know how.

XanMag
08 Jun 2016, 03:22You can always make it a command and check if the player is carrying the book. If player types read page; X page; etc then just check if the player is carrying the object book, then the player will be able to read the page? That's how I would do it. That way, you don't have to worry about the objects at all. Just my thoughts.

Pertex
08 Jun 2016, 07:15playinful wrote:. It can be done in the Places and Objects pane, so I know it's possible, I just need to know how.
It's the system behaviour of Quest to hide scenery objects in the Places and Objects pane and show them in the Inventory pane, so I don't think you can change this.
I could think of a solution by script. Everytime the player changes a room the specific scenery objects are moved into the new room.
playinful
08 Jun 2016, 09:36I thought about moving the objects like that, too, but if there are two or more playable characters, and character 1 has the book, and character 2 enters the room, character 2 will be able to interact with "page" and "cover" but not "book" itself.
What I want to know is, from where Quest is deriving this list...

And what makes this list different?

What I want to know is, from where Quest is deriving this list...

And what makes this list different?

The Pixie
08 Jun 2016, 10:07You may be able to do this by overwriting the relevant Scope function (which you can only do with the off-line editor, by the way).
Look at ScopeInventory or ScopeReachableInventory first.
http://docs.textadventures.co.uk/quest/functions/
Look at ScopeInventory or ScopeReachableInventory first.
http://docs.textadventures.co.uk/quest/functions/
playinful
08 Jun 2016, 10:19I've already tried editing both of those. Editing ScopeReachableInventory doesn't seem to change anything within the pane, and while ScopeInventory does remove the object from the pane, it also makes it so that the object is non-interactable.
I've searched all of the relevant functions, but I can't find the part (or parts) of the code that deals with actually drawing the objects inside the pane.
I've searched all of the relevant functions, but I can't find the part (or parts) of the code that deals with actually drawing the objects inside the pane.
The Pixie
08 Jun 2016, 11:01Anonynn was asking about a similar kind of thing, check out her recent threads (not that it got resolved, but might give hints). I suspect the code you are looking for is built-in, and not accessible via the libraries, which is why I thought the scropes might work.
playinful
08 Jun 2016, 11:15Hm... In that case, would it be possible to use Javascript to change the pane's contents during gameplay?
The Pixie
08 Jun 2016, 12:15You could certainly hide the built-in pane and create your own with JavaScript, and then do what yu want with that. It would not be trivial...
playinful
08 Jun 2016, 12:46I suppose I shall look into that, then.
HegemonKhan
09 Jun 2016, 03:47you could just create your own 'storage' Object/Command and system (instead of using the 'inventory'), it might be easier/better than trying to mess around with the built-in inventory system and/or creating your own inventory pane and etc. As this would give you the control you seek, whereas you don't have this control by default with the built-in quest inventory's system.
you'll probably have to use List Attributes, so if you don't already know how to, you'll need to learn their usage.
you'll probably have to use List Attributes, so if you don't already know how to, you'll need to learn their usage.
playinful
09 Jun 2016, 05:27Well, if I use the Second Inventory Pane Utility, I can just remove the original pane and set the replacement to RemoveSceneryObjects(ScopeInventory()), and that way the objects don't show up in the pane but are still interactable. I was hoping for a slightly cleaner solution, but this does the job, and does it well.