Secondary Inventory Pane question

Forgive some rambling, kinda trying to figure this concept out and my minds wandering, and a few inter connected questions as well

I have been trying out new things and one of the problems I've found with my game is that inventory can get cluttered up a lot, many of the items players win are more like trophies than anything else.

I'm almost sure my problem is handling scopes.

I've Got the second panel(using the tutorial here) working but handling the use of verbs for it has proven more cumbersome, I'd simply like the player to be able to look at the trophies they have collected,

I'd prefer to have the secondary inventory(Technically a room)'s contents to be looked with the look command), though i know most of my users just click the button for the verb when i provide it, but don't think i can do it using a verb since thats not global.

I could likely work it with a command, but i'd have to add the coding to every item as well..

Is there a way I can modify the commands to treat the secondary room as an inventory as well as the one based on the players direct children?

one further aside...would it be possible to add a third inventory pane as well?


( Stackable items )
I thought about using certain counters/status attributes for stacked items. I.E., potions, oran berries, etc.

I.E.
Gold
Oran Berries
Sitrus Berries

player.sitrus = 1
player.oran = 5
player.gold = 500
player.statusattributes = NewStringDictionary()
dictionary add (player.statusattributes, "hitpoints", "Hit points: !")
dictionary add (player.statusattributes, "ammo", "Spare ammo: !")
dictionary add (player.statusattributes, "equippedname", "Weapon: !")
dictionary add (player.statusattributes, "ammonote", "Ammo: !")
dictionary add (player.statusattributes, "plevel", "plevel: !")
dictionary add (player.statusattributes, "exp", "exp: !")
dictionary add (player.statusattributes, "sitrus", "Sitrus Berries: !")
dictionary add (player.statusattributes, "oran", "Oran Berries: !")
dictionary add (player.statusattributes, "gold", "Gold: !")


creating and working with a second pane is outside of my knowledge (hadn't gotten around to learning/studying Pixie's guide on it)


however, creating a storage system is within my knowledge/ability, see this link for some initial guidance on it:

http://textadventures.co.uk/forum/quest/topic/tlwqhb7i7k2xuhlt-za_fq/having-multiple-of-the-same-item-in-the-inventory
(read/scroll down the thread, see my two posts)

Sora's stackable library might be within my knowledge and ability now... but I'd have to study how he/she did it, and/or figure out my own design for doing it...


about 'inventory'....

but first about containment...

  1. "physical/actual" Containment: the Object is (contained) within another Object
// nesting (in code, but can be done through the GUI/Editor too: add Object to/within another Object):

<object name="room">
  <object name="player">
  </object>
</object>

or (the 'parent' Attribute is what actually handles containment, under the surface)

<object name="room">
</object>

<object name="player">
  <attr name="parent" type="object">room</attr>
</object>

or (scripting):

player.parent = room
or
MoveObject (player, room)
or
set (player, "parent", room)
  1. logical containment: the 'Object' Attribute and the 'Objectlist' Attribute

think of these Attributes as a school P.E. roster of student names (single student name: Object Attribute, multiple student names: Objectlist Attribute). Obviously the students are not actually on/within the paper roster, lol. However, this roster can be used to bark orders (actions) to the students. Object Attributes and Objectlist Attributes hold Object references/pointers (the Object's/s' name in this case), not the actual/physical Objects themselves.


now.... back to 'inventory'

specifically the 'inventory' is refering to the 'game.pov' Player Object (such as the default 'player' Player Object) and to the 'inventory' Objectlist Attribute in quest's underying coding (which you can access via the 'ScopeInventory()' Scope Function), which handles all of this for you.

there's a lot of code work required to have this all working nicely for you, if you want to create additional panes... quest has this already done for you for the default pane... but you got to re-create all the code for handling any additional panes... better be a good programmer...

for all of us non-good programmers, instead create your own storage system (which is more simple than the above, lol)


the 'Contains, GetObject' Functions checks the Object (and also its nested/sub/within Objects) itself for if it has the Object physically/actually inside of it.

'ListContains, DictionaryContains, AllObjects, GetDirectChildren, GetAllChildren, and all of the Scopes' all deal with an Object's (assuming it has an ObjectList Attribute: aka MAKE SURE it does, lol) 'Objectlist' Attribute.


Is this the second inventory you found?
https://github.com/ThePix/quest/wiki/Second-Inventory-Library

If objects are in a different room, you need a way to access them:
https://github.com/ThePix/quest/wiki/Commands-with-unusual-scopes

That said, if these are standard commands like LOOK AT, I am not sure that will work. You may need to override the built-in ScopeReachable command to include your room too.

A guy called Sora created a library to stack items in the inventory, and an updated version of his library (plus demo) is here:
https://github.com/ThePix/quest/blob/master/StackLibrary.aslx
https://github.com/ThePix/quest/blob/master/StackDemo.aslx

An alternative solution is to put the objects in a container; the player can open it to see the contains or close it to hide the contents (you could add show/hide verbs to the container to make it more abstract, rather than an extra container.


Very Close Pixie, was using the one put together by Jay which that link was based on.

Stacking probally isn't a concern here, thinking more of each trophy being unique(trainer badges for a easy to understand example)

hmmm going to take a look through these, not sure they'll work but its some good reading material, not sure why but never considered modifying the scope reachable function, had been playing around with modifying the command side instead

The container is oddly the idea i had first, but was unable to get the contents of the container to appear in the second inv panel rather than the default

Will see what i get up to this evening when i get back


Another alternative would be to just flag when the player has a trophy, rather than implementing each as an actual object. Your second panel is then a new status panel, the content determined by the flags.


actually, since you're not working with things/stuff that are used in-game (such as: trophies/quest-mission-event-items/rewards/achievements/perks/etc), it might be best to just have them as List/Dictionary Attributes... which you can use the list/dictionary handling for whatever you might want with them.


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

Support

Forums