by Merk » Thu Nov 24, 2005 7:49 pm
There isn't anything built in, but it wouldn't be overly difficult. In Trading Punches I have a "mode" for the wrist watch that shows available exits. Something like this could be built in pretty easily. Just make the cant_go { } text for every room call the same function. This function would check to see if location.n_to returns false, location.s_to, etc etc. Build/print a result that says "you can't go that way." You could even begin with a sentence explaining why the original direction won't work -- i.e. "A wall is in the way. "; followed up with the available directions.
To make it better, you'd want to add a set of custom properties. Basically, something like "is_north" and "is_south" which you could assign special meaning in each room. Perhaps is_north returns "to the garden" and is_south returns "around a corner to the clerk's office". The result is, this one function could then say "You can go "; n_obj.name; " "; location.is_north; and so forth.
These are the kinds of things that would be pretty cool to see as 3rd party Hugo extensions. I don't think it would be too hard to create a .H file to include, which not only defines the new properties, but also includes the custom cant_go message routine.
In fact, a custom class could even be used. It would be up to the author to simply "inherit" from this custom class, in every room. It would pretty much only need to have the cant_go routine included as a call.
There isn't anything built in, but it wouldn't be overly difficult. In [i]Trading Punches[/i] I have a "mode" for the wrist watch that shows available exits. Something like this could be built in pretty easily. Just make the cant_go { } text for every room call the same function. This function would check to see if location.n_to returns false, location.s_to, etc etc. Build/print a result that says "you can't go that way." You could even begin with a sentence explaining why the original direction won't work -- i.e. "A wall is in the way. "; followed up with the available directions.
To make it better, you'd want to add a set of custom properties. Basically, something like "is_north" and "is_south" which you could assign special meaning in each room. Perhaps is_north returns "to the garden" and is_south returns "around a corner to the clerk's office". The result is, this one function could then say "You can go "; n_obj.name; " "; location.is_north; and so forth.
These are the kinds of things that would be pretty cool to see as 3rd party Hugo extensions. I don't think it would be too hard to create a .H file to include, which not only defines the new properties, but also includes the custom cant_go message routine.
In fact, a custom class could even be used. It would be up to the author to simply "inherit" from this custom class, in every room. It would pretty much only need to have the cant_go routine included as a call.