New to Ropes

Greetings!

After doing some searches here and all across Google-land, I still find myself extremely confused on the subject of ropes. I’m trying to learn, so if someone can point me in the right direction, I’d appreciate it. Naturally, I’ve selected one of the more crazy Inform concepts to begin the first room of my first game (feel free to make comments). :slight_smile: I’ve tried several things that seemed to make sense, even going to grab some code from Zork just to try to make something work–it didn’t, but by that point I didn’t expect much. According to the manual, I need to define my rope (cable in my case) as a type of thing, however, Inform doesn’t seem to care for that and provides the following warning:

“The sentence ‘A cable is a type of thing’ appears to say two things are the same - I am reading ‘cable’ and ‘type of thing’ as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that ‘Adams is Jefferson’.”

There’s a TON of info on http://inform7.com/learn/man/Rex326.html#e326 but I’m not even sure where to begin, since the examples intend to show quite a few concepts and I really only want to be able to tie a piece of cable and have the player descend. Obviously, there’s something I am not defining properly–but it’s still a bit opaque to me. Here’s the problem section…or at least what I believe to be the problem section:

[Drawbridge]
	Drawbridge is a room.  "You are standing over a dark abyss on bridge even now retracting inexorably into a featureless wall.  A pedestal stands in the middle of the bridge."  The player carries a helmet clipped to a backpack.  The player wears a space suit, a cable coiled over one shoulder.
	
	Up from the Drawbridge is nowhere.
	Down from the Drawbridge is the Monocable End.  
	
	Check going up from the Drawbridge: say "The ceiling is hundreds of meters away." instead.
	
	A cable is a type of thing.
	
	After tying the cable to the pedestal: say "You clip the cable around the base of the base of the pedestal."; move the cable to Monocable End. 
	
	The pedestal is scenery.  The description of the pedestal is "Raised to nearly chest height, the square pedestal measures about twenty centimeters on each side.  It is fashioned from the same strange material as the bridge itself.  On the topmost face of the pedestal a few controls glow."
	
	Check climbing the cable when the cable is attached to the pedestal: try going down instead. 
	Check going down from Drawbridge when the cable is not attached to the pedestal: say "You peer over the brink into the darkness but think better of it." instead.

	The description of the cable is "The monofilament cable runs about two hundred meters in length, but remains nicely compact and easy to carry.  It rates at two hundred kilograms of capacity and features a clip at both ends."

Thanks for any help you can provide.

First, it’s “kind of thing”, not “type of thing”.

…but based on the rest of the code you probably don’t want to make the cable a kind of thing, just “A cable is a thing.”

The next hurdle is likely to come from “when the cable is attached to the pedestal”. Inform doesn’t define attachment relation in the standard rules, so that line is not going to work unless you define it yourself.

Implementing ropes is the stereotypically hard task to do in IF along with fire and liquids, so don’t worry if it takes a couple of tries to get it right.

You should also keep in mind that Inform doesn’t actually understand English, just a very small subset of it. Things like “The player carries a helmet clipped to a backpack. The player wears a space suit, a cable coiled over one shoulder” don’t do what you assume they do, other than create things that are literally called “helmet clipped to a backpack” and " cable coiled over one shoulder".

Doh! Not really even sure where I got that one. Thanks!

Thanks!

Sorry, should have pointed out that I did know that there were some elements missing here…I had cut quite a bit out just trying to get back to a state that wouldn’t throw a bunch of errors. And yes, I’m a moron for trying this first…but this IF actually accompanies a novel. So, some things are predicated by external forces.

Thanks! On that score, I didn’t intend that those should work quite like it might have seemed, I wrote it more for descriptive purposes. However, now that I’m getting more in the swing of things, I believe it would be best to cut that back to just the item itself and let the descriptions tell more of the story. So, while I never thought that inform would understand the helmet could be “unclipped”, for instance, it doesn’t mean that I’m not equally wrong to put it like that, just for other reasons. :slight_smile:

I really appreciate the help.

Quick fixes:

The player carries a helmet. The player wears a space suit, a coil of cable. The coil of cable is a thing. The description of the coil of cable is "The monofilament cable runs about two hundred meters in length, but remains nicely compact and easy to carry, coiled over one shoulder. It rates at two hundred kilograms of capacity and features a clip at both ends." Understand "cable" as coil of cable. The description of the helmet is "An armored helmet only useful in hard vacuum, any other time its inconvenient bulk just gets in the way. A hardmount stores it nicely atop your backpack."
Sounds like the next step is to define attachment.

OK, think I got the bare essentials, and pretty much understand all of these declarations. It seems to work without errors. I now can “tie” the cable to things…sort of. Unfortunately, no matter what I try, I get the “You would achieve nothing by this” message. There seems to be an issue with the pedestal itself…I tried it as a “thing” and as “scenery”, but still no soap. Going through the examples, there doesn’t seem to be anything special about the objects that can be tied.

I’m missing something.

The cable is a thing. Attachment relates things to each other in groups. The verb to be stuck to implies the attachment relation. Understand "cable" as coil of cable. Definition: a thing is noncable if it is not a cable. Definition: a thing is tied if the number of things stuck to it is greater than 1. Definition: a thing is free if it is not tied. Definition: a cable is free if the number of noncable things stuck to it is less than 2. Definition: a thing is hindering if it is stuck to the noun and it is not within the location. Definition: something is anchored if it is fixed in place or it is scenery or it is part of an anchored thing.

