DAB: Interacting!


What To Do?

There are so many things to work on it's hard to pick what needs my attention first. It makes sense to just keep working through the player experience. Basically, anything I work on is good, so I just need to pick and go! Since I'm worried about mobile testing, I should just keep going with the dynamic action button. Let's dig in to what needs to be done next, in detail.

First, the dynamic action button doesn't even have a connection to anything yet. So let's begin there, adding a connection to the pressed signal in the HUD's ready function (as well as adding a placeholder function to call). Once that's added, I guess the next step is to figure out exactly what is going to happen here. Do I allow presses when they're not valid? Probably the easiest approach at first. That just means we gotta do our checks on each press. 

What do we check for? That's the important part. Luckily, I have a whole validation system written out in the player character I can copy and modify. But first, I need to update my player character to rename the variable that holds a reference to the active interactable. I also need to "get" my player character in the HUD, to reference it properly. So I guess the first thing to do is to see if my HUD can find the player character when it becomes ready.

Time for some help to get this right. I asked Gemini for some help, first to determine the best logic for finding the sole node that should reside in the 'player' group. Then I asked about best practices for a couple of things, I'm sure my code is a mess, but I'm really trying to keep things as clean as I can. Once that was done, I fed the code I built back in for validation and Gemini caught a couple of debug messages I missed updating. I copied the code directly from another function and forgot to make updates to denote the difference between where the messages were coming from.

Testing, Testing, One, Two, Three

Then came time to test it out. And nothing happened when I pressed the button. That was my fault though! It was actually working properly, nothing was supposed to happen because there wasn't anything nearby to interact with and I totally forgot to add a debug message for the button press. With a quick addition to the script I was able to see the button press, and then once there was actually an interactable in range it successfully interacted!

Wins On Wins On Wins

That's all for today though. It really doesn't feel like much, but it's a really big win in my eyes. I am one step closer to usability on mobile. It's not exactly pretty, but that's not what I'm working on right now.

Actually, scratch that, I'm not done yet! Well, actually now I am, but I wasn't a moment ago, because I kept working and decided to make another small change before calling it a day. I decided it was time to finally add some new variables to my inventory manager in preparations for the next session. Just a set of four new dictionaries, one for each quick action button. The intent is for each button to have a different item id available depending on the scene. So each key will represent the scene and the key will be the item id to reference. I made sure to leave myself a comment in the code so I don't forget my plans.

And now I call it a day. Thanks for sticking around, I do hope to hear from you someday. No rush though, take your time. Just feel free to reach out with any questions or suggestions.

Leave a comment

Log in with itch.io to leave a comment.