Text Processor Inventory [SOLVED]

Anonynn
01 May 2016, 03:46{if backpack.worn:} and so on.
But is there a text processor command for
{if backpack.carry:} like referring to something in your inventory list?
Oh...and how to make an item visible and invisible? Would that be... backpack.visible=True --- backpack.visible=False?
Thanks!
The Pixie
01 May 2016, 07:19{if backpack.parent=player: You are carrying a backpack}
And yes to the visible thing.

Anonynn
01 May 2016, 18:18I was hoping that equipping the wearable containers like the backpack and then making them invisible in the inventory would work. But the player cannot look at them or remove them from their inventory once they become invisible. I set it up to make the backpack for example, invisible when put on and visible again when taken off so it wouldn't take up inventory space. But alas!
Any ideas?

XanMag
01 May 2016, 19:09The Pixie
01 May 2016, 20:09viewtopic.php?f=18&t=3789

Anonynn
01 May 2016, 21:19And you can send specific items to it?

Anonynn
02 May 2016, 05:24Function
Name: SetInventory2Label
Return Type: String
Parameters: Bags
Function
Name: SetInventory2
Return Type: Object List
Parameters: backpack
And then set this on my backpack object.
After wearing the object:
SetInventory2 (backpack)
But when I test it in the game, the backpack doesn't move from the initial inventory and no second pane appears. What am I doing wrong?
The Pixie
02 May 2016, 08:26http://docs.textadventures.co.uk/quest/ ... nced_.html

Anonynn
02 May 2016, 19:00 if (not this.parent = game.pov) {
this.parent = spells_known
this.inventoryverbs = Split ("Cast", " ")
msg (DynamicTemplate("SpellLearnt", this))
SetInventory2 (GetDirectChildren (spells_known))
}
else {
msg ("[SpellAlreadyKnown]")
}
]]></learn>
Here's what I think it might be...
this.parent = containers_room
this.inventoryverbs = Split ("Remove;Drop", " ")
SetInventory2 (GetDirectChildren (containers_room))
Looking okay?
The Pixie
03 May 2016, 11:25The Pixie
03 May 2016, 20:33It would be easier if you had new verbs for putting something in a rucksack, and kept that separate to PUT <this> IN <that>. You could have STOW <this>, but I cannot think of a good word for removing from the rucksack that will not be used for something else. EXTRACT maybe?

Anonynn
03 May 2016, 23:25It would be easier if you had new verbs for putting something in a rucksack, and kept that separate to PUT <this> IN <that>. You could have STOW <this>, but I cannot think of a good word for removing from the rucksack that will not be used for something else. EXTRACT maybe?
Well, luckily nothing has to go INTO the backpack at all. The only function of "Containers" in my game now, are to increase your carry limit. There are two types of Containers too: Wearable like the "Backpack", and "Carryable" like the "Large Sacks". Perhaps I could just remove the wearable containers and make them all Carryable then all the verb would have to be is "Drop" .....do you think that would work?
The Pixie
04 May 2016, 07:17This should be much easier. What you really want to do is change the value of player.maxobjects. Increase it by one when the backpack (or anything) is worn, decrease it by 1 when the backpack (or anything) is taken off, increase it by the backpack capacity when the backpack is picked up, and decrease that amount when the backpack is put down. The first two will be best done in the wearables library, in DoWear and DoRemove, I think.
Take and drop scripts for the backpack:
this.parent = player
player.maxobjects = player.maxobjects + 8
msg("You pick up the backpack; now you can carry lots more")
this.parent = player.parent
player.maxobjects = player.maxobjects - 8
msg("You drop the backpack; now you can carry much less")

