light

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

User avatar
Tdarcos
Posts: 9341
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

light

Post by Tdarcos »

I'm trying to find a way to have a shut-off for the power make some rooms dark, and I'm trying to figure out how I can tie certain rooms to a switch as to whether the power has been switched off.

Can I attach a value to the rooms I want to do this? Even better, can I create a class of room such that I, for example, define the object as "darkroom" instead of "room" so that I don't have to put some procedure call in a couple hundred rooms.
"I really feel that I'm losin' my best friend
I can't believe this could be the end."
- No Doubt, Don't Speak

User avatar
Tdarcos
Posts: 9341
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

I found where the problem is. It requires a replace of the findlight routine, and changing rooms to normally be dark. I have my own pseudo light value which goes on if the switch is thrown on, dark if off. Then I revised the Room class to default to dark, and a lit_room class that inherits room but is normally lit.
"I really feel that I'm losin' my best friend
I can't believe this could be the end."
- No Doubt, Don't Speak

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

Post by Roody_Yogurt »

Sounds like steps in the right direction to me. Good work, Tdarcos!

User avatar
Tdarcos
Posts: 9341
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

I upgraded this room to make an automated change. I have basically this huge warehouse (12x10) that I word processor translated into "warehouse_room" instead of "room". Then I made that a clone class of room but with the "not light" attribute. This way I don't change the Room class.

What was most interesting was setting up the basement room where the gas meter is. Hit it with a 40 ounce sledge hammer and you crack it. Now it starts to hiss. As long as you're in the room it plays the hiss. Leave that room and you can't hear the hiss any more. Come back and the hiss is there again. For the rest of the game. Unless you're stupid enough to use a 2 1/2 pound steel sledge hammer on a leaking gas meter...

I've figured out how to design a typical house. For the reprobate who doesn't live there and likes to search other people's houses...

Next step is how to get multi-location scenery so I can put the same item in several places.

I ain't quite figured out what the game will be about, it was first about using a computer program to generate a 12x10 grid of rooms then going in and changing the special ones. Some of the rooms in the warehouse go to the basement, the catwalk over it, or to the roof.

Oh yeah, got to have the capacity to jump off the roof. Stupid, but a valid thing to try.
"I really feel that I'm losin' my best friend
I can't believe this could be the end."
- No Doubt, Don't Speak

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

Post by Roody_Yogurt »

Tdarcos wrote:Next step is how to get multi-location scenery so I can put the same item in several places.
For this, you likely would want to use the "found_in" property.

Post Reply