Throwing something up to a ledge

I had room A and Room B (a ledge) up from A. I want the PC to be able to throw an object up onto B. Help?

How about this:

RoomA is a room. 

RoomB is a room. It is up from RoomA.

The player carries the rock.

Understand the command "throw" as something new. Understand "throw [something]" as throwing. Throwing is an action applying to one visible thing.

Instead of throwing the rock:
	say "You throw the rock up the ledge to roomB.";
	now the rock is in RoomB.

Does that work?

1 Like

By default, the command "throw [something preferably held]" works as dropping something. In case you want to keep this and also make the player specify which direction they want to throw something, you can steal from example 80 “A View of Green Hills” §6.14 of the documentation and create a new action that allows throwing towards a direction, where an adjacent room exists:

"Throwing... Er... Up" by Giannis

Throwing it ways is an action applying to one thing and one visible thing.

Understand "throw [something preferably held] [direction]" or "toss [something preferably held] [direction]" as throwing it ways.

Check throwing it ways:
	let the target be the room second noun from the location;
	if the target is not a room, say "You throw the [noun] [second noun]ward, but it doesn't go far." instead.

Carry out throwing it ways:
	let the target be the room second noun from the location;
	now the noun is in the target.

Report throwing it ways:
	let the target be the room second noun from the location;
	say "You throw [the noun] [second noun]ward. It bounces and eventually rests on the floor of [the target]."

The Ground Floor is a room. The Ledge is up from the Ground Floor.

The apple is in the Ground floor. The target is in the Ground Floor.

Also note the existing action of Throwing it at, which is different to the one we create above, since it involves two things and not a direction.

2 Likes

That can work, but it will work no matter where the player is located. Presumably you don’t want them to throw the rock if they are inside a cottage and have it land in RoomB… Also you want to give a message if some other object is thrown, or redirect it back to dropping.

(Untested, but…)

Understand the command "throw" as something new. 
Understand "throw [something]" as throwing. 
Throwing is an action applying to one visible thing.

Check throwing (this is the redirect throwing back to dropping rule):
     if the noun is not the rock:
          say "You give [the noun] a halfhearted toss.";
          try dropping the noun instead.

Check throwing the rock:
     if the location is not RoomA:
          say "You can't throw this rock very far...";
          try dropping the rock instead;

Carry out throwing the rock:
     now the rock is in RoomB.

After throwing the rock when the rock is in RoomB:
     say "You hurl the rock up onto the ledge. Good job!"

This doesn’t account for the command THROW ROCK UP or THROW ROCK AT LEDGE but works for THROW ROCK. @GiannisG explained how to add a direction.

2 Likes