The “tie” player command invokes the “tying it to” action. This is always blocked by the “block tying” rule in the standard library.

You’ll need to either modify that rule, or write an earlier “check tying it to” rule which handles your desired effect.

Well, that makes sense…or doesn’t, depending how one looks at it. I probably wouldn’t have found that anytime soon, there doesn’t appear to be any mention of it in documentation (if one doesn’t already know what to look for). So, thanks very much!

Alright. So, if I understand correctly:

[]Earlier rules take precedence.[/]
[]Since the standard rules extension loads first, I cannot by what I do in my source affect the action of tying.[/]
[]Therefore, I must copy the Standard Rules extension to one of my own and edit it.[/]
[]Then unload the original and load my new version.[/]

Aaagh! Ropes! Aaaghh!

You’ll get good advice, but they are the bane of many an IF author. Write around them when you can.

No. In fact - absolutely not! Don’t do this.
You can order rules using ‘first’ and ‘last’, eg, ‘first check tying something to something:’. The new rule will be placed at the beginning of the check tying rulebook. (First rules end up ordered in reverse order of declaration).
Or you can place them in a spot explicitly using a ‘The soandso rule is listed before the suchandsuch rule in the whatever rulebook’ line. You could replace the block tying rule with 'The soandso rule is listed instead of the block tying rule in the check tying to rulebook.

Though your probably just need an instead rule. Instead of tying the rope to the rock: … etc.

All the rules appear in the index. You should learn your way around it.

There’s another option to. Create an entirely new command, and then redirect the tie command to it.

Understand the command "attach" as something new.
Understand the command "fasten" as something new.
Attaching it to is an action applying to two touchable things.
Understand "attach [something] to/-- [something]" as attaching it to.
Understand the command "tie" as something new.
Understand the command "connect" or "tie" or "hook" as "attach".

Check attaching something to something:
	Say "There doesn't seem to be any way to attach [the noun] to [the second noun].";
	Rule fails.

Though it seems kind of silly in retrospect and if I was a tidy author I’d just replace every instance of the attaching to action with tying to.

Makes me feel safer…some of my development instincts come from elsewhere and firewalling, so when the fellow above said “earlier” rule, I didn’t know how else to get in front of the first “include”.

This is what I tried at first, but without success…I just wanted to make it say something else to see if I could see the rule at work.

Instead of tying the cable to the pedestal, say "You clip the cable around the base of the base of the pedestal."

I know this would not do anything if it worked, but it doesn’t seem to anyway… I also tried it as a check tying the cable rule. I still get the standard you would achieve nothing by this message.

Funny you should mention that…when I clicked the index button, all of the tabs were blank. So I saved, created a new project, and went back, now its all filled. This will certainly help.

I’ll give it a shot! This may work best since I really want to use the verb “clip” rather than tie. I have a question about the second line there, though. It doesn’t appear used in the snippet you sent…or does it tie into something else?

I’m guessing Blecki meant to include:

Understand "fasten [something] to/-- [something]" as attaching it to.

EDIT: Actually, scratch that. Just modify the appropriate line in the code to:

(Which has the same effect.)

Another useful thing is the “rules” debugging command. Start your game and type “rules” at the command prompt. Then try the action you’re looking at. This will tell you all the rules that the game is following when it processes the action, and in particular will tell you the name of whatever rule is blocking your action and printing a failure message.

Yep, that works. And after a little experimentation I see why–it had to be a separate line, since “fasten” is already in the rules, but dealing with it in the understand rule seems cleanest.

Thanks!

You can clear out a bunch of words in one line:

Understand the commands "attach", "fasten" as something new.

Thank you everyone for the help in the spoon-feeding of the noob.

Should the subparts of the “check attaching something to something” rule be wrapped in some ifs? Naturally, the point of doing this is to attach the cable to the pedestal, so the player can move downward safely. So it seems to me that it should be something like this, but Inform doesn’t like it much.

I mean, I know that the snippet below is incorrect–I wrote it this way to try to explain what I was after–but I can’t explain exactly why. In searching the documentation, I find several simple examples of using “if” but not really one that’s more complex that checks for the input and deals with things differently–but maybe I missed it.

Honestly, I’m feeling a bit foolish with all of this. Normally, I can find code for what I’m after and just go with it.

Check attaching something to something: If noun is cable and second noun is pedestal begin, attach cable to pedestal; drop cable; move cable to the Monocable End; report "You clip the cable around the base of the pedestal"; end if; Otherwise begin, say "There doesn't seem to be any way to attach [the noun] to [the second noun]."; Rule fails; end if.
So, if anyone knows of a some sample code somewhere that is a good approach to this…or am I just that far off?

Thanks! I ended up with these four lines, however, I didn’t know if there was a reason to separate out the line for “tie”. It doesn’t seem to affect running the file.

Understand the command "attach", "fasten", "tie" as something new. Attaching it to is an action applying to two touchable things. Understand "attach [something] to/-- [something]" as attaching it to. Understand the command "connect" or "tie" or "hook" or "clip" or "fasten" as "attach".