Tutorial (Sort Of)

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

Cryptonomic
Posts: 55
Joined: Wed May 05, 2004 4:35 am
Location: Chicago, IL
Contact:

Tutorial (Sort Of)

Post by Cryptonomic »

If people are interested, check out:

http://www.globaltester.com/Hugo/index.html

I am trying to write up some material for Hugo. The more I look at the language, the more I realize it is very powerful and very under-represented. This is too bad since it really is a very easy language to learn. What the above link does is show my initial (and now updated) "Crafting" tutorial to explain to people new to the language what the shell.hug is all about.

It needs work; believe me, I know that. This is just a start. The part 2 (about "Zork: Revisited") is, as you can see, incomplete. That said, I am now thinking that Zork is not the best way to go about this. I am actually looking more at "Guilty Bastards" or maybe "Crimson Spring".

Anyway, the links are there for those interested in seeing what I did so far.

Kent
Posts: 119
Joined: Fri Jun 27, 2003 12:10 pm

Post by Kent »

Looks very slick to me. I'll add it to the list of places I refer people to when they're in search of additional Hugo programming info.

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

Post by Ice Cream Jonsey »

Not sure how much help ACS could be, but if there's anything you had in mind, feel free.

I should go back and clean that one up. I always seemed to do a little worse up against the comp deadline. There's a host of things that could be improved with that game, come to think of it.
the dark and gritty...Ice Cream Jonsey!

Cryptonomic
Posts: 55
Joined: Wed May 05, 2004 4:35 am
Location: Chicago, IL
Contact:

Post by Cryptonomic »

Ice Cream Jonsey wrote:Not sure how much help ACS could be, but if there's anything you had in mind, feel free.
Thanks.

I think some elements of "A Crimson Spring" could be helpful. One thing I want to showcase is the "game events" array. When I was looking at Inform, for example, there was a flags.h extension. So if a user wanted to see how to do something similar in Hugo, that kind of array would be something to consider. The use of the status line to provide different information is also helpful.

I would like to try to find the source code to "The Night of the Sexbot" (if anyone has it). I say that because it has interesting window effects at the start. (If no source code is available, any help in determining how the gray window effects were done would be another alternative.)

To that, I am keeping with my "Zork Revisited" example and I am showing how to use pictures, sounds, and video in that context because then a person reading the "Guilty Bastards" source code should have no problems figuring out what is happening.

So clearly I am thinking my goal here, contrary to what I just said in the previous post, *will* be to stick with my somewhat stupid "Zork Revisited" idea, but to showcase ideas used in other games where the source is available so that people reading that source might be able to correlate what they learned with what they are seeing there. I will try to vary my own examples so that (a) I am not just blatantly stealing from other games and (b) so that players can see ways of modifying the code to do different things.

- Jeff

Hugella
Posts: 73
Joined: Mon Jun 28, 2004 4:45 pm
Location: Minneapolis, Minnesota

Post by Hugella »

I've emailed the author of 'Sexbot' with a request for the source. *crosses fingers*

Lysandr

Post by Lysandr »

...And just as I was starting to really look at making my own game, too. Spifffyyyyy.

Cryptonomic
Posts: 55
Joined: Wed May 05, 2004 4:35 am
Location: Chicago, IL
Contact:

Post by Cryptonomic »

Okay, I uploaded modified Parts 1, 2, and 3.

http://www.globaltester.com/Hugo/index.html

Again, I know these need some work. The idea here was just for me to get some stuff out there that I could then shape and mold based on comments I recieve and on my own experiences as I develop a game in Hugo.

As a note to those who know Hugo, I do differ from the Manual in some places with terminology. For example, I have never been a fan of this:

object <objectname> "object name"

Naming two distinct things the same name might be confusing. So I refer to an "object identifier" and an "object name". Likewise, I make a distinction between property sets and property routines. Other than that, however, everything should pretty much make sense. (I am tracking down a possible issue with a build of the hewin.exe regarding the sound keyword. I have one build from August 2004 that has no trouble playing sounds but a build from September 2004 that seems to have trouble. I am still checking into that.)

Guest

Post by Guest »

This is really good. One thing I've learned about IF systems is that you need good explainers of the system. (Look at Roger Firth with Inform, for example.) I think you should consider rewriting the Hugo Manual. Your way of presenting is quite good and I think it's more consistent than what's shown in the manual. Were I you, I'd get rid of the idea of a tutorial and literally start making a sort of 'Hugo Book' or something because I think the tutorial approach is forcing you to avoid some subjects or treat them lightly. You could still build up your Zork game but just in bits and pieces as you document the language. I'd probably drop the media elements except as maybe a 'supplement' to the main text.

Cryptonomic
Posts: 55
Joined: Wed May 05, 2004 4:35 am
Location: Chicago, IL
Contact:

Replying to "Guest"

Post by Cryptonomic »

