Kent or Whomever

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

Debaser
Posts: 878
Joined: Tue Jun 25, 2002 9:55 pm
Location: Aurora, IL

Kent or Whomever

Post by Debaser »

Oddly, when I tried to steal the help menu code for use in the table of contents in a book, it didn't work. Code replicated here:

Code: Select all

routine DoReadGrimoire
{
 if (diogrimoire in player)
 {
	"You recognize the familiar scrawl of your own, cramped handwriting upon the pages of this grimoire.  You peruse its contents thoughtfully, hoping to find a trick or secret to get you out of your current predicament..."
	pause
	local a = 1

	TEXTCOLOR = BRIGHT_WHITE
	BGCOLOR = BLACK

	MENU_TEXTCOLOR = DEF_FOREGROUND
	MENU_BGCOLOR = DEF_BACKGROUND
	MENU_SELECTCOLOR = DEF_SL_FOREGROUND
	MENU_SELECTBGCOLOR = DEF_SL_BACKGROUND

	while true
	{
		menuitem[0] = "BOOK OF SECRETS"
		menuitem[1] = "Preface"
		menuitem[2] = "A Desperate Invocation"
		a = Menu(2, 0, a)
		select a

		case 0
		{
			TEXTCOLOR = DEF_FOREGROUND
			BGCOLOR = DEF_BACKGROUND
			color TEXTCOLOR, BGCOLOR
			window 0
			cls
			PrintStatusline
			DescribePlace(location)
			return
		}
		case 1:  GrimPreface
		case 2:  GrimDesperate
	}
 }
 else { "You need to be carrying your grimoire to reference it." }
}

routine GrimPreface
{
 CenterTitle("\BPreface\b")
 "\nAt the time I put pen to paper on this"
 pause
}

routine GrimDesperate
{
  "a"
  pause
}
Somehow, changing "routine DoReadGrimoire" to "replace DoHelp" fixed it. While the help menu logic doesn't seem sufficient to cover eveything the menu does, I'm also completely lost as to how a replaced help routine is activating the super-secret library codes I need to get things to work right.

Any explanations and/or tricks to getting more than one help-menu style menu in one game? Thanks in advance.

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

Re: Kent or Whomever

Post by Kent »

Debaser wrote:Oddly, when I tried to steal the help menu code for use in the table of contents in a book, it didn't work.
[...]
Somehow, changing "routine DoReadGrimoire" to "replace DoHelp" fixed it.
What does "it didn't work" mean here? Because that's kind of weird.

Debaser
Posts: 878
Joined: Tue Jun 25, 2002 9:55 pm
Location: Aurora, IL

Post by Debaser »

The menu comes up, but selecting an option doesn't actually do anything. The screen stays static and doesn't activate the option. Robb reports memories of similar problems back when he was coding ACS, and he was the one who suggested switching the routine back to help.

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

Post by Ice Cream Jonsey »

Yes, it's quite odd. There's nothing "hard coded" into Hugo regarding the help routine's use of menus, is there?
the dark and gritty...Ice Cream Jonsey!

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

Example

Post by Kent »

Is there any chance you can send me some compilable source that demonstrates this?

(In response to ICJ--no, there's nothing in the engine hardwiring-wise which should affect this, at all.)

--Kent

Debaser
Posts: 878
Joined: Tue Jun 25, 2002 9:55 pm
Location: Aurora, IL

Re: Example

Post by Debaser »

Kent wrote:Is there any chance you can send me some compilable source that demonstrates this?
What's your addy?

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

Oops

Post by Kent »


Debaser
Posts: 878
Joined: Tue Jun 25, 2002 9:55 pm
Location: Aurora, IL

Post by Debaser »

Um... nevermind. I guess, somehow, in the process of cutting out the requisite bits of code into a shell for you to look at, I fixed whatever problem I was experiencing. Haven't the faintest clue what I did. Odd that, but I guess I shouldn't look gift code in the mouth. Thanks anyway.

Post Reply