Anonynn
04 May 2016, 23:54Then I misunderstood your intention altogether, and you should ignore everything I have said so far!
Haha!
The first two will be best done in the wearables library, in DoWear and DoRemove, I think.
Yup! I have already modified them. This is what I have atm.
player.object: Attributes
maxvolume: integer 3
changedmaxvolume: script
if (player.maxvolume < 1) {
player.maxvolume = 1
if (volume > player.maxvolume) {
continue = false
if (HasString(game.pov, "containerfullmessage")) {
message = prefix + game.pov.containerfullmessage
}
else {
message = prefix + DynamicTemplate("FullInventory", object)
}
}
}
backpack.object
After Wearing
player.maxvolume = player.maxvolume + 13
After Removing
player.maxvolume = player.maxvolume - 13
Although, I can remove the "wear" feature since it isn't super critical. But either way, the new inventory pane is where I was hoping to put all the player's containers so they wouldn't take up space in the main inventory.
[quote]Take and drop scripts for the backpack:
this.parent = player
player.maxobjects = player.maxobjects + 8
msg("You pick up the backpack; now you can carry lots more")
this.parent = player.parent
player.maxobjects = player.maxobjects - 8
msg("You drop the backpack; now you can carry much less")[/quote]
Do you think I should just use maxobjects instead of volume? Or does it not matter?
HegemonKhan
05 May 2016, 00:25you could just have/create a single Object in your player's inventory be your 'storage', and then from inside of it, you can organize the Objects you put into it, for example:
the 'player' Object (his/her inventory):
........................'fire magic/spells' storage Object - (all your various learned fire spell objects)
........................|
........................|...'water magic/spells' storage Object - (all your various learned water spell objects)
........................|./
........................'magic/spells' Object storage - 'air magic/spells' storage Object - (all your various learned air spell objects)
'blah' Object....../
....................../..........................................'battle item' storage Object - (all your various battle item objects)
...................../........................................../
'storage' Object --- 'items' storage Object - 'healing/curing item' storage Object - (all your various healing/curing objects)
.....................\\_
......................\..\_'transformation' storage object - (all your various transformation objects)
'blah' Object.....\
.......................'equipment' storage Object - 'weapon' storage object - (all your weapon objects)
........................................................\
.........................................................'armor' storage object (all your various armor objects)
etc etc etc sub-divisions/categorizing/organizing (such as breaking up the weapons into further sub-storage of 'swords', 'axes', 'blunts/maces, etc', and same with the 'armor' too)
and then you'd have (if/switch) scripts that will check an Object for an identifying Attribute (ie: katana_object.type_of_object_string_attribute = "weapon", catnip_object.type_of_object_string_attribute = "transformation", etc), and place that Object into the correct storage Object (ie: katana_object.parent = weapon_storage_object, catnip_object.parent = transformation_storage_object)
---------------------
technically, you could use both, 'volume/weight' and 'maxobject/quantity', as they are two different types of logical values (people can only hold two things as they only have two hands - keeping this simple - not getting into using your arms, underarms/armpits, legs, teeth, etc, lol, and also people can only hold so much weight too) - if you want a complex item/equipment/storage/etc system, or choose one or the other, for a more simple system.

Anonynn
05 May 2016, 21:44

HegemonKhan
06 May 2016, 04:56viewtopic.php?f=3&p=42654#p42653
I hope to learn to do an interface eventually at this level... sighs
The Pixie
06 May 2016, 06:37The problem is you have to be a good story teller, and a coder and now you have to be an artist as well...
Alex
06 May 2016, 09:46
Anonynn
06 May 2016, 20:02I'm still not sure why the second pane isn't appearing...and how I would get the backpack in there.
HegemonKhan
06 May 2016, 22:21I'm no artist, nor have I learned really how to do web/JS/html/xml page/interface design, so when I see really good art/UI, I'm really impressed by it.

