SOLVED: StrFind: When a Word is Found Once, It's Found Forever

EDIT: Solved, I think. I figured it out after going through the process typing this all out.

Hey All!

I’m using StrFnd to search player text input to look for specific words. However, it seems if the word is found once ever, it’s “found” always from that point onward, no matter what is typed.

For example, in my text adventure game, if the player types something unrecognizable, the system replies “I don’t understand.” If the player types “Use blah blah”, it replies “You can’t use that.” But then, if the player types something unrecognizable once again, the system replies “You can’t use that.”, even though my condition Compare two numbers: StrFind(PlayerCommand.Text(), “use”) is not met.

I’ve made sure that my *PlayerCommand.Text" is cleared when new text is typed, but it doesn’t make a difference. It seems like all it takes is the condition to be met once, and then it is met forever. I’ve even tried creating a *TextToParse" variable string and installed the extension “ExtendedVariables” to delete the variable from memory and no luck (in the screenshots).

What am I doing wrong?

Notes:
I have a lot going on with the text input itself. I created events to mimic “select all”, as well as “backspace held”, and to make sure my parser string doesn’t register control/return presses. I have the parser set up so that global commands like “use” are an external event, whereas scene-specific objects are only within the scene itself.

From my external events for global text input:

From my external events for global text parsing:

From my external events for global system reply:

Lastly, from my scene parsing:

A GIF of what is happening. The second time gibberish is typed, the reply “You can’t use that” is still given, even though the conditions to trigger it should be false:
Example1

Example, continued: “Use toilet” is entered; first system reply is accurate. Gibberish is entered after and the reply for “use toilet” is given, even though the conditions to trigger it should be false:
Example2

Thank you all for your help!

Edit: I’m a dummy

Okay, so I was about to post some additional screenshots to show where my variables are reset, and upon investigating, I found out they were being reset at the wrong location. I moved them to be reset when the return key is released, and now things seem to be working appropriately!

2 Likes