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.
I was messing with this for about half an hour again tonight after a long break, and it's still driving me nuts. I can't take the meat. I can't see the meat once on the grill at all. Note that the burned phase works just fine. I can ruin the meat, but I can't remove it before it's ruined haha
!----------------------------------------------------------------------------
! Pit
!----------------------------------------------------------------------------
room pit " By the Fire Pit"
{
s_to {currentpicture = "barbwire"
return muddy_dirt
}
long_desc
{
if self is not visited
{
indent (true)
"This fire is always at least smouldering so long as everyone finds brush and waste in the perimeter to keep it going. This is where everyone comes to cook anything they can't cook elsewhere. It's rare you see anyone out here cooking anything though, as food as very scarce and when anyone gets good food they cook it however they can closer to their house so others won't bother them."
}
currentpicture = "firepit"
indent (true)
"You are standing in front of a fire pit of cinder blocks with a makeshift grill composed of some metal grating and wire. There is no one else here at the moment."
}
each_turn
if GameEvents[12] = 1
{
select RoomTurnCount
case 3 :
{"The meat is smelling really good and making your stomach growl loudly."
move meat to pit
}
case 5 : "You smell burnt meat. There wasn't much of it to begin with, so you discard the charred remains into the fire."
move meat to cage
}
}
scenery firepit "firepit"
{
nouns "firepit" "grill" "fire" "pit"
in pit
is platform
is container
holding 0
capacity 2
article "the"
long_desc
{
"The fire blazes along. There's a makeshift grill in one corner of it you can place things on to cook."
}
before {
xobject DoPutIn {
if object ~= carcass
"You have no desire to try to cook that."
else
{
indent(true)
"You place the meat on what looks like the cleanest part of the grill."
return false
}
}
}
after
{
xobject DoPutIn ! since the only thing that works is the carcass
{
"You hear a sizzling sound."
GameEvents[12] = 1
remove carcass
}
}
}
scenery cinderblock "cinderblock"
{
nouns "cinderblock" "block"
in pit
article "the"
long_desc
{
"The fire blazes along. There's a makeshift grill in one corner of it you can place things on to cook."
}
}
By the Fire Pit
This fire is always at least smouldering so long as everyone finds brush and waste in the perimeter to keep it going. This is where
everyone comes to cook anything they can't cook elsewhere. It's rare you see anyone out here cooking anything though, as food as
very scarce and when anyone gets good food they cook it however they can closer to their house so others won't bother them.
You are standing in front of a fire pit of cinder blocks with a makeshift grill composed of some metal grating and wire. There is no one
else here at the moment.
>put carcass on grill
You place the meat on what looks like the cleanest part of the grill.
You hear a sizzling sound.
>look at grill
The fire blazes along. There's a makeshift grill in one corner of it you can place things on to cook.
>wait
Time passes...
The meat is smelling really good and making your stomach growl loudly.
>take meat
You haven't seen anything like that.
>take carcass
You don't see that.
>SHIT
You don't need to use the word "shit."
player_character you "you"
{
}
object carcass "carcass"
{
article "a"
noun "carcass"
in you
long_desc
"Mmmm, carcass."
size 1
}
object meat "cooked meat"
{
article "some"
adjective "cooked"
noun "meat"
long_desc
"Mmmm, cooked meat."
before
{
object DoGet
{
Deactivate(cook_daemon)
return false
}
}
}
room STARTLOCATION "By the Fire Pit"
{
e_to test_room
initial_desc
"This fire is always at least smouldering so long as everyone finds brush
and waste in the perimeter to keep it going. This is where everyone comes
to cook anything they can't cook elsewhere. It's rare you see anyone out
here cooking anything though, as food as very scarce and when anyone gets
good food they cook it however they can closer to their house so others
won't bother them."
long_desc
"You are standing in front of a fire pit of cinder blocks with a
makeshift grill composed of some metal grating and wire. There is no one
else here at the moment."
before
{
location MovePlayer
{
if cook_daemon is active
{
"Not while the carcass is cooking!"
return true
}
return false
}
}
}
room test_room "Test Room"
{
long_desc
"Just testing MovePlayer here."
w_to STARTLOCATION
}
daemon cook_daemon
{
timer 0
}
event cook_daemon
{
self.timer++
select self.timer
case 3
{
Indent(true)
"The meat is smelling really good and making your stomach
growl loudly."
move meat to firepit
meat is known
}
case 5
{
Indent(true)
"You smell burnt meat. There wasn't much of it to begin
with, so you discard the charred remains into the fire."
remove meat
event_flag = true
Deactivate(cook_daemon)
}
}
scenery firepit "firepit"
{
nouns "firepit" "grill" "fire" "pit"
in STARTLOCATION
is platform
is container
holding 0
capacity 2
article "the"
long_desc
"The fire blazes along. There's a makeshift grill in one corner of it
you can place things on to cook."
before
{
xobject DoPutIn
{
if object ~= carcass
"You have no desire to try to cook that."
else
{
"You place the meat on what looks like the cleanest part of the
grill."
Activate(cook_daemon)
return false
}
}
}
after
{
xobject DoPutIn ! since the only thing that works is the carcass
{
"\nYou hear a sizzling sound."
remove carcass
}
}
}
scenery cinderblock "cinderblock"
{
nouns "cinderblock" "block"
in STARTLOCATION
article "the"
long_desc
"The fire blazes along. There's a makeshift grill in one corner of it you
can place things on to cook."
}
I knew Roody would come to the rescue. Thank you man! I'll try this out soon. Your code makes sense, but I never would have figured out the known attribute thing by myself.
By the way, I believe the manual says you're not supposed to give an object both PLATFORM and CONTAINER attributes at the same time as they are conflicrting. I think for a grill you'd want only attribute platform.
"When I die, I want it easy and peaceful in my sleep, like my uncle.
Not screaming and crying like his passengers."
It's true that normally, if you want something to act as both a container and platform (like a standalone safe that you can also set things on), you'd want to use Kent Tessman's "supercontainer" addition as Hugo has no built-in support for keeping track of which objects are on the object and which are inside. In some cases, like this one, you might use both "container" and "platform" just to help with player commands (as it will accept both >PUT CARCASS IN PIT and >PUT CARCASS ON GRILL).
I meant to mention a few days ago I'm glad you handled attempting just walking away from the grill as well. Already moved onto adding status change per eating. Thanks again!