text parser - global vs. room

Started by rich, Wed 17/11/2004 08:16:30

Previous topic - Next topic

rich

I've been messing with the text parser for a couple months now and I've noticed a fundamental difficulty with it concerning global vs. room parsing.
The way it would seem to be set up now (look at the text parser section of the AGS manuel), is that in the global script, you parse there first, and then if nothing works, then you parse the room script with a call by callroomscript. So, if you want a generic response that works in every scene you put it in the global script. (i.e. said("look at _inventory object_). If you want a scene specific thing, put it in the room script. This is all well and good, but there is a fundamental problem I'm noticing. There are times that you usually want a generic response, but not if you're in a certain scene. Then you want a specific response. The only way to achieve this by first parsing in the specific scene, and then if that fails... then parse in the global. But the basic philosophy that's been set up in AGS is the other way around... parse global... then room. Or so it would seem. Do have this right? Has anyone found a way to parse rooms first then global? Is my point even clear?

Thanks, and any response would be welcome.
I'm so excited!

Rui 'Trovatore' Pires

Yes, there's a way! Make a function called NoMatch, and put all your generic "failed attempts" there. ANd then call that function right after the end of the room script. If I read you right.

I have a template up for Crits at the Crits forum, but here's the link, and you'll see how I did it. And in the meantime, why not writ it yourself! ;)

http://12.22.230.41/MicroTech/Hosted/Game/AGIsq2TEMP.zip
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

rich

Indeed, redruM. Actually, this is a little embarressing, but I don't know how to load your template into AGS. I tried and have failed. However, I really appreciate your response and I think I understand what you're getting at. I see from the last several posts that you've made that we have a lot of similar ideas about the text parser. I'm glad to see that I'm not the only one who still appreciates it and wants to use it. I'm getting stuff together to start my first AGS game and I want to make sure I can do the text parser the way I want. I'm so used to how it worked in AGI and I want to at least simulate that. I think your template will be very useful as a learning tool.

Thanks, Rich.
I'm so excited!

Rui 'Trovatore' Pires

#3
Well... <embarassed> it may have to do with the fact that I used the latest, EXPERIMENTAL 2.63 beta 1 build... because of that pesky 1-letter bug, you know... so you may need that one, too. Sorry.

(Funfact - you'll see manhy words in the vocabulary with an underscore, like "pick_up" or "space_suit",... these are placeholders, to be replaced when AGS supports "pick up" and "space suit". ;) )

EDIT - Try and download again. It seems there was a very weird and unexplainable issue that didn't make the template loadable... but it should be fine now. Same link-.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

Quote from: Rui "Puss in Boots" Pires on Wed 17/11/2004 09:41:42
(Funfact - you'll see manhy words in the vocabulary with an underscore, like "pick_up" or "space_suit",... these are placeholders, to be replaced when AGS supports "pick up" and "space suit". ;) )

I'd be interested in any feedback on this now that it's supported in the latest betas; as to whether it works the way you want or not.

Rui 'Trovatore' Pires

#5
IT'S IN?! Sweetness! I'll be testing it!

EDIT - Is it? Changing "check_out" to "check out" changed it to "checkout", same as always... this with beta 9...
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

Ah oops, I forgot that bit.

If you add a new word, it'll allow you to put a space in it; I'll fix the changing-a-word bit for the next beta.

Rui 'Trovatore' Pires

#7
:P Heh. Can't have everything, I'm afraid.

I'll wait for the next to test it, then. After all, it's not as thogh the feautre is complete, if you can't edit, right?

EDIT - I couldn't wait, so I deleted and re-added a word. Congrats, CJ, it works beautiful! At least with verbs. I'll now test with nouns, but expect no trouble, and will only edit this if there IS trouble. Thank you VERY much, CJ! That was the final thing I need, and I'll soon release my AGI template.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SMF spam blocked by CleanTalk