FindObjectOfType

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:smile: :sad: :eek: :shock: :cool: :-x :razz: :oops: :evil: :twisted: :wink: :idea: :arrow: :neutral: :mrgreen:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: FindObjectOfType

FindObjectOfType

by Roody_Yogurt » Sat Jan 14, 2012 1:58 pm

Future Boy! has some code attached to certain verbs, like >READ ABOUT <TOPIC>, where if you don't specify the book object, it looks around for the nearest object of type "book."

Now, honestly, I haven't added this to any of my own games yet, but there have been times when I've been playing other people's games where I do a lazy short command and am slightly annoyed that the game doesn't assume I mean the NPC I am talking to or whatever.

So, I think most of us would agree that Future Boy! went above-and-beyond in parser-helping, but I thought it'd be good for people to be aware of the feature anyway. I made a page for the specific routine it uses, FindObjectOfType here: http://hugo.gerynarsabode.org/index.php ... jectOfType

I made another version of it that uses attributes in case people want to check for the nearest-living-thing* (since NPCs can be type "character" or "female_character"):
http://hugo.gerynarsabode.org/index.php ... fAttribute

* It occurs to me that someone could just have code like the following:

Code: Select all

local a
a = higher&#40; FindObjectOfType&#40;character,location&#41;, FindObjectOfType&#40;female_character, location&#41; &#41;
if a
   ...
Still, I'll keep the attribute version up in case that is what somebody is looking for one day.

Top