Hey there techies.
Maybe this is a basic question, but I'm trying to script a text parser and I'd like to have an easy way to check for generic nouns and verbs in sentences that have no written response, without writing out each individual response.
Note that this the answer isn't simply anyword" or "rol" as I'm not asking about generalizing whole words, but more of contextual check.
In simple terms, I want the player to be able to type "look house." If there is a response in callroomscript, then I want that response to play. If not, I want a generic response such as "There is no house here."
Right now, the only way I can see this working is by putting all my parser text in the global script with if statements such as:
However, this seems exceedingly awkward and bulky. Surely there is a way to check whether a whole class of words have come up with a callroomscript response and then respond based on this?
What I would like to do, ultimately, in bad psedocode:
Code: ags
That way, every time you looked at anything in the game that was in the dictionary and didn't have an in-room response, you would get a generalized "that isn't here" type message.
Is this possible? Is it something simple I missed?
Please treat me like a noob on this, since the last version of AGS I used had graphical scripts in it. I'm an oldbie newbie.
Maybe this is a basic question, but I'm trying to script a text parser and I'd like to have an easy way to check for generic nouns and verbs in sentences that have no written response, without writing out each individual response.
Note that this the answer isn't simply anyword" or "rol" as I'm not asking about generalizing whole words, but more of contextual check.
In simple terms, I want the player to be able to type "look house." If there is a response in callroomscript, then I want that response to play. If not, I want a generic response such as "There is no house here."
Right now, the only way I can see this working is by putting all my parser text in the global script with if statements such as:
QuoteCode: ags if (cChar1.room == 1) { Display ("Okay, you're standing in the house."); } else if (cChar1.room == 2) { Display ("The house looks enormous."); } else { Display ("There is no house here."); }
However, this seems exceedingly awkward and bulky. Surely there is a way to check whether a whole class of words have come up with a callroomscript response and then respond based on this?
What I would like to do, ultimately, in bad psedocode:
if (Parser.Said ("look %s", thinglooked)) {
if ((Parser.FindWordId != -1) && (calllroomscript was null)) {
Display ("There is no '%s' here", thinglooked);
}
}
That way, every time you looked at anything in the game that was in the dictionary and didn't have an in-room response, you would get a generalized "that isn't here" type message.
Is this possible? Is it something simple I missed?
Please treat me like a noob on this, since the last version of AGS I used had graphical scripts in it. I'm an oldbie newbie.