Object inside an object inside an object
Xoremus
12 Apr 2013, 11:47SO I have a drawer that has an object in it that has an object in it how do I make these visible and takable to the user?
SO what I have is a bureau that has a Drawer that has a Matchbook in it that has a match ...and what I want to be able to do is have the player open the drawer see the matchbook and be able to take the matchbook and use (Light Unlight) match and use it on other objects.
Also I would like the drawer hidden until the bureau is looked at or examined.
Any help would be great as I really suck at code but I am surely eager to learn
Thanks in advance
Paul
SO what I have is a bureau that has a Drawer that has a Matchbook in it that has a match ...and what I want to be able to do is have the player open the drawer see the matchbook and be able to take the matchbook and use (Light Unlight) match and use it on other objects.
Also I would like the drawer hidden until the bureau is looked at or examined.
Any help would be great as I really suck at code but I am surely eager to learn
Thanks in advance
Paul
Xoremus
12 Apr 2013, 11:53Forgot to add my game sorry .
Sora574
12 Apr 2013, 13:34Okay, so I'm confused a bit.
Do you want the match to be taken out of the matchbox before you use it? Or do you just want to be able to use the match by using the matchbox?
The reason I ask is that if you don't need to actually take the match out, then there's no purpose to having a 'match' object, as the 'light' verb can do everything for you.
However, if you want to take the match out and use it on other objects, I'd be happy to show you how to do what you want.
Now, onto the other stuff.
[list=1][*]Go to the 'Setup' tab in the Drawer, and uncheck 'Visible'[/*:m]
[*]Go to the 'Setup' tab in the Bureau and add switch the 'Look at' description from 'Text' to 'Run script'. Add to this to the script:
[*]Go back to the Drawer and click the 'Container' tab. Switch the 'Container type' to 'Closed container' (optional: check the 'Hide children until object is looked at')[/*:m]
[*]Add this to the 'After closing the object' script:
[*]Go to the 'Setup' tab, and delete everything you have for the 'Look at' script. Replace it with this:
If you need me to explain any of that, just ask.
Hope that helped!
Do you want the match to be taken out of the matchbox before you use it? Or do you just want to be able to use the match by using the matchbox?
The reason I ask is that if you don't need to actually take the match out, then there's no purpose to having a 'match' object, as the 'light' verb can do everything for you.
However, if you want to take the match out and use it on other objects, I'd be happy to show you how to do what you want.
Now, onto the other stuff.
[list=1][*]Go to the 'Setup' tab in the Drawer, and uncheck 'Visible'[/*:m]
[*]Go to the 'Setup' tab in the Bureau and add switch the 'Look at' description from 'Text' to 'Run script'. Add to this to the script:
msg ("You see a light brown bureau, with a single drawer.")
MakeObjectVisible (Drawer)
[/*:m][*]Go back to the Drawer and click the 'Container' tab. Switch the 'Container type' to 'Closed container' (optional: check the 'Hide children until object is looked at')[/*:m]
[*]Add this to the 'After closing the object' script:
this.listchildren = false
[/*:m][*]Go to the 'Setup' tab, and delete everything you have for the 'Look at' script. Replace it with this:
OutputTextNoBr ("It's just a normal, old drawer")
if (this.isopen = true) {
OutputTextNoBr (", containing ")
this.listchildren = true
}
else {
msg (".")
}
[/*:m][/list:o]If you need me to explain any of that, just ask.
Hope that helped!
Xoremus
12 Apr 2013, 15:47Thank You Sora!...That helped immensely and made things much simpler....I will get back to you on the match thing but I do think I want to make the match an object as well and have it be able to be used on several other objects. Your help is very greatly appreciated.
Sora574
12 Apr 2013, 16:03Glad I could help. And if you do end up wanting to have a match as an object, remember that you can add a limit (or keep it unlimited) to how many times you take the same object out. In other words, don't make a million matches! 

Xoremus
12 Apr 2013, 16:43More or less that little bit of code helps me even with my match situation as well correct?
Sora574
12 Apr 2013, 16:52Xoremus wrote:More or less that little bit of code helps me even with my match situation as well correct?
Technically, the code I gave you does absolutely nothing with the matches except hiding the matchbox while the drawer is closed.
Xoremus
12 Apr 2013, 16:58Hehe yes but with a little caress I got the match to do what I wanted 
And the matchbook to at like i wanted so thank you soooo much

And the matchbook to at like i wanted so thank you soooo much

Sora574
12 Apr 2013, 17:01