Noob help wanted: stuffed cat under blanket?

I have made a bed that when you look at it reveals there are covers with something under them.
I want to be able to pull the covers down (pull) and/or take the covers into my innovatory.
(After pulled down I could still take them)
I want a stuffed cat to appear once the covers are taken or pulled down.
How do I do this? @[email protected];
Thanks.


have a bed object which is a container. in container attributes, just check: isopen, hide children until looked at, list children when looked at.
have a covers object which is inside the bed object. script for after taking covers: msg "you see a stuffed bear"
add a verb to covers object called pull. for this verb, run a script: msg "you see a stuffed bear"
then just add a stuffed bear object to the room. Mark it as scenery so it does not show in the room inventory. the take and pull script is the only thing that will reveal the bear's existence.

this works good, but then you have to think about afterwards. any time you drop and take the covers, it would say "you see a stuffed bear", so maybe also after taking them the first time, you'll need to change that message, or maybe only display that message if covers.parent = bed. Same for the pull script I guess. Instead of msg "you see a stuffed bear", do this:
if (covers.parent = bed) {msg("you see a stuffed bear" }


Thanks, I've gotten a bit closer with this idea.
I'm not sure how to make the bed change states - that is, when it has covers on it, to say it has covers on it, but if you pull them down to say the bed has pulled down covers... would I need a separate bed object for all of this? O_o;
--
"Bed" - object - container - is open - Contains - "Blanket"
when looked at Bed says "Its a bed, looks like there is something under the covers."

"Blanket", scenery , object, can be pulled, if pulled says message "Find stuffed bear" if taken also says find stuffed bear.
and makes the object "stuffed bear" appear.

However, "Bed" still says there are covers on it. So...I need a new bed that hides the old bed? Seems like an overly complex way to do this.. any ideas? :)


a quick/brief example of the coding concept/logic that you got to learn/understand of Attributes (VARIABLES) and the 'if' Script:

// the below is pre-setup stuff that my quick/brief scripting example would require:

create ("animal") // creates an 'animal' Object

animal.type_list = NewStringList () // creates a new (blank) 'type_list' Stringlist Attribute contained within your 'animal' Object

list add (animal.type_list, "lion") // adding the 'lion' string value item to your 'animal.type_list' Stringlist Attribute
list add (animal.type_list, "deer") // adding the 'lion' string value item to your 'animal.type_list' Stringlist Attribute

// randomly selecting one of the animal type list items and storing it into a 'type' String Attribute contained within the 'animal' Object, as a single code line (this can be broken up for easier understanding, but I'm lazy and this is just as a quick/brief example on coding concept/logic, so showing it within a single code line):

animal.type = StringListItem (animal.type_list, GetRandomInt (0, ListCount (animal.type_list) - 1))

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

// the brief/quick example of the coding concept/logic involved/needed, of the understanding of Attributes (VARIABLES) and the 'if' Script:

if (animal.type = "lion") {
  msg ("You run as fast as you can, hoping you're faster than your buddy and/or you shove/push/knock your buddy to the ground, as you run as fast as you can")
} else if (animal.type = "deer") {
  msg ("Ah, look at the cute deer, you stop to admire it, and take pictures of it, before it scampers off harmlessly")
}

here's a bunch of my links/guides on getting started with the basics of quest and its coding:

http://textadventures.co.uk/forum/general/topic/ljjm32av4e2t9ot49k478g/help#710be61e-eae1-4af1-8363-520cc718ba1c

specifically, check out this link/guide (scroll down past the top half on basic quest coding stuff, to the lower half on Attributes and the 'if' Script, the two "super scripts" of quest that let's you do 90% of everything that you want to do in your game):

http://textadventures.co.uk/forum/general/topic/ljjm32av4e2t9ot49k478g/help#710be61e-eae1-4af1-8363-520cc718ba1c


ask if you need help with anything


So you can just add attributes to the bed if you like. Add a boolean attribute called 'coverspulleddown' or whatever, and set it to false. Then you can access and set that attribute in any script. Say, in the 'pull' verb script for the covers: Bed.coverspulleddown = true
Then in your description of the bed, make it a script
if (this.coverspulleddown){
msg("bed description with covers pulled down")
} else {
msg("bed description with covers not pulled down")
}


thanks. O_o;


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

Support

Forums