I think you should consider rewriting the Hugo Manual.
I am not the author of the Hugo Manual, so I could not re-write it, per se. What I was doing here was trying to provide a bit of a supplement to the manual. Often what I do when learning anything is then write down my thoughts and try to present those in a way that I wish had been available when I was learning. Note that in the tutorial there are often times where I do suggest the reader go to the manual to check up on things further. But I also indicate where I differ from the manual, which is only in the case of terminology on a few small points.
Were I you, I'd get rid of the idea of a tutorial and literally start making a sort of 'Hugo Book' or something because I think the tutorial approach is forcing you to avoid some subjects or treat them lightly.
Yes, that is sort of true in terms of avoiding some subjects. This mainly happens because you figure, when writing, "Oh, yeah, I guess I should explain that, too. But it does not fit here. Hmm. Guess I will have to figure out how to throw that in." And then 'throwing that in' makes your tutorial start to get a little disjointed. So maybe what we need to do is come up with a sort of "Hugo Beginner's Guide" - one that graduates from easy material to more advanced material.
I'd probably drop the media elements except as maybe a 'supplement' to the main text.
I know that the media elements seem sort of tacked on, so I understand what you are saying here. I still would like to include them in some fashion (and not just as supplement) because many of the Hugo games out there (particularly games like Guilty Bastards, Fallacy of Dawn and Necrotic Drift) tend to use a lot of graphics and sounds. But, maybe, with the idea of a "Programmer's Guide" the media portions could fit into the later, more 'advanced' sections.

Thank you for the comments as this has given me some things to think about.

mercurycs
Posts: 8
Joined: Mon Jan 31, 2005 8:13 pm
Location: Vermont

Post by mercurycs »

Is this tutorial available anywhere any longer? thanks.

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

Post by Ice Cream Jonsey »

I am sorry, mercurycs! I don't know what happen to Cryptonomic. I have not checked in with her for a while.

This sucks, as you are obviously trying to get started with Hugo, and there's been bitrot for all the cool Hugo stuff out there. Tell you what - I will write her an email with what was listed here, and see if she still has the files. If she does, I will re-host them at like hugo.caltrops.com or something.
the dark and gritty...Ice Cream Jonsey!

mercurycs
Posts: 8
Joined: Mon Jan 31, 2005 8:13 pm
Location: Vermont

Post by mercurycs »

Thank you Ice Cream Jonsey. I certainly appreciate your help.

Hugella2

Post by Hugella2 »

Hey...if I'm not mistaken, Cryptonomic is aka Jeff Nyman. Although these tutes are no longer online, I did have the foresight to print them out! Don't know how Jeff'd feel about me posting them though.

Also, I actually bought the domain hugonomicon.com but don't know what (or if) I'll do with it. Time...

(former op of the Hugonomicon)

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

Post by Ice Cream Jonsey »

Whoops! I confused Hugella with Cryptonomic. Apologies for the incorrect genders in my above message!
the dark and gritty...Ice Cream Jonsey!

Johnny
Posts: 36
Joined: Sat Oct 15, 2005 4:30 pm
Location: Humble, Texas

Post by Johnny »

The tutorial is pretty good for people new to Hugo and probably good for those new to programming.

Minus a couple of graphics, namely the Hugo logo and an example of an object tree (you can find a similar one in the Hugo Book), you can find the tutorial on the Internet Archive (archive.org) Wayback Machine here.

Because it's an archived copy the links to relevant files don't work, but you can find the files in the IF Archive Hugo folder here. There you can find the Scavenger Hunt tutorial, the Hugo Book, excellent example code, and more.

As far as I can tell, the multimedia files are gone to Hell, but you can replace them easily with some internet searching. A bird call. Video of a cloud. Cricket chirps. The Zork I cover image.

Or make your own, use anything you have on your computer, just look over the multimedia portion. Whatever.

Good luck to future Hugonauts.

Lysander
Posts: 1693
Joined: Tue Jul 08, 2003 12:39 pm
Location: East Bay, California.

Post by Lysander »

Hey-ya, Johnny! how's my game of ours goin'
Johnny wrote:Cricket chirps.
Huh.. that's weird, after <i>TWO FUCKING YEARS</I> I thought I might've heard something. Anything? Maybe?









...



....


Johnny wrote:Whatever










...........










...








.....Never mind
paidforbythegivedrewbetterblowjobsfundandthelibertyconventionforastupidfreeamerica

User avatar
pinback
Posts: 17700
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

Infighting among Hugo programmers.

This is also a public service of anger and righteousness.

JC BBS IS A BEACON OF HOPE!!!!
I don't have to say anything. I'm a doctor, too.

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

Post by Ice Cream Jonsey »

It's a bloodbath right now. Mike Snyder ordered a drive-by on my house - the bullets spelled out, "DOWN"!!
the dark and gritty...Ice Cream Jonsey!

Johnny
Posts: 36
Joined: Sat Oct 15, 2005 4:30 pm
Location: Humble, Texas

Post by Johnny »

Just to clear things up, at no point was Lysander ready to choke me out. I think.

Also, this thing should be ready for some heavy beta-testing soon.

It's Inform 6 currently, because the Hugo version is crashing in a couple of places... might just be the graphical Linux runner, though.

And I think Lysander's edits were really funny.

Anywho, here's some simple Hugo code that I can't use for this game, but hopefully the next one.

Code: Select all

array _serial&#91;10&#93;

routine GetSerial
&#123;
	local i
	string&#40;i, serial$, 10&#41;
	StringCopy&#40;_serial, i&#41;
&#125;

routine PrintSerial
&#123;
	StringPrint&#40;_serial, 6, 8&#41;
	StringPrint&#40;_serial, 0, 2&#41;
	StringPrint&#40;_serial, 3, 5&#41;
&#125;
It uses serial$ to print an Inform- or TADS-style serial number, TADS-style being YYYYMMDD. What I would do for that is, in my PrintVersion routine, put 'print "Release "; RELEASE; " (20"; PrintSerial'. Call me a pessimist, but I don't expect to live out the century.

Post Reply