I’ve given objects properties quite a few times by now, and I’m truly at loss as to why this one in particular isn’t doing it for me. The game translates just fine and doesn’t run into run-time errors, it’s just not changing the usual property to the less usual one when I tell it to. I must be blind to the code somehow, I can’t see any other explanation. Can you tell what I’m missing? Here goes:
A container can be tumbled or untumbled. A container is usually untumbled. (Note: Tried to change container to thing)
Instead of opening a door behind the shelf:
if white wine bottles are in wine cellar:
if the white wine shelf is untumbled:
say "The door opens towards the wine cellar, and the shelf is in the way. You can't budge it."
Shelves are in the white wine shelf. They are scenery. Understand "planks", "shelf", "wine shelf", "white wine shelf" as shelves.
Kicking is an action applying to one thing. Understand "kick [something]" as kicking. Carry out kicking:
if the noun is not a person:
stop the action;
say "You give it a good old kick. You feel much better now.";
if the noun is a person:
stop the action;
say "Best not.";
unless the noun is a monster:
stop the action;
say "You give the monster a good old kick, for all good it does you."
Understand the command "break" as something new. Understand "break [something]" as breaking. Breaking is an action applying to one thing.
Report breaking:
stop the action;
say "You could. But should you?"
Instead of breaking or kicking shelves:
if a peculiar bottle is in wine cellar:
say "With all those glass bottles on the shelves? You'd hurt yourself.";
if a peculiar bottle is not in the wine cellar:
if the white wine shelf is untumbled:
say "You drop kick the old, fragile wood a few times. It gives in, sending splinters flying in every direction.";
continue the action;
now white wine shelf is tumbled;
now white wine bottles are nowhere;
now wood splinters are in the wine cellar;
if the white wine shelf is tumbled:
say "You give it a good old kick. You feel much better now."
Carry out going west when the location is the wine cellar:
if the white wine shelf is untumbled:
say "The old wooden planks hinder you.";
stop the action;
if the white wine shelf is tumbled:
say "";
continue the action.
So everything here works fine right until the point when the damn thing’s supposed to be tumbled. As I said, I’ve done this exact same thing a few times before. I compared it to those bits of code too and I don’t see what the difference, although this one is admittedly more complex than my earlier machinations.
That “continue the action” is what’s causing the issue – that’s jumping you out of the loop, so the rest of the code below isn’t getting executed. Just remove that and you should be good (though you’ll want to change the following “if” to an “otherwise if”, so it doesn’t immediately fire now that the shelf is tumbled).
So I have a new problem. Thought I’d just necro this thread instead of starting a new one since it’s dealing with the same event chain. I’m trying to spawn a door as a result of a chain of actions. This doesn’t cause an error and works fine until it ends like this:
(first opening the door behind the shelf)
You can’t reach into Salon.
The relevant source is:
A door called the door behind the shelf is east from salon. It is scenery. Description is "bla." Through it is wine cellar.
A thing can be tumbled, halfway, screwed or untumbled. A thing is usually untumbled.
Instead of taking or pulling the peculiar bottle: say "bla";
now western shelf is halfway;
now shelves are in the western shelf;
now peculiar bottle is nowhere;
now the door behind the shelf is west from wine cellar;
now the description of the western shelf is "bla";
move glass shards to the Wine Cellar.
Instead of squeezing through western shelf:
if western shelf is halfway:
say "bla";
now the player is occupied;
now the western shelf is not fixed in place.
Instead of pushing western shelf when the player is occupied:
say "bla";
now the western shelf is screwed;
now wood splinters are in wine cellar;
now the player is unoccupied.
Instead of breaking or kicking shelves:
if a peculiar bottle is in wine cellar:
say "bla.";
if a peculiar bottle is not in the wine cellar:
if the western shelf is halfway:
say "bla";
now western shelf is tumbled;
now white wine bottles are nowhere;
now wood splinters are in the wine cellar;
now shelves are nowhere;
otherwise if the western shelf is screwed:
say "bla"
> Carry out going west when the location is the wine cellar:
> if the western shelf is untumbled:
> say "bla";
> stop the action;
> if the western shelf is halfway:
> say "bla";
> stop the action;
> if the western shelf is tumbled:
> continue the action;
> if the western shelf is screwed:
> continue the action.
Things I’ve tried: Removing those last four lines. Removing the door from the salon and having it appear west from wine cellar; east from salon. I tried making a faux proxy container that opens and closes the door in the salon when it’s opened or closed but that causes a runtime error when trying to go back to wine cellar.
The source for the fake-out is:
[Feikkiovi is a closed, openable container. It is scenery, fixed in place, nowhere. Description is "[if western shelf is halfway and the player is not occupied]That's definitely a door back there. But how to get to it?[otherwise if western shelf is halfway and the player is occupied]You're too close to properly examine it, ironically.[otherwise if western shelf is screwed]It's a wooden door. You see nothing special about it." Printed name of feikkiovi is "the door behind the shelf". Understand "door", "behind", "shelf", "door behind", "door shelf", "behind shelf" as feikkiovi.
Before opening feikkiovi:
now the door behind the shelf is open.
Before closing feikkiovi:
now the door behind the shelf is closed.
Before opening the door behind the shelf:
now feikkiovi is open.
Before closing the door behind the shelf:
now feikkiovi is closed.]
and of course the appropriate edits to the lines relevant to the shelf properties
I don’t have my laptop here to figure out everything going on here, but doors aren’t really meant to move around. You might try Easy Doors by Hanon Ondricek if you want moveable doors.
Thanks for the rec! Will check it out! (The doors not being supposed to move thing is exactly why i tried the proxy container thing.) Honestly, it’s weird to me that this sort of thing isn’t easier to do. You’d think hidden doors are pretty standard adventure stuff.
You don’t need a real door. I never use them anymore. Just create a fake door and then you can control everything about it, and move it around as you like.
I tried! It caused a runtime error as I said in my post. It’s probably because of a mistake on my part though, i don’t see any reason why it wouldn’t work, and it did! …in one direction
Edit: One thing I haven’t tried, though, is scrapping the door on the west side as well and have a fake door there as well. That might solve it.
Edit2: An irrelevant sidenote, but Jesus Christ, i’ve given this room so many variables! Typing in all the [if]s for the room description is such a chore! Everything’s almost in their right place now, but damn…
Luckily most rooms won’t be this involved.
Lab is a room. "A plain white room.[if the fakedoor is in lab] There's a fake door in the north wall.[otherwise] There's no way out!".
The button is here. The description is "A red button on the floor."
Instead of pushing the button:
say "A door shimmers into existence in the north wall.";
now the fakedoor is in the location.
There is the fakedoor. It is scenery. The description is "A fake door that acts like a real door. It's in the north wall.".
The printed name of fakedoor is "fake door".
Instead of opening the fakedoor:
say "You open the door.".
Instead of going north in lab:
if the fakedoor is in lab:
move the player to Kitchen;
otherwise:
continue the action.
Kitchen is a room.
Of course there’s a lot of other actions to control with it, but that’'s how I do it. Make all fake doors a kind and control them all with one piece of code.