Author Topic: How to use Qualifying Adjectives with the parser?  (Read 35028 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

Re: How to use Qualifying Adjectives with the parser?
« Reply #15 on: August 18, 2010, 11:50:51 PM »
Thank you! I will test this!
Brass Lantern Prop Competition

Offline MusicallyInspired

Re: How to use Qualifying Adjectives with the parser?
« Reply #16 on: August 19, 2010, 10:44:59 AM »
Didn't work for me. Even though I had take/key<gold and take/key<silver after take/key it still decided to ignore both of them and gave me the take/key description.
Brass Lantern Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #17 on: August 19, 2010, 11:19:04 AM »
Huh.  Did you run this on a brand new template game? Maybe if 'gold' and 'silver' are not described as *only* qualifying adjectives in your vocab it might not work?  Oh I should have mentioned that I put my 'take/key' logic after the 'take/key<gold' and 'take/key<silver'.  I'll try it again when I get home (I was pretty tired late last night) - maybe if it still isn't working for you I could just upload the game to this thread and you could give it a go.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: How to use Qualifying Adjectives with the parser?
« Reply #18 on: August 19, 2010, 12:23:52 PM »
Oh I should have mentioned that I put my 'take/key' logic after the 'take/key<gold' and 'take/key<silver'.

Ah! That did it! :) Thanks for figuring this out. Why this stuff isn't properly documented I'll never know....this should go in the How To tutorial thread.

Unfortunately, I can't figure out how to use this for stuff like "basket of goodies". I can make it work with "take goodies basket" in-game but "take basket of goodies" isn't recognized....I thought the parser was smart enough to figure this stuff out.
Brass Lantern Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #19 on: August 19, 2010, 12:38:48 PM »
Right, I was concerned about the 'basket of goodies' as well.  That's why I tackled the keys first.  I'll give it a shot, but I think part of the problem is that 'basket' and 'goodies' are both nouns.  What about some permutation of this (total shot in the dark - untested)
Code: [Select]
(if(Said('take/basket<(of goodies)'))
   Print ("ah, the goodies!")
)
Maybe the grouping using the parenthesis might help in this case?  Or could you make the 'basket' and 'goodies' synonyms so they would collapse to a single noun?
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: How to use Qualifying Adjectives with the parser?
« Reply #20 on: August 19, 2010, 12:49:44 PM »
Then you'd basically be saying "take basket basket" in-game which would return an error. And, in your example, words in brackets are just a collected series of "ORs". It doesn't acknowledge both of them at the same time. At any rate, I tried it and it fails.

I just wish Brian would have documented the parser a lot more than he did. He basically through a simple tutorial together and expected everyone else to understand it. In fact, he had that attitude for almost everything script related. Not everyone's a natural programmer...maybe that's why SCI Studio never really garnered much attention.

As a side note, it's nice to have active members tackling problems again. Feels like 3 years ago again :).
« Last Edit: August 19, 2010, 12:52:47 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #21 on: August 19, 2010, 10:24:53 PM »
I've tried a few other things and I'm stumped.  I actually started researching English parts of speech to better understand what we are up against.  Here is what I found:

'Basket of goodies' - the word basket is actually a 'collective noun', whereas 'goodies' is the noun (plural of course), and 'of' is a 'containing preposition'.  Lesson over.

My take on it is that the failure is in the parser building a correct parse tree or the Said() function properly interpreting it (covered my bases there).  I'd bet that the whole mess just doesn't support the collective nouns.  I think it's just not handled in the SCI spec, rather than it being a failure of Brian to properly implement the parser/Said() function within Companion/Studio.

My only idea is to scour other SCI games to see if they have anything with the same/similar sentence structure that is handled properly.  Then at least we would know if this is even possible - maybe contact the author for some insight (if they can be found).

The good news is that you can actually type 'take basket of goodies' into the user input box & it *does* parse successfully.  I guess there might be the outside possibility that we could override the Said() function and handle it ourselves (that might take a bit of doing).
« Last Edit: August 19, 2010, 10:33:09 PM by gumby »
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: How to use Qualifying Adjectives with the parser?
« Reply #22 on: August 20, 2010, 11:12:02 AM »
Why is the word 'of' in the vocab then? It also seems silly that (once again) the SCI engine is incapable of something AGI did with ease.

Also, In King's Quest I SCI you can type "get four leaf clover" and it will work. There's no prepositions, but it's there. I'll look for other examples as well.
Brass Lantern Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #23 on: August 21, 2010, 03:37:01 PM »
Hey, anybody have a copy of Space Quest 3 handy?  I had an idea to test:  Does the parser work with 'take orat on a stick' or 'eat orat on a stick' (or even more complex sentences, possibly involving an additional noun)?  This seems pretty darn close to our test case.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: How to use Qualifying Adjectives with the parser?
« Reply #24 on: August 21, 2010, 11:10:42 PM »
you can't "take" it but you do "buy" it from Fester's store. And on a recent playthrough test for ScummVM I did indeed type "buy orat on a stick" and it worked.
Brass Lantern Prop Competition

Offline Cloudee1

Re: How to use Qualifying Adjectives with the parser?
« Reply #25 on: August 22, 2010, 02:56:12 AM »
It might also be useful to check out the times Sierra's parser gave them trouble too. Those few times when "the" had to be used to make the sentence work. Maybe your basket of goodies fits under the same situation. I'm not sure though since I can't think of one of those times.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #26 on: August 22, 2010, 08:47:35 AM »
Okay, I've starting coding to fix this problem.  Here is my process and thoughts behind it:

1.  Intercept the user input text event (I've found where this is in the User.sc script)
2.  Go through the string input, looking for our problematic phrase (basket of goodies) - I hope the string kernel functions will play nice...
3.  Replace our phrase with a simpler noun (replace 'basket of goodies' with 'basketofgoodies' or something like it - it will have to be in our vocab file)
4.  Throw a new user input text event with our crafted string (I have an inkling of a clue here, please if anyone has done something similar to this before, chime in).

So instead of making the parser do what we want, I'm thinking of boiling down the inputted text to something the parser can deal with, so we can have a Said() string like this:
Code: [Select]
(if(Said('take/basketofgoodies'))
   Print('Finally!  You've taken the basket of goodies!')
)
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: How to use Qualifying Adjectives with the parser?
« Reply #27 on: August 22, 2010, 03:26:29 PM »
3.  Replace our phrase with a simpler noun (replace 'basket of goodies' with 'basketofgoodies' or something like it - it will have to be in our vocab file)
This is what I was thinking about when I asked if a variable could be declared from a string of more than one word.
KQII Remake Pic

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #28 on: August 22, 2010, 03:34:13 PM »
Gotcha.  So right, we will need a pair of variables for each phrase we want to intercept & handle specially:  one string to represent the phrase that the user inputs and a second string to what it maps to.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #29 on: August 26, 2010, 09:03:17 AM »
Progress report:  I've got everything working with the exception of the procedure that actually performs the find and replace.  I've trapped the event, parsed the input, modified the input and re-fired the event.  This will absolutely work, but I need the create the last piece;  It looks as if must play with the string kernel functions - these are maddeningly under-documented.  The only source of documentation is the SCI Studio html docs and anything I can gleam from forums.

I did some searching here & on the Mega-Tokyo forum looking for anyone who had already created a find-and-replace string function, but it was slim pickings.  I'll ask the question anyway:  Has anyone run into or developed on their own string function/procedure?  Does anyone have any related string manipulation code to share?
« Last Edit: August 26, 2010, 09:31:49 AM by gumby »
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.033 seconds with 23 queries.