Less Work: More Prep


Too Much Work

I don't know that I'm actually going to do anything today. I spent the morning (well, most of the day) at the mall today. I had to go for my final visa renewal for this trip (it's weird to me that there's an office tower full of government office connected to a mall). While there, my partner and I met up with her friend and we had lunch and did a little shopping. Nothing big, but it was very time consuming. Didn't get home until like 3pm at which time I had to start work on my day job. This is all after I spent the night tossing and turning last night for no reason. So now, I sit down here to work on Xenodochium at 7pm, it's dark outside and I'm tired and just don't feel like it.

But I must persist. I must do something, even if it's just a little prep work for when I'm ready to make changes. And that's just what I'm going to do. Since I'm refactoring my interactable, I know that a piece of the interactable relates to my player character, so I need to look into that. Oh, nevermind, it seems that my player character doesn't actually do anything except validate the LOS on interaction and inform the interactable it's been targeted. I know there's gotta be another system that touches my interactables, I just need to find it.

I thought maybe the game manager as part of its unhandled event, but not seeing it in there. Nope, it is the player character that deals with the actual input. Okay, I guess I'm wrong, I don't have any other systems that need to be addressed when it comes to the actual functional state of an interactable. Okay, so the player character literally calls the interact function on the interactable. That's not very safe, I should probably add a has_method check in there as a precaution. Okay, just a quick change to an existing condition. Now instead of just verifying the active interactable isn't null, it also make sure it has the necessary method.

So the actual interactable doesn't do any checks on interact. All of the checks are done long before that's even possible based on the object's InteractableState (which is different from the operational state I'm implementing). Wow, this is getting complex, maybe more than it should be. Oh well, it's my burden to bear. So, I have a method, _determine_and_set_state that determines the appropriate InteractableStatebased on the normal criteria. I'll need to update that to ask the operational state's can_interact method.

Next Time

So, I actually did something, I added a quick safety check to my player character. But next time, when I'm ready to actually work on the game, the changes should actually be pretty simple. I need to update the method that sets the interactable state to check the operational state. And I need to update the interact method to point to the operational  state for it's actual action. Oh, and I need to deal with resetting interaction limits. That's not too bad actually, this really shouldn't be too hard to do when I finally do it. Of course, I think tomorrow is going to be a wash, we're supposed to travel bit to check out a resort for my next trip in April.

Leave a comment

Log in with itch.io to leave a comment.