FAQ Search Memberlist Usergroups
Jolt Country Forum Index
Register Profile Log in to check your private messages Log in
Log in Log in

"smart can't go" (auto displaying valid exits)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors
View previous topic :: View next topic  
Author Message
Otto
Guest





PostPosted: Thu Nov 24, 2005 4:10 pm    Post subject: "smart can't go" (auto displaying valid exits) Reply with quote

In inform there is a library for handling "can't go" events, it's called smartcantgo and can display the valid exits when the player type a wrong exit. It's also possible to display in the status bar the directions.

Is there a built in command, or similar libraries in Hugo ?
Back to top
Merk



Joined: 22 Nov 2004
Posts: 192
Location: Wichita, KS

PostPosted: Thu Nov 24, 2005 7:49 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Merk



Joined: 22 Nov 2004
Posts: 192
Location: Wichita, KS

PostPosted: Thu Nov 24, 2005 8:33 pm    Post subject: Reply with quote

I started working on CANTGO.H, then realized it becomes more complicated when room directions print messages and/or perform other verb routines. In other words, if location.n_to does more than just return 0 or another room, then you can't check locatoin.n_to without actually running that property code.

I think CANTGO.H is still do-able, but it'll be a little more complicated than I thought at first. That is, unless you always make sure n_to, s_to, e_to, and so forth are simply properties.
Back to top
View user's profile Send private message Visit poster's website
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Thu Nov 24, 2005 9:38 pm    Post subject: Reply with quote

I think there is a cantgo.h already on the Archive. One sec.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Thu Nov 24, 2005 9:41 pm    Post subject: Reply with quote

Yeah, it's called "cango.h" and it's downloadable through here:

http://ifarchive.jmac.org/indexes/if-archiveXprogrammingXhugoXlibraryXcontributions.html

Sorry I did not see this earlier. I used this file for Necrotic Drift and it worked really well. It's something I feel I would put in all future games that I made as it really raises the bar in how "professional" your game comes off.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Kent!
Guest





PostPosted: Fri Nov 25, 2005 11:51 am    Post subject: Reply with quote

The room_base class from environ.hug in the FB selected source package also provides this sort of cant_go functionality. It has the advantage that you can use it in conjunction with dir_to properties that do more (or less) than return a location. The disadvantage is that it lists only those exits it's sure are exits (with the wording "You can at least go..." if there are questionable exits).
Back to top
Otto
Guest





PostPosted: Fri Nov 25, 2005 12:43 pm    Post subject: Reply with quote

Thank you very much for your replies, and for pointing out this page about hugo contributions.
I thought everything was on http://hugonomicon.sourceforge.net . Unfortunately, there is a mysql problem on the website at the moment so I was unable to see it at all.

I'll add some information about hugo on the ifwiki, if you wish you can contribute too : http://www.ifwiki.org/index.php/Hugo

I've started a thread about Hugo on a mailing list dedicated to the localization of IF systems :

http://groups.google.fr/group/rakontointeraktiva/browse_thread/thread/f0cbc263e18c41fe/5153a4d02f6f7acb#5153a4d02f6f7acb

We may try to translate it into Italian and French
Back to top
Hugella2
Guest





PostPosted: Sun Nov 27, 2005 4:26 pm    Post subject: Reply with quote

Thanks for pointing out the problem with the Hugonomicon, Otto! Didn't realize there was a problem.
Back to top
Otto
Guest





PostPosted: Tue Nov 29, 2005 4:00 pm    Post subject: Reply with quote

Are you in charge of this website ? Will you manage to fix the problem with the database ?
Back to top
Hugella2
Guest





PostPosted: Tue Nov 29, 2005 8:07 pm    Post subject: Reply with quote

Otto: yes, that's my ill-conceived vision malfunctioning. However, I'm in the midst of final exams so it may be a week or so before I can really get to fixing the damn thing, BUT I WILL. :)
Back to top
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Theme by Kage Musha - RPG Garden

Copyrights and trademarks are all of the belonging company. No copyright Infringement intended