unofficial library enhancement

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

unofficial library enhancement

Post by Roody_Yogurt »

Lately, I've decided that the handful of files I've been including with each new WIP were a bit unwieldy, so I compiled all of the unofficial Hugo library updates into two files. Besides that, I also added several utility routines, based on what I felt was useful enough to be lumped in with the standard library.

Anyhow, this is a temporary thing until hypothetical official updates come along, but the files themselves are definitely open up for debate. Feel free to use them in your games. In the least, some of the routines might give you some ideas.

Download:
http://roody.gerynarsabode.org/notdead/ ... _suite.zip
Last edited by Roody_Yogurt on Wed Feb 06, 2013 11:45 am, edited 1 time in total.

User avatar
Ice Cream Jonsey
Posts: 28881
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

I switched gears on what project I am working on (it's not using Hugo at the moment) but when I go back to the tiny space game I started, all of these additions will be in it. I think anything you made before February already is?
the dark and gritty...Ice Cream Jonsey!

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

If I heard you switched systems for your WIP, I totally forgot. Would love to hear what you're going with now.

Most of the library fixes are older than February. Among the new improvements are:
  1. I split PrintStatusLine into three routines, but that's not important. The important thing is that changing your game to statustype 3 makes the score/moves counter like it was in Infocom. The more important thing is that statustype 4 gets its text from the routine STATUSTYPE4 so now you can change what goes in the upper right corner without replacing PrintStatusLine every time.

    So:

    replace STATUSTYPE4
    {
    if player is happy
    print "FROSTY";
    else
    print "NOT FROSTY";
    }
  2. I added an extra routine to be called at the beginning of ParseError called "PreParseError". Once in a long while, you'll want certain code to be run every turn, successful or not. It's easy enough to put something in PreParse, which will be executed before every understood turn, but sometimes you want something done before the failing turns, too. This puts in a nice foothold for such things.

    replace PreParseError
    {
    <code>
    }
  3. The vehicle/DoGo replacements are on the newer side of things. That is prompted by things like the horse in Spur, vehicles where "up" and "out" are not the expected "get out of the vehicle directions". The standard library makes some hard-to-work-with assumptions about that.
  4. I included my DoListen fix, and since it's a similar kind of verb, I made DoSmell more standard-library-y. Are there other verbs, verbstub or not, that we'd want to improve for standard library inclusion?
I tried to comment every inclusion, so browsing the file should give people an idea of everything that's there.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I also forgot to mention some screen-redrawing stuff I put in there. I threw in a PrintStatusLine into ParseError. Previously, if the player changed the window size and then did a misunderstood command, the status line disappears. No big deal, sure, but I find the behavior an eyesore.

I also made a RedrawScreen routine that is supposed to go into PreParse. If it directs a screen change, it says something like "detected screen change; redrawing screen" then waits 2 seconds then clears the screen*. After that, it rewrites the player's last command entry and goes on to process it.

Anyhow, any game with graphics will have their own redraw-the-screen routines, but this should make the average text game look nicer.

[* - I clear the screen because if the change in screen size is drastic enough, all of the old text will still be at the old screenwidth.]

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I don't really want to create a new thread here every time I want to philosophize about something Hugo related, so I created a blog for just that: http://notdeadhugo.blogspot.com

I hope that anyone interested in Hugo-coding philosophy or wants to weigh in themselves check it out.

Of course, I'll still post announcements, news, and possibly coding tips here.

Oh yeah, I do not want the blog added to Planet IF, since it's not really stuff to share with the whole IF world.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Huh, I thought the no-editing thing was only for the other bases. THANKS A LOT, TDARCOS!

Anyhow, instead of the link at the beginning of the thread, the latest, best version of roodylib will be found (for the foreseeable future) at:
http://roody.gerynarsabode.org/notdead/ ... _suite.zip

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I've gotten myself a bitbucket account and have put a bunch of Hugo-extensions-in-progress there:
https://bitbucket.org/roody_yogurt/hugo-code-lab/src

I'll continue to update Hugo By Example's extension pages, but in the least, I figure that the bitbucket page will be useful for when HbE's server is acting spotty.

If anybody knows any git/bitbucket tips and tricks to make my pages there more useful and accommodating, please let me know.

loafingcoyote
Posts: 89
Joined: Wed Jan 04, 2012 2:57 pm
Location: Texas

Post by loafingcoyote »

Roody_Yogurt wrote:I've gotten myself a bitbucket account and have put a bunch of Hugo-extensions-in-progress there:
https://bitbucket.org/roody_yogurt/hugo-code-lab/src
Wow, this is fantastic. I've never heard of bitbucket before, but it looks like a great place to organize projects and show other people what you're doing. I want to try it myself.

From what little I know, Mercurial is simpler that Git, so I'm curious why you went with Git. Is it more powerful in some way or are you just more familiar with it? Pardon me if this question seems naive but I'm not familiar with either of them.
Roody_Yogurt wrote:I'll continue to update Hugo By Example's extension pages, but in the least, I figure that the bitbucket page will be useful for when HbE's server is acting spotty.
This brings up a question I've been meaning to ask you for a while. I was was wondering if the content HbE was backed up somewhere?

Although I'm sure it's very unlikely anything would happen to it, I've always had the fatalistic attitude that my own code is just waiting to disappear on me. As a result, I'm not comfortable unless my own stuff is backed up in at least a couple of different places.

-lc

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

loafingcoyote wrote:From what little I know, Mercurial is simpler that Git, so I'm curious why you went with Git. Is it more powerful in some way or are you just more familiar with it? Pardon me if this question seems naive but I'm not familiar with either of them.
You know, I didn't actually research them this time around and just went with git because it had more "name-brand recognition" for me. I thought that when I looked into it last time, Mercurial sounded like the more-powerful of the two, which made me think, eh, I don't need it then.

On one hand, bitbucket has nice get-you-going pages that tell you the exact command line commands to get your project going. On the other hand, things like deleting unnecessary files from the project can be more of a hassle than they need to be. The actual committing process is pretty painless, once you have it down, though.
loafingcoyote wrote:This brings up a question I've been meaning to ask you for a while. I was was wondering if the content HbE was backed up somewhere?
I backup HbE every so often, but it's true that I often go some months in between backups. I should get better about that.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: unofficial library enhancement

Post by Tdarcos »

Roody_Yogurt wrote:Anyhow, this is a temporary thing ...

Download:
http://roody.gerynarsabode.org/roodylib.zip
Very temporary, as in 404 Error page not found.

One of your other messages mentioned this file as the most current realease: http://roody.gerynarsabode.org/notdead/ ... _suite.zip

Is that the correct URL or are there two different items?

I posted this message because, in case you've forgotten, I did enough penance to get post editing restored, so you can now correct the erroneous link at the start of this thread if that is what you wanted to do.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Yeah, I changed URLs somewhere along the way. I didn't update the URL here because I like to pretend that I don't need post-editing, after having spent so much time without it.

But yeah, fixed now.

Post Reply