I’m having a variety of problems here, and this one really has me stumped.
Here’s the deal. You’re stuck in a basement and the only way you can get out is to drag a chair under the window and then stand on it to get out the window. The window is on the east side of the room.
I’d like to respond to all the things the player might say:
Shove chair
Shove chair to window
Shove chair east
And the same with push, pull, and drag.
Here’s what I have:
[code]Shoving is an action applying to one thing.
Understand “shove [something]” as shoving.
Understand “push [something]” as shoving.
Understand “pull [something]” as shoving.
Check shoving:
If the noun is fixed in place, say “It won’t budge.” instead.
Carry out shoving:
say “You shove the [noun] around the room aimlessly.”
Shoving it to is an action applying to two things.
Understand “shove [something] to [something]” as shoving it to.
Understand “push [something] to [something]” as shoving it to.
Understand “pull [something] to [something]” as shoving it to.
Understand “shove [something] to [direction]” as shoving it to.
Understand “push [something] to [direction]” as shoving it to.
Understand “pull [something] to [direction]” as shoving it to.
Understand “shove [something] [direction]” as shoving it to.
Understand “push [something] [direction]” as shoving it to.
Understand “pull [something] [direction]” as shoving it to.
Check shoving it to:
If the noun is fixed in place, say “It won’t budge.” instead.
Check shoving:
If the noun is not the chair, say “Ok.” instead.
Carry out shoving it to:
If the second noun is the window
Begin;
say “You shove the chair under the window.”;
now the chair is climbable;
Otherwise;
say “Ok.”;
End if.
Carry out shoving it to:
If the direction is east
Begin;
say “You shove the chair under the window”;
now the chair is climbable;
Otherwise;
say “You shove the chair away from the window”;
now the chair is useless;
end if.[/code]
Shoving without a second noun or direction works, as does pulling, pushing and dragging without a second noun or direction.
Shoving with a second noun was working until it mysteriously stopped.
Shoving with a direction gives me the mysterious message “You must name something more substantial.”
I realize that even if it were working, “Shove chair east” generally means shoving it out of the window and into the next room. I don’t want it to do that, but I’d like to allow that command from the user if possible. Nothing in the game will be pushable between rooms so I don’t care if I preserve the built-in functionality.
I don’t believe I need a mini-map inside of the room, as it seems like I can just assume that pushing the chair east will always position it under the window and pushing it anywhere else will move it away.
Additionally, I got these weird results that give two lines each:
[code]>shove chair to window
You shove the chair under the window.
You shove the chair under the window
shove chair to table
Ok.
You shove the chair under the window[/code]
Looks like the two “carry out shoving” blocks are both firing, which makes sense I guess, but I’m not sure how to code this otherwise. Also, why is it assuming that the direction is east in the second block?
Since I’m having a variety of problems, I’m not sure where to start:
Can I make “shove chair east” do something special rather than try to push it into the next room?
How do I handle not having two “carry out” phrases for “shoving it to” when I have both a second-noun variety and a direction variety to implement?
How do I implement “If the direction is east”?
What’s wrong with my shoving-with-a-second-noun code, that it always thinks I’m heading to the window?
What the heck does “You must name something more substantial” mean?
Sorry this is so convoluted. Any advice is appreciated!