New custom action (attaching it to)

I made a new action, called “attaching it to”. It throws no errors, but when I try to attach the climbing rope to the balcony rail (which are both in the same room), I get a message.

(input:)attach climbing rope to balcony rail
(output:)You would achieve nothing by this.

A snippet of my code.

Instead of going up to the balcony:
	if climbing rope is not placed:
		change the up exit of the houses north-side to nowhere;
	else:
		change the up exit of the houses north-side to the balcony;

The houses north-side is a room.
The balcony is above the houses north-side. 
The balcony rail is in the houses north-side.

A climbing rope can be placed or not placed.

Attaching it to is an action applying to two things.
Understand "Attach [something] to [something]" as attaching it to.
	
After attaching the climbing rope to the balcony rail:
	say  "You attached the climbing rope to the balcony rail.";
	now the climbing rope is in the houses north-side;
	now the climbing rope is fixed in place;
	now the climbing rope is placed;

The verb “attach” is already defined in the Standard Rules for the “tying it to” action. (Along with “tie”, “fasten”.)

It sounds like you should just be using “tying it to” rather than defining a new action.

2 Likes

Thanks, that helped.

.
.
.
Instead of tying the climbing rope to the balcony rail:
	say  "You attached the climbing rope to the balcony rail.";
	now the climbing rope is in the houses north-side;
	now the climbing rope is fixed in place;
	now the climbing rope is placed;

Works, but…

I got a “new” problem: The "Instead of going up … " rule in my original post does not work.
(And I tried a few variations)

Inform doesn’t know where you’re going when you go a direction in a room, so that’s the issue you’re running into. So you could rewrite that as “instead of going up from the from the houses north-side” and then it will fire.

However, the rule as you’ve written it is not going to do what you want – there’s no reason to try to rewire the map connections every time the player tries to go up rather than just doing it when the rope gets attached. Plus since this is an instead rule, it’s the only one that’s going to run – so the player isn’t going to see any output or move anywhere, which I don’t think is what you want. Here’s a maybe more straightforward approach:

	The houses north-side is a room.
	The balcony is above the houses north-side. 
	The balcony rail is in the houses north-side.

	After tying the climbing rope to the balcony rail: 
		say  "You attach the climbing rope to the balcony rail.";
		now the climbing rope is part of the balcony rail. [Just incorporating the rope into the rail is an easy way of preventing the player from taking it back, marking it as part of the rail, and reducing the need for custom-made properties]

	The climbing rope is in the houses north-side. 

	Instead of going up in the houses north-side when the climbing rope is not part of the balcony rail:
		Say "What, by sprouting wings?"
		
	The block tying rule does nothing when the noun is the climbing rope. [You'd need to write some rules for what happens when the player tries to tie the rope to other stuff]
		

3 Likes

Thank you. I will try your solution later, when I have the opportunity. :slight_smile:

1 Like

Your solution worked perfectly!