Scope question

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
Ice Cream Jonsey
Posts: 30191
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Scope question

Post by Ice Cream Jonsey »

Does anyone recall the syntax of a test to determine if an object is currently in scope? For instance, I want the player to be able to access his phone if the phone is anywhere in the room. Something like

if phone.scope = true
then DoDesiredRoutine

or something like

if scope(phone)
then DoDesiredRoutine

... and the worst part is, I know I did this somewhere in Necrotic Drift, I just can't remember where. Heh. I think this is gonna be the thing I push off until morning, I'm all coded out tonight. ^______________________^[/quote]
the dark and gritty...Ice Cream Jonsey!

Worm
Posts: 3626
Joined: Sat Aug 24, 2002 12:53 am
Location: tucked away between the folds of your momma, safe

Post by Worm »

Didn't Duffy have a phone in his inventory to ask for doors to be opened and shit?
Good point Bobby!

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

Post by Roody_Yogurt »

Looking at the manual, it looks like you might want to use the in_scope property and maybe the PutInScope and RemoveFromScope routines.

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Post by Merk »

CheckReach(object) -- defined in hugolib.h. I think it prints messages if the object can't be reached or isn't in the current room, so it might not be ideal if you're just wanting to do a test and print nothing. But it's the only thing I'm aware of that can check and see if an object is in scope.

Then again, FindObject() might do what you want. It returns whether the object is in the room or not, or whether it's accessible even if it is.

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

Post by Ice Cream Jonsey »

Worm wrote:Didn't Duffy have a phone in his inventory to ask for doors to be opened and shit?
Yeah, though I think that was just a conduit to talk to Trott, who was elsewhere most of the game.
the dark and gritty...Ice Cream Jonsey!

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

Post by Ice Cream Jonsey »

Roody wrote:
Merk wrote:
Thanks guys - gonna go through and give those suggestions a shot right now.
the dark and gritty...Ice Cream Jonsey!

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

Post by Ice Cream Jonsey »

What happened to what I quoted?!?!
the dark and gritty...Ice Cream Jonsey!

Worm
Posts: 3626
Joined: Sat Aug 24, 2002 12:53 am
Location: tucked away between the folds of your momma, safe

Post by Worm »

Ice Cream Jonsey wrote:What happened to what I quoted?!?!
You should see if you can get Ogrish's phpBB template. It's the best one I've seen, and it is red and black.
Good point Bobby!

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

Post by Ice Cream Jonsey »

Worm wrote:
Ice Cream Jonsey wrote:What happened to what I quoted?!?!
You should see if you can get Ogrish's phpBB template. It's the best one I've seen, and it is red and black.
Ogrish, huh? Got a link?
the dark and gritty...Ice Cream Jonsey!

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

Post by Roody_Yogurt »

If this place takes ogrish's template, I totally will leave this place forever.

User avatar
pinback
Posts: 17926
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

I would like to see more execution videos here, though.
When you need my help because I'm ruining everything, don't look at me.

Lysander
Posts: 1693
Joined: Tue Jul 08, 2003 12:39 pm
Location: East Bay, California.

Post by Lysander »

Videos? Fuck you,
paidforbythegivedrewbetterblowjobsfundandthelibertyconventionforastupidfreeamerica

Post Reply