Adjacent room not connected by compass directions

I am trying to create a series of rooms that aren’t connected using compass directions. For example:

Outside-Gate is next to a room called Inside-Gate. You can only get from Outside Gate to Inside-Gate by climbing the gate “climb gate”. To return to Outside-Gate you do the same “climb gate” action. I tried to make Inside-Room nowhere which worked but when I climbed the gate I moved myself off-stage and crashed. Not sure how to handle this one.

Maybe just Inside Gate is a room. and Outside Gate is a room., and use your own actions to move between them :+1:

1 Like

Yeah, that should work, with different carry out climbing rules to move between. @Ponpoko, do you want to post your code so we can see what might be going awry?

I’ve never done this but how about making the gate a backdrop in those two rooms and make “climb gate” just swap between them?

I guess the problem really was just Inside Gate is nowhere (or similar).

This could be a text adventure assault course!

Just making Inside-Gate a room worked. I made the bad assumption it had to be somehow connected to other room by one of the compass directions. Thanks!

1 Like

Well… it kinda worked. It worked one way. I can now climb into the room so that solved that problem. I can now climb the gate to Inside-Gate but when I try climb back it just stays in Inside-Gate. Here is how I am currently setting it up:

A room has some text called a gate description.
The gate is a backdrop. The description of the gate is usually "[gate description of the location]". It is in the Outside-Gate and the Inside-Gate.

Outside-Gate is a room. "You are outside a gate."
The gate description of Outside-Gate is "The outside of the gate is rusty and filthy."
Instead of climbing the gate:
	move player to Inside-Gate
	
Inside-Gate is a room. "You are inside the gate."
The gate description of Inside-Gate is "You see the inside of the old gate."
Instead of climbing the gate:
	move player to Outside-Gate

The disconnect here is that you’ve written two different rules that apply in identical circumstances (Instead of climbing the gate), so I think Inform is just executing the first one it finds in the code. It looks what you’re trying to do is to link the instead rules to the different locations by putting them in adjacent lines? But Inform doesn’t understand that – you need add an explicit condition saying “if the location is outside-gate” or whatever (“the location” is shorthand for “the location of the player”).

However, for reasons discussed in this thread, you probably don’t want to do this as a set of Instead rules – it can create challenges for you later on since your code will work in potentially inconsistent ways. It’d be better to shift it over to a Carry Out rule for climbing. The good news is that climbing is a built-in action in Inform, though it’s blocked by default – so you’ll need to say that the player is allowed the climb the gate. Here’s a cut at what that could look like:

A room has some text called a gate description.
The gate is a backdrop. The description of the gate is usually "[gate description of the location]". It is in the Outside-Gate and the Inside-Gate.

Outside-Gate is a room. "You are outside a gate."
The gate description of Outside-Gate is "The outside of the gate is rusty and filthy."
	
Inside-Gate is a room. "You are inside the gate."
The gate description of Inside-Gate is "You see the inside of the old gate."
	
The block climbing rule does nothing when the noun is the gate.

Carry out climbing the gate:
	If the player is in outside-gate:
		say "You climb inside the gate.";
		move the player  to inside-gate;
	Otherwise if the player is in inside-gate:
		say "You climb back outside of the gate.";
		move the player  to outside-gate.

Great! Thanks!

I assume that your gate will always remain locked (I visualize it as painted red with the bars layout in a herringbone design…) because you specifically point that the two rooms will remain unconnected (if is to be unlocked and opened, a directional connection IS here…)

Considering that all IF world models has locked & closed door handling, my general solution of this problem (computing sense) is simpler: design the gate as locked & closed connection door and throw away the key (either not implementing it or putting it out-of-game forever) and CLIMB GATE is basically teleporting the player between the two nominally connected locations.

Best regards from Italy,
dott. Piergiorgio.