Anonynn
09 May 2016, 00:05didn't mean to derail the thread.
It's perfectly fine! I admire what they were able to do with their UI's. I can only draw people --- not good at coloring or anything like that so...major bummer.
Anyway, so I decided to forego the Second Pane since all it was causing was errors. I went ahead and removed all of the "wearable" containers and decided to put them in one place as HK suggested. My question is is there a way to keep the "Storage" item always on top in the inventory? or the always at the very bottom of the inventory? I would prefer the bottom.
HegemonKhan
09 May 2016, 03:52-------
I think you understand my design already (a single 'storage' Object directly in the inventory), but just in case, I describe/explain it more in the 'Stackable Library' by Sora:
viewtopic.php?f=18&t=3515&hilit=stackable+library
(maybe if I have the time during summer... I may try to jump into Sora' Stackable Library, trying to understand it, and creating a new updated library for the current version of quest, we'll see if I got the time... as I got to also use summer to understand assembly language and computer archiecture better, as I had to drop out, and will take it again, hopefully getting a B or A grade the second time around, sighs, on top of trying to work on my own quest game progression that I'd ike to do too, lol. Time, despite all the science about it, is quite finite, there's nothing infinite about time, lol)
-------
as to that... I'm not sure how quest does it's sorting (or if it doesn't: if the Object is added/created at the top of the 'player' Player Object, then it is shown at the top in the pane during game play). If quest does do some sort of automatic sorting... and you can't toggle it off, then your only option would be by naming it so it's in alpha-numer-ical order (assuming this is how it would do the sorting)
The Pixie
09 May 2016, 07:40Anonynn wrote:Anyway, so I decided to forego the Second Pane since all it was causing was errors. I went ahead and removed all of the "wearable" containers and decided to put them in one place as HK suggested. My question is is there a way to keep the "Storage" item always on top in the inventory? or the always at the very bottom of the inventory? I would prefer the bottom.
As far as I can tell (and I could be wrong), Quest lists items in the order they appear in your game code. That would mean if the storage items are at the bottom of the pane on the left in the editor, they will be at the bottom of your list. I think I would set up a new room called storage items, and put them in there. Of course, you will want the pack to be in a specific place in the game, so in the game start script, set the parent attribute to where you want the item to start.

Anonynn
09 May 2016, 17:55As far as I can tell (and I could be wrong), Quest lists items in the order they appear in your game code. That would mean if the storage items are at the bottom of the pane on the left in the editor, they will be at the bottom of your list. I think I would set up a new room called storage items, and put them in there. Of course, you will want the pack to be in a specific place in the game, so in the game start script, set the parent attribute to where you want the item to start.
If I put them in a storage room though, will the player still be able to interact with them and will they still count as the player holding them?
(maybe if I have the time during summer... I may try to jump into Sora' Stackable Library, trying to understand it, and creating a new updated library for the current version of quest, we'll see if I got the time... as I got to also use summer to understand assembly language and computer archiecture better, as I had to drop out, and will take it again, hopefully getting a B or A grade the second time around, sighs, on top of trying to work on my own quest game progression that I'd ike to do too, lol. Time, despite all the science about it, is quite finite, there's nothing infinite about time, lol)
Sounds like a lot of work! You still have to work on your own game you know :p
The Pixie
09 May 2016, 18:19Anonynn wrote:If I put them in a storage room though, will the player still be able to interact with them and will they still count as the player holding them?
It only has to be there at the start of the game. In your start script move them to wherever the player will find them, and thereafter they can be handled just the same as normal.

Anonynn
09 May 2016, 19:39It only has to be there at the start of the game. In your start script move them to wherever the player will find them, and thereafter they can be handled just the same as normal.
Sorry, I think finals are frying my brain @_@ So I create the room, let's say "Storage". Then in my game-object, "Start Script" --- I do what now? The player doesn't start with any container objects and receives one of them in the first room does that matter?
The Pixie
09 May 2016, 20:18backpack.parent = firstroom
That will put the backpack in the room called firstroom at the start of the game. Then it will be just as before.

Anonynn
10 May 2016, 04:29The Pixie
10 May 2016, 06:58The way I think it works is that Quest keeps a database where each object/room is a record. The order of those records is the order they appear in your game file. When the player picks things up, that is just changing a field for that record (i.e., the "parent" attribute), it does not change where that record is stored in the database. So when Quest does the inventory it goes through each record, picking out those for which the parent attribute is player, and adding them to the list. If your backpack is the last record (whereever it is in the game world), it will get added to the inventory list last, so will appear at the bottom.
So your backpack will only be in the special storage room right at the very start to ensure it is the last record in the database, then moved into the game by the start script. After that, you just handle it as normal; if dropped it goes into the current room, because that will only change the parent attribute, not its place in the database.
As I type this, I realise there is a flaw, however. Any items created during the game, for example anything cloned, will get added to the database, so will presumably appear after the backpack. It might be better to put the storage room at the top so the backpack is always top of the list.
By the way, on the Object tab there is an option to give things a special name for something in the lists on the right, so you could flag storage items with an asterisk or something.

Anonynn
11 May 2016, 05:19Added this code to the game.object, script...
backpack.parent = Player Storage Room
belt_pouch.parent = Player Storage Room
And the backpack appeared as normal like you said it would but when the player picked it up it remained in their inventory. We might be confused though!
I'm trying to store "storage" containers somewhere that doesn't take up a ton of space in the player inventory. Like....
Inventory
Storage [open]
- backpack
- belt pouch
1. inventory items.
2. inventory items.
3. inventory items.
Storage [closed]
1. inventory items.
2. inventory items.
3. inventory items...
etc.
Does that clear up what I want to happen xD?
So would I do something like
backpack.parent = Storage
So that when the player "takes" the item it's placed in there?
UPDATE
It works
