changing an object to scenery?

XanMag
12 Feb 2016, 19:47
Can you change an object to scenery when you add it to your inventory? Or, in some other way make an object not show up in the inventory after you pick it up?

I understand there is a 'wearables' library, but I don't want it that in depth. Just simple. Let's say, I just have a sweatshirt that I can put on or go in the default description tee-shirt...

All I want to accomplish is, when the player decides to "wear" sweatshirt, I set a flag that will change the 'x me' description indicating the player is wearing the sweatshirt, but I do not want the sweatshirt to show up in the inventory, only in the player description. Also, if possible, I would like to avoid making it 'invisible' because I would like be able to 'look at sweatshirt' and would like to also add the verb "remove" to the sweatshirt. If it is invisible, that is impossible, correct? I also know, but want to avoid, that I could add a global command like 'remove sweatshirt' and check to see if the flag indicating the sweatshirt is worn, then add it to inventory or current room.

Help is appreciated! Thanks!

Forgewright
12 Feb 2016, 23:41
Don't use the wearables.
Give the shirt a Boolean flag..Say "ison",
make a wear verb script for the shirt that just says. "You put on the shirt."
then in that same script change shirt.ison to true.

In your description of the player add a script line that will say
If shirt.ison= true then print, "You are wearing a shirt"... along with what ever else you have written in the description.
I suppose you can do the same for anything else you want to add in the same matter.

I don't seem to be able to add much in the way of useful suggestions around here but I thought I'd keep trying to help. This is just how I'd do it at my level. Edit: You may need to make "wear" a command for the shirt instead of a verb, Not sure if it would conflict in some way as a verb....Didn't test it.

XanMag
13 Feb 2016, 00:50
That's pretty much how I did mine in my tutorial. Check out the changing clothes room on my tutorial (if you don't mind). I want to wear it and make it disappear from inventory, but not make it invisible.

Forgewright
13 Feb 2016, 01:22
Oh, right, my way didn't address the inventory. Have the command look at a player.shirton attribute of a Boolean type, then respond. The wear command/verb can change the flag from false to true and a remove or take off will set it back to false. The shirt never has to exist. A "look at shirt" command will respond to cover a player wanting to look at a shirt even if it does not exist.

not in inventory, but will give a response as if you are wearing a shirt if player.shirton is checked in the player description.
msg ("Your a hunk for sure.")
if (player.shirton = true) {
msg ("You have on an awesome shirt you bought on sale at Kmart.")
}


Of course, if you want the shirt to show in the room and when taken not show in inventory: you would have to move the shirt to a hold room on the "Take" option of it's verb drop down list. and you can just say that you took it. and from then on have scripts check the player.shirton to control its Boolean flag.
A script command will also allow you to look at an objects description attribute if it is in a holding room if you want to do that.

HegemonKhan
13 Feb 2016, 05:39
'scenery' is a Boolean Attribute:

http://docs.textadventures.co.uk/quest/ ... enery.html

shirt.scenery = true
shirt.scenery = false