Initially sitting

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

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Initially sitting

Post by Bainespal »

The player object has to be located within an object with the "enterable" attribute from the very first move of the game. This represents the player character sitting in a sort of stands or bleachers, and the game has to begin in that state.

I've tried a couple different things in my init routine, but nothing has worked flawlessly so far. I've been setting location to the parent room object, moving the player to the room, and then using Perform() to make the player enter the bleachers object:

Code: Select all

	player = you
	location = dome
	old_location = location        

	move player to location

	Perform(&DoEnter, bleachers) ! initially sitting -- sort of works
        
	FindLight(location)
	DescribePlace(location)
	location is visited
	CalculateHolding(player)
There are two problems with this. These two unwanted lines are displayed:
Hugo v3.1 / Library 31031
You sit down on the stands.
It's too dark to see anything.
Also, when I run the game in the Debugger, I get the message "Property out of range: 255".

I've also tried setting the location to the room, moving the player directly to the bleachers, and then doing FindLight() for the bleachers directly:

Code: Select all

	player = you
	location = dome
	old_location = location        

	move player to bleachers

	FindLight(bleachers)
	DescribePlace(location)
	location is visited
	CalculateHolding(player)
This doesn't produce the Debugger warning message. However, the darkness message is printed instead of the room description. Evidently, I can't make the game undersand that the bleachers are not closed off to the light.

Roody_Yogurt
Posts: 2180
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

First off, besides making the bleachers "enterable," make sure that they are also a platform, so Hugo will know automatically to do (on the bleachers). You might also want to take a look at http://hugo.gerynarsabode.org/index.php?title=Prep so you can get exactly (Sitting on the bleachers).

Now, as for the second thing, this works for me:

Code: Select all

	player = you
	location = STARTLOCATION
	move player	to bleachers
	old_location = location
	FindLight(location)
	DescribePlace(location)
	location is	visited
	CalculateHolding(player)
In your first example, yeah, you shouldn't be moving the player before it performs FindLight. In the second example, I think FindLight still should use "location" as an argument (assuming the bleachers object is in the domes room), although maybe your biggest problem was that if your bleachers object didn't have the platform property, that it also didn't have "open" or "transparent". There might have have been a scope issue going on there.

Anyhow, not related to the matter at hand, this reminds me how I've lately wondered if the init routine in the shell file should be changed to something like this:

Code: Select all

	location = STARTLOCATION
	old_location = location
	MovePlayer(bleachers)
	CalculateHolding(player)
, as MovePlayer will do FindLight, DescribePlace, and setting visited for us.

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Post by Bainespal »

Roody_Yogurt wrote:You might also want to take a look at http://hugo.gerynarsabode.org/index.php?title=Prep so you can get exactly (Sitting on the bleachers).
Thanks for reminding me about that property. It's interesting that it can have two elements, one for getting off of the object!

Your code seems to work, but the Debugger displays the same warning I was getting before -- "Property out of range: 255." Since I just played through everything I have implemented in Hugor and had no problems related to this code (as far as I can tell), I'll assume that it's safe to ignore the Debugger.

Thank you.

Roody_Yogurt
Posts: 2180
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Huh, even in the debugger, I can't replicate that warning. I'm thinking the warning is from something else.

Post Reply