Hi, apart from Gruk’s answer to use “Add to” instead of “Set to” of the animation frame,
you still can’t use same key yet.
In old Resident Evil as you mentioned, first let’s think that the “checking items and places” is done though an “Action button” - you know it will examine objects, talk to people, use items, all using the same button.
It will also do only one thing when you press the button once, and will only do another thing once you let go of the button, and press it again (nothing else will happen if you do not release the button).
In GDevelop, we do this by using “Trigger Once” condition with your key press event.
However… Due to how GDevelop events work, that alone isn’t enough (from this wiki page):
So if you made an event with “Z key is pressed” with “Trigger Once” and put every thing that button should do (opening dialogue, closing dialogue, taking item …) as a sub-event, unless you put additional conditions to avoid conflicts, every sub-event will trigger (for example, a dialogue will open and close at the same time!).
One method of “additional conditions” you can try is checking if the key is not “being pressed”, then setting a variable that makes the sub-events not trigger.
I’ll just show my example in my RPG, of beginning a dialogue interaction:
To explain this, first it checks if a certain key is pressed (in this picture it’s C key - custom control), then it checks for a Controls.KTimer.Action1 variable, and the following events set the same variable to 1. In another event it will check if this variable is 0, so that events that conflict does not happen (I don’t want to close dialogue box after opening it).
Then, at bottom of all events, I check if this key is released:
First it checks if the variable is above 0, and then it checks if the key is NOT being pressed.
Whew, that was longer than it should be, but I’m not sure how to simplify the KTimer part. Hope it helps!
Also, I +1 Gruk’s suggestion to use Dialogue Tree - if your game has any kind of dialogue syste, it’s easier to use it in the end, although starting is really confusing. Feel free to check out the example project, or create a new topic if you’re stuck somewhere there!