Getting Started

From Hugo By Example

(Difference between revisions)
Jump to: navigation, search
m (Get a text editor)
(page overhaul)
 
Line 1: Line 1:
-
Interested in checking out Hugo but don't know where to start? Hopefully, this page can help!
+
Welcome!  Interested in making a game in Hugo? You’ve come to the right place!
-
 
+
-
==Get a text editor==
+
-
If you're new to coding, you'll find that having a nice text editor with syntax coloring will go a long ways towards making code easier to understand. Download a program [[Supported_Editors|here]] (gedit, EditPlus, and Textpad are some good ones) and install the accompanying syntax file. If you need to configure the syntax file within the program, be sure to associate it with '''.h''', '''.g''', and '''.hug''' files.
+
 +
=Get the Hugo Book=
 +
First things first, you should download and read the [http://www.ifarchive.org/if-archive/programming/hugo/manuals/hugo_book.pdf Hugo Book].  Of course, one doesn’t have to start off knowing everything, but familiarizing yourself with the code logic and having an initial survey of the Hugo manual will help you decide if Hugo is right for you.
 +
<br />
 +
=Text Editors=
 +
Even among most modern interactive fiction systems, Hugo is kind of old school in that it doesn’t have a graphical user interface for writing games.  This means that you’ll be using a text editor and a compiler to create the .hex files that Hugo interpreters can play.
 +
<br />
 +
==Windows (and WINE)==
 +
Now, to be honest, the Windows software suite for Hugo ''does'' have a frontend that allows compilation without the use of command lines, but I find that a good text editor setup is preferable.  For instance, the frontend can be confused if you change the source file you are compiling mid-session.  Also, if your compilation has an error, you can’t easily jump to the problematic lines (something almost any text editor with “send output to window” functionality can handle).
 +
<br /><br />
 +
For the most part, I recommend that new Hugo Windows users check out my distribution of Notepad++ that comes pre-configured with methods for starting new projects, compilation, and several other niceties.
 +
<br /><br />
 +
If you don’t already have Notepad++ installed, I suggest downloading this [https://goo.gl/eEtN39 standalone version].  It provides clickable buttons in the toolbar for the aforementioned tasks.  One note: one button that looks up selected text in the Hugo Book assumes you have Acrobat Reader installed as that is the only PDF reader I know of that lets you open a document with a search string in its command line.  Also, WINE users may find that some buttons look broken (but should remain functional nonetheless).
 +
<br /><br />
 +
If you already have Notepad++ installed on your system, download this [https://drive.google.com/file/d/0B_4ZXs4Z_yoWclhaOFFYQ3JScjg/view?usp=sharing “add on” package] for instructions and files for turning it into a nice Hugo coding environment (the instructions are in the included .pdf file).
 +
<br /><br />
 +
If you prefer other text editors, you can look for syntax highlighting solutions [[Supported_Editors|here]].  Of course, you’ll also need the [http://www.ifarchive.org/if-archive/programming/hugo/executables/hugov31_win32.exe Windows Hugo package] and [http://www.ifarchive.org/if-archive/programming/hugo/library/hugolib.zip library] (both of which are already included in the Notepad++ package).
 +
<br />
 +
==Other OSs==
 +
Linux users should get the [http://ifarchive.org/if-archive/programming/hugo/executables/hugov31_linux.tar.gz Linux binary] from the IF Archive, and MacOS X users should build the compiler and such from the files [https://bitbucket.org/rsherwin/hugo-mac/overview here] (as of the writing of this page, it hasn’t yet been uploaded to the IF Archive).  You’ll also need the [http://www.ifarchive.org/if-archive/programming/hugo/library/hugolib.zip Hugo library].  For testing purposes, you may want to also download the Hugor interpreter (available [http://ifarchive.org/indexes/if-archiveXprogrammingXhugoXexecutables.html here] and through package managers).
 +
<br /><br />
 +
You also can look for syntax highlighting files [[Supported_Editors|here]].
 +
<br />
 +
==Syntax Highlighting==
 +
If you’ve gotten this far and don’t know what syntax highlighting is, well, it’s a text editor extension that gives various elements of the code different colors for easier readability.  Of course, it doesn’t actually affect how the code *works* so if you really want to write your game in Notepad, you could do that, too.
 +
<br />
{| class="wikitable"
{| class="wikitable"
! Editor without highlighting
! Editor without highlighting
Line 11: Line 33:
| [[File:withhilite.png|400px]]
| [[File:withhilite.png|400px]]
|}
|}
-
<br />
 
-
==Look at a sample game==
+
="Roodylib"=
-
Now that you have a text editor fit for Hugo source code, download [http://ifarchive.org/if-archive/programming/hugo/examples/sample.hug The Vault of Hugo] and open it up with that aforementioned editor. The Vault of Hugo, while written for Hugo 2.5, is still ''current enough'' to be a good representation of Hugo code, and it utilizes more of Hugo's features than the average game. There's a lot going on there, so if it seems too complicated, don't worry.<br />
+
[https://goo.gl/0s67c4 Roodylib] is several years’ worth of Hugo library fixes and improvements added since the last official library release in 2006. While not required, I personally recommend users adopt it.
<br />
<br />
-
You can also see the code to several other example games at the [http://ifarchive.org/indexes/if-archiveXgamesXsourceXhugo.html IF Archive].
+
=Sample Game=
-
 
+
Now that you should have a text editor and your compiler and what not, download [http://ifarchive.org/if-archive/programming/hugo/examples/sample.hug "The Vault of Hugo"] and open it up in the text editor.  “The Vault of Hugo” is great as it has an example for almost every basic feature Hugo has.
-
==Get the "shell" file==
+
<br /><br />
-
A quick way of starting to write a new game in Hugo is to start editing a "shell file," which contains the necessary code base for a game so you can jump straight into things like your game title and writing rooms and such.<br />
+
More example code can be found at the [http://ifarchive.org/indexes/if-archiveXgamesXsourceXhugo.html IF Archive].
<br />
<br />
-
Here at Hugo by Example, we've been working on a shell file that is a bit more Hugo 3.0-representative than the file on the IF Archive. You can find it [[New_Shell|here]]. So, the first thing you do when writing a new game is to open up the shell file and save it with a new name (that'll one day be <new name>.hex, your new Hugo game, hopefully).
+
="Shell" file=
-
 
+
The “shell” file is the minimum code the compiler needs to create a game (well, a game that acts like you’d expect an IF game to act, I mean). You can download [http://roody.gerynarsabode.org/hbe/newshell.hug this] and make a copy of it each time you’re starting something new (Notepad++ does this automatically for you through its buttons).
-
==Get the Hugo software and library==
+
<br />
-
Go to the [http://ifarchive.org/indexes/if-archiveXprogrammingXhugoXexecutables.html IF Archive] (executables section) and look for a version of Hugo for your OS. Be sure that it is a package that includes a compiler, as some of those downloads are just interpreters (like the [[Hugor]] links). Install or unzip the package. Also, download the [http://ifarchive.org/if-archive/programming/hugo/library/hugolib.zip Hugo Library]. Unzip that.
+
=Write Your Game=
-
 
+
You should now be ready to get started. If you run into trouble, you have the Hugo Book, the example games, and this website (including [[Tips|this page of useful tips]]) at your disposal. You can also post coding questions at the [http://www.joltcountry.com/phpBB2/viewforum.php?f=8 Jolt Country's Hugo forum] or [http://www.intfiction.org/forum/viewforum.php?f=16 intfiction.org's "other languages" forum]. Lastly, if you'd like real-time assistance, there's the #Hugo channel on the [http://ifmud.port4000.com ifMUD]. You can also send questions to roodyyogurt at gmail.com.
-
==Get and read The Hugo Book==
+
<br />
-
(Of course, there's nothing wrong if you have gotten a head start on this step. You'll be referring to The Hugo Book a lot.)<br />
+
=Debug Your Game=
-
 
+
The [[Debugger|Hugo Debugger]] is a great way to track down the cause behind why-this-thing-isn’t-working-like-it-should.  There’s a bit of a learning curve, but once you’re used to it, it’s indispensable.
-
Download Roody Yogurt's personal book [http://roody.gerynarsabode.org/hugo_book.pdf here]. If you're using an Adobe program, there's a chance you'll be able to see some extra comments that will offer a tad more light on some things or quicker navigation. Add more as you get to parts you think you'll want to refer to!<br />
+
-
 
+
-
Anyhow, now that you are armed with a nice editor, you have the power to write your own little sample code as the Hugo Book teaches concepts to you. It does a good job of going through things like compiling, too, so if that worries you, you're in good hands.
+
-
 
+
-
Don't worry about getting everything on your first read. As long as you learn how to write rooms and sort of understand basic object concepts like [[Attributes|attributes]] and [[Properties|properties]], you're good to go!
+
-
 
+
-
==Write your game==
+
-
You should now be ready to get started. If you run into trouble, you have the Hugo Book, the example games, and this website (including [[Tips|this page of useful tips]]) at your disposal. You can also post coding questions at the [http://www.joltcountry.com/phpBB2/viewforum.php?f=8 Jolt Country's Hugo forum] or [http://www.intfiction.org/forum/viewforum.php?f=16 intfiction.org's "other languages" forum]. Lastly, if you'd like real-time assistance, there's the #Hugo channel on the [http://ifmud.port4000.com ifMUD].
+

Latest revision as of 08:26, 17 December 2016

Welcome! Interested in making a game in Hugo? You’ve come to the right place!

Contents

Get the Hugo Book

First things first, you should download and read the Hugo Book. Of course, one doesn’t have to start off knowing everything, but familiarizing yourself with the code logic and having an initial survey of the Hugo manual will help you decide if Hugo is right for you.

Text Editors

Even among most modern interactive fiction systems, Hugo is kind of old school in that it doesn’t have a graphical user interface for writing games. This means that you’ll be using a text editor and a compiler to create the .hex files that Hugo interpreters can play.

Windows (and WINE)

Now, to be honest, the Windows software suite for Hugo does have a frontend that allows compilation without the use of command lines, but I find that a good text editor setup is preferable. For instance, the frontend can be confused if you change the source file you are compiling mid-session. Also, if your compilation has an error, you can’t easily jump to the problematic lines (something almost any text editor with “send output to window” functionality can handle).

For the most part, I recommend that new Hugo Windows users check out my distribution of Notepad++ that comes pre-configured with methods for starting new projects, compilation, and several other niceties.

If you don’t already have Notepad++ installed, I suggest downloading this standalone version. It provides clickable buttons in the toolbar for the aforementioned tasks. One note: one button that looks up selected text in the Hugo Book assumes you have Acrobat Reader installed as that is the only PDF reader I know of that lets you open a document with a search string in its command line. Also, WINE users may find that some buttons look broken (but should remain functional nonetheless).

If you already have Notepad++ installed on your system, download this “add on” package for instructions and files for turning it into a nice Hugo coding environment (the instructions are in the included .pdf file).

If you prefer other text editors, you can look for syntax highlighting solutions here. Of course, you’ll also need the Windows Hugo package and library (both of which are already included in the Notepad++ package).

Other OSs

Linux users should get the Linux binary from the IF Archive, and MacOS X users should build the compiler and such from the files here (as of the writing of this page, it hasn’t yet been uploaded to the IF Archive). You’ll also need the Hugo library. For testing purposes, you may want to also download the Hugor interpreter (available here and through package managers).

You also can look for syntax highlighting files here.

Syntax Highlighting

If you’ve gotten this far and don’t know what syntax highlighting is, well, it’s a text editor extension that gives various elements of the code different colors for easier readability. Of course, it doesn’t actually affect how the code *works* so if you really want to write your game in Notepad, you could do that, too.

Editor without highlighting Editor with highlighting
Nohilite.png Withhilite.png

"Roodylib"

Roodylib is several years’ worth of Hugo library fixes and improvements added since the last official library release in 2006. While not required, I personally recommend users adopt it.

Sample Game

Now that you should have a text editor and your compiler and what not, download "The Vault of Hugo" and open it up in the text editor. “The Vault of Hugo” is great as it has an example for almost every basic feature Hugo has.

More example code can be found at the IF Archive.

"Shell" file

The “shell” file is the minimum code the compiler needs to create a game (well, a game that acts like you’d expect an IF game to act, I mean). You can download this and make a copy of it each time you’re starting something new (Notepad++ does this automatically for you through its buttons).

Write Your Game

You should now be ready to get started. If you run into trouble, you have the Hugo Book, the example games, and this website (including this page of useful tips) at your disposal. You can also post coding questions at the Jolt Country's Hugo forum or intfiction.org's "other languages" forum. Lastly, if you'd like real-time assistance, there's the #Hugo channel on the ifMUD. You can also send questions to roodyyogurt at gmail.com.

Debug Your Game

The Hugo Debugger is a great way to track down the cause behind why-this-thing-isn’t-working-like-it-should. There’s a bit of a learning curve, but once you’re used to it, it’s indispensable.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox