Scope question
Moderators: Ice Cream Jonsey, joltcountry
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Scope question
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]
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!
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
-
- Posts: 192
- Joined: Mon Nov 22, 2004 3:19 pm
- Location: Wichita, KS
- Contact:
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.
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.
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
- Ice Cream Jonsey
- Posts: 30191
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
- pinback
- Posts: 17926
- Joined: Sat Apr 27, 2002 3:00 pm
- Contact: