Skip to content

Instantly share code, notes, and snippets.

@andrewschultz
Created October 22, 2015 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewschultz/b83ed035c2af78682868 to your computer and use it in GitHub Desktop.
Save andrewschultz/b83ed035c2af78682868 to your computer and use it in GitHub Desktop.
bare minimum hugo file from Jon Blask
!::
! New Game (Shell)
!::
!:: Flags
!#set BETA ! Compile with the comments-in-transcripts library
! addition (requires "beta.h")
!#set HUGOFIX ! Compile with HugoFix Debugging Library commands
! available (type $? in game)
!#set VERBSTUBS ! Include the grammar and routines from verbstubs.g
! and verbstubs.h, respectively
!#set USE_ATTACHABLES ! Use attachable items
!#set USE_PLURAL_OBJECTS ! Use plural objects
!#set USE_ROODYLIB
!#set USE_VEHICLES ! Use vehicle objects
!#set VERSIONS ! Print library versions at compile time
#ifset HUGOFIX
#set DEBUG
#endif
!:: Other pre-Hugolib.h Constants
! (some constants must be set before hugolib is included)
constant GAME_TITLE "GAME TITLE"
constant AUTHOR "YOUR NAME"
constant RELEASE "1.0"
!constant BLURB "An Interactive Blah"
!constant IFID "put-IFID here"
!:: Grammar Library Inclusions (grammar must come first)
#ifset USE_ROODYLIB
#include "roodylib.g"
#endif
! new grammar needs to be defined before the including verblib
#include "verblib.g" ! Verb Library
#include "hugolib.h" ! Standard Hugo Library
#ifset USE_ROODYLIB
#include "roodylib.h" ! Hugo Library Updates
#endif
!:: Other Library Inclusions
!:: Other constants and global variables
!constant IFID "put-IFID here"
!:: Game Initialization routine
routine init
{
!: First Things First
SetGlobalsAndFillArrays
!: Screen clear section
#ifclear _ROODYLIB_H
CenterTitle("Hugo Interactive Fiction")
cls
#else
SimpleIntro
InitScreen
!: Set up any special libries
Init_Calls
#endif
!: Game opening
IntroText
MovePlayer(location)
}
routine SetGlobalsAndFillArrays
{
!\ Uncomment and modify this section if your game has scoring and ranking.
MAX_SCORE = 50
ranking[0] = "Amateur Adventurer"
ranking[1] = "Competent Door-Unlocker"
ranking[2] = "Bomb-Meddling Adventurer"
ranking[3] = "Master Magic Wand Finder"
ranking[4] = "The Genuine Article Sample Game Solver"
MAX_RANK = 4 \!
verbosity = 2
counter = -1 ! 1 turn before turn 0
STATUSTYPE = 1 ! 1 = score/turns, 2 = time, 3 = moves: score:
TEXTCOLOR = DEF_FOREGROUND
BGCOLOR = DEF_BACKGROUND
SL_TEXTCOLOR = DEF_SL_FOREGROUND
SL_BGCOLOR = DEF_SL_BACKGROUND
#if defined TITLECOLOR
TITLECOLOR = DEF_FOREGROUND
#endif
prompt = ">"
DEFAULT_FONT = PROP_ON
display.title_caption = GAME_TITLE
#ifset _ROODYLIB_H
MakePlayer(you,2) ! sets player as you object, second person
#else
player = you
#endif
location = STARTLOCATION
}
!:: Main game loop
routine main
{
counter = counter + 1
run location.each_turn
runevents
RunScripts
#ifset _ROODYLIB_H
SpeakerCheck
#else
if parent(speaking) ~= location
speaking = 0
#endif
PrintStatusLine
#ifset _ROODYLIB_H
Main_Calls
#endif
}
routine IntroText
{
Font(BOLD_ON)
"ldod"
Font(BOLD_OFF)
"by A Trizbort User"
#if defined DoVersion
""
DoVersion
#endif
}
player_character you "you"
{
}
room STARTLOCATION "Start Location"
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment