Making object portable containers.

UrbaN
Hi. I need a way or a tip to make an object like schoolbag, like a real schoolbag :P so you can put your items that are currently in your inventory into it. My main inventory volume is 3. Its like weight capacity. And the schoolbag object volume is 12. I made it that its container. But when I take it I cant put things into it. So how could I do it?
By the way, downloaded it about 1 hour ago so not easy for me.

UrbaN
Or can I do that the schoolbag it self isn't an object after all. Lets say I add a verb take schoolbag and when you take it, your volume increases by 9, so it is 12. I know I can do it with scripts etc, but I need a push of help :P.

The Pixie
Look at the tutorial for containers:
http://docs.textadventures.co.uk/quest/ ... iners.html

It is a little out of date, you will need to tick Container on the Features tabs to get the Container tab to appear. To make it portable, on the Inventory tab, tick the "Object can be taken" tab.

UrbaN
Well yeah. But how to add stuff IN game FRom my inventory into that container when the Container is too in my inventory, like I am wearing it, just it does not give me value(weight) but is a container with 12 slots(volumes) and you can put your stuff from your inventory(like in hand or in the pockets) into the schoolbag?

Marzipan
Have you gone through the tutorial yet? If you really just started using the program a couple of hours ago I'd suggest pausing on this for the time being and sitting down to work through it step by step. What you're trying to now isn't really that difficult in itself but you're going to one into one issue after another until you get a handle on the basics. Trust me it's worth taking the time.

Forgewright
{Amateur speaks}
make sure you select the right object or object tabs at the top. Object refer to the current subject(title in bold at top and objects refer to what the current object is carrying.

your bag should be under the player tab- objects tab- when you pick up the anything they will go to your inventory. you can then add a 'move object' line to your take script to have it move to the bag or:

When adding a script for the object verb box :put: , The expression drop down box has a choice of "move object" then select the object "bag" and what ever you take moves there. Is that the push you needed Urban?

{Amateur shuts up}

HegemonKhan
conceptual post only (we can help you with the actual implementation if you want to do this~it), see if you can at least understand what you want done, in what it entails~requires via this conceptual post of mine:

Containers:

1. the 'player' Player Object ( player.inventory ~ ScopeInventory )
2. the 'schoolbag' Object ( 'take' and 'drop' enabled, closed~open container type, and a 'put~put into' Verb~Command )

you can have specific Verbs for:
1. when the Object is *NOT* in your 'player' Player Object: 'displayverbs' built-in Stringlist Attribute
2. when your Object *IS* in your 'player' Player Object: 'inventoryverbs' built-in Stringlist Attribute
3. #1+2 ( non-specific: the Verb exists for both when in your 'player' Player Object, and when in some other Object )

for example:

'take' is only available when the Object is *NOT* in your 'player' Player Object, and likewise, 'drop' is not available when the Object is *NOT* in your 'player' Player Object. Think of the logic here: 'I can't take what I already have' and 'I can't drop what I don't have', makes sense, right? (I hope, lol).

whereas, 'use' can apply whether the Object is in the 'player' Player Object, or not (it's in some other Object), the logic should make sense (in a general case, anyways): 'I can use an Object whether I have it on me or not'.

when you 'take' Verb~Command an Object from a Room or (inside of) another Object, it puts that Object into your 'player' Player Object.

whereas, you also~then want to put the Object into your 'schoolbag' Object.

and, you also got your additional needed scripting dealing with your 'volume' checks~reqs, too.

All of this stuff is probably going to be a bit (probably too) difficult for you, if you're new to quest, and to coding in general.

what you think was a simple thing to do, is actually a bit more complex than you realized.

--------

but if you want to tackle doing this anyways, let us know and we can help you.

I would recommend leaving 'take' and 'drop' as they normally work, and simply add (or edit) a 'put' Verb for when it is in your inventory (in your 'player' Player Object):

conceptually:

'kitchen' Room Object
-> 'player' Player object
->-> 'schoolbag' Object
-> 'refrigerator' Object
->-> 'sandwich' Object

you 'open' the 'refrigerator'
you 'take' the 'sandwish'

'kitchen' Room Object
-> 'player' Player object
->-> 'sandwich' Object
->-> 'schoolbag' Object
-> 'refrigerator' Object

(now the 'sandwich' has a 'put this:sandwich into #object#:schoolbag ' Verb-Command, due to it being in your player's inventory: in your 'player' Player Object)
you ' put this:sandwich into #object#:schoolbag '
+ the additional scripting in your 'put' Verb~Command, for checking~dealing with the 'volume' req you want.

'kitchen' Room Object
-> 'player' Player object
->-> 'schoolbag' Object
->->-> 'sandwich' Object
-> 'refrigerator' Object

--------------

if this isn't against your intent:

the far easiest way, is to not deal with Objects at all, simply using the 'alteration of Attributes', instead.

though... you're going to have to learn to use Attributes... but this is (hopefully) easier than what you want done above.

for example (in pseodo-code ~ sorry, I'm lazy) ...

instead of having actual individual 'gold coins' Objects, which you move around...

simply give your 'PC~NPC' Objects and~or 'Other' Objects, an Integer Attribute:

player.cash_integer_attribute = 150
shop_keeper.cash_integer_attribute = 1000
wooden_sword.price_integer_attribute = 100

and then we can do scripting for our 'transactions' (such as 'buying' and 'selling' ):

(shortening my Attribute names, so don't have to type as much, and my longer Attribute names above are just to help explain the scenario and what+how stuff is going on~happening~doing)

Buying:

sword.parent = shop_keeper
if (player.cash >= sword.price) {
-> player.cash = player.cash - sword.price
-> shop_keeper.cash = shop_keeper.cash + sword.price
-> sword.parent = player
} else {
-> msg ("Sorry, you don't have enough cash to buy the sword.")
}

Selling:

sword.parent = player
if (shop_keeper.cash >= sword.price) {
-> player.cash = player.cash + sword.price
-> shop_keeper.cash = shop_keeper.cash - sword.price
-> sword.parent = shop_keeper
} else {
-> msg ("Sorry, but the shop keeper can't afford to buy the sword from you.")

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

Support

Forums