unofficial library enhancement
Moderators: Ice Cream Jonsey, joltcountry
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
unofficial library enhancement
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
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.
- Ice Cream Jonsey
- Posts: 30184
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
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:
Most of the library fixes are older than February. Among the new improvements are:
- 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";
} - 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>
} - 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.
- 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?
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
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.]
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.]
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
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.
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.
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
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
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
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
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.
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.
-
- Posts: 89
- Joined: Wed Jan 04, 2012 2:57 pm
- Location: Texas
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.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
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.
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?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.
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
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
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.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.
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.
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.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?
- Tdarcos
- Posts: 9556
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
Re: unofficial library enhancement
Very temporary, as in 404 Error page not found.Roody_Yogurt wrote:Anyhow, this is a temporary thing ...
Download:
http://roody.gerynarsabode.org/roodylib.zip
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.
"When I die, I want it easy and peaceful in my sleep, like my uncle.
Not screaming and crying like his passengers."
Not screaming and crying like his passengers."
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee