Duplicating a room all its current objects.

sbangs
15 Dec 2010, 16:35
Is it possible to duplicate a room with all its current objects?

I'll explain what I'm really trying to accomplish.

In my upcoming Christmas kids game, when the player wins the game, he will "go to bed" and then wake up the next morning. I want the rooms and the ojbects that were left about from the previous night to still be present, but a bit different as it will now be described the next morning.

I know I can make copy rooms during creation, but my concern is having some objects present in those copy rooms. Some of these objects were droped by the player the previous night, and want those to be in the same rooms as well, or the same copy rooms.

Wondering if there is an easy way in the tool to do this.

If not, is there a function to replace one object with another object. Example, the previous night the player was able to get the dog out of the living room, and into another room and the dog was enjoying his food. Yet in the morning, when the player goes into the same room they left the dog at, i want to describe the dog as sleeping peacefully. The challenge is the player can leave the dog in any room and I have to account for that.

Thanks again for any help or ideas on resolving this.


Alex
15 Dec 2010, 17:46
Wouldn't it be better just to update all the existing objects, rather than copy them? Or do you need to be able to go back to the "old" copies later on in the game?

sbangs
15 Dec 2010, 18:42
No they never need to go back. I see what your saying. I already have so many if statements for the look verb on key objects, and didn't want to add even more. LOL

Thanks,


Alex
15 Dec 2010, 19:14
Well the other way is to set the "look" property or action during the game. That way you won't need loads of "if"s on the objects themselves. See the tutorial section 7.3.2 for an example.

sbangs
15 Dec 2010, 21:59
Thanks Alex.

Here is my script for just one of my look verbs attached to the Chimney. Not sure how to take your advice about LOOK statement for the game.

If "fireplace" does not have the property "lit" and the flag "spider gone" is set Then Print "[SIZE 00]You look up the Chimney and its clear! You can see the stars in the night sky. Santa can now come down the Chimney![NEW LINE]"

If "fireplace" does not have the property "lit" and the flag "spider gone" is not set and the player does not have "flashlight" Then Print "You lean in the fireplace and look up the Chimney, something is blocking the Chimney, and its moving, but it’s too dark and you can’t see what is there. You need some [BOLD ON]light [BOLD OFF]here.[NEW LINE]"

If the player has "flashlight" and "fireplace" does not have the property "lit" and the flag "spider gone" is not set Then {Print "You lean in the [BOLD ON]fireplace [BOLD OFF]and use your [BOLD ON]flashlight [BOLD OFF]to look up the [BOLD ON]Chimney[BOLD OFF]. Oh no, you see a [BOLD ON]giant black spider [BOLD OFF]looking at you! He in his spider web half way up the Chimney![NEW LINE][NEW LINE]Santa will never come down this Chimney. You must get rid of the spider![NEW LINE]"

Show picture "spider.jpg" }

If "fireplace" has the property "lit" Then Print "That would be dangerous to try to look up the Chimney while the fireplace is burning with hot fire![NEW LINE]"

Alex
15 Dec 2010, 23:36
The other approach would be to always keep your "look" property for the chimney simple, but change it by directly setting the property when something happens in the game.

In your example, in the part of your game that SETS the "spider gone" flag, you could make it update the "look" property of the chimney to the new description.

sbangs
17 Dec 2010, 13:57
Ok, this is interesting how this is working. I'm starting to get it.

So now I want to experiment setting an "open" action to an object like a door and have it run a script. Would this also destroy the default VERB "open" for the game?

Scott

Alex
20 Dec 2010, 19:09
The best thing to do is for any object that is openable, make it a container - even if it's a door. You can then specify the "open" behaviour on the Container tab, and turn off things that you don't need (such as the ability to add objects to it)