Some Beta Testing Cheat Commands

Not sure if this would be useful or not for authors and/or beta testers. I have similar commands in my Tads 3 Beta.
Basically the “rooms” command lists out all the rooms in the game by number. Then you can use the “TP” (teleport) command to move yourself or other objects to different rooms. Example: “TP lantern 3” would teleport the lantern to room #3. “TP me 21” teleports the player to room #21. The advantage of rooms by number is if you have similarly named rooms (i.e. twisty little passages, all different). Of course this sort of stuff wouldn’t be released in the final game. It’s just a shortcut to get around in the game world faster, and/or move test objects about.


Understand "rooms" as rooms. Rooms is an action applying to nothing.

Carry out rooms:
	say "[rooms list]";

To say rooms list:
	let count be 1;
	repeat with item running through rooms:
		say "[count].[bold type] [item][roman type][line break]";
		increment count.
		
[TP COMMAND]

All rooms have a number called room number. 
When play begins: [setup all the room numbers in the rooms]
	let count be 0;
	repeat with item running through rooms:
		now the room number of the item is count + 1;
		[say "[line break]Room #[count + 1]. [item]";]
		increment count.

Understand "tp [thing] [number]" as teleporting. Teleporting is an action applying to one thing and one number.

Carry out teleporting:
	let count be 0;
	let N be 0;
	let N2 be 0;
	repeat with item running through rooms:
		if the room number of the item is the number understood:
			say "[line break]Found: [room number of the item]. [item][line break]";
			increment N2;
			now the noun is in the item;
			now the number understood is 0;
			if the noun is the player:
				say "You teleport to [the printed name of the item].[line break]";
			otherwise:
				say "[The printed name of the noun] teleports to [the printed name of the item].[line break]";
		increment count; 
	if N2 is 0:
		say "Invalid room number.".
		
Understand "tp [thing]" as teleporting nowhere. Teleporting nowhere is an action applying to one thing.
Carry out teleporting nowhere:
	say "You need to supply a room number at the end of the command.[line break]".

There are already similar built-in commands: GONEAR takes you to a room or to the same location as an object, ABSTRACT moves any object to another location, PURLOIN puts any object in your inventory.

Are they documented, though? I’ve heard about GONEAR, I saw PURLOIN actually used in a game by design, and it’s the first I hear about ABSTRACT.

These are documented in section 24.4 of Writing with Inform.

Nice. I must have missed it. Thanks.

EDIT:

See, this is why I like reading the manual sometimes. :slight_smile:

In I6, there was also a GOTO debug command that would take the object id of a room as an argument and teleport the player there. Pretty much the “TP me 21” command that the OP implemented. So one could TREE (a noisier equivalent to OP’s “rooms” command) followed by GOTO . This was convenient if a room had nothing to GONEAR or no name for the player to ABSTRACT themselves to.

I’m not entirely sure why it’s vanished from I7, but I’d guess that it’s because so many games these days have a conflicting GOTO command for quick travel between rooms. So, I see some value in the TP command, although maybe the old GOTO should be restored and renamed something like DGOTO.

Edit: Correction. In I6 the player can’t ABSTRACT themselves – it complains that player’s a system object. In I7 one can, but it seems to lead to a broken state with no room descriptions and travel disabled.

I’m sure that it vanished from I7 because object IDs are entirely obscure. You’d only know what they are if you trawl through the gameinfo.dbg file.