Old work done, new work incoming!

by

in

Dev Log for Sep 2024, Week 40:

Dev Log:

Okay so my hit list, including carryover looks like this:

  • [x] Finish re-factoring TaskResolution.
  • [x] Correctly collect experience points.
  • [x] Get further in implementing items.
    I’m not doing anything more involved than note-taking or diagramming on other features until these are roughed in and functional. Let’s GO!

The Re-factor is in the Bag!

By which I mean it’s jank as fuck, but functional. Which is fine really, considering most of the parts that are screwy on it involve Experience, which is next up to bat. I’m not super thrilled about diving into some of the same scripts again, but this will all get me closer to items, which is my metaphorical finish line/starting point for combat, which I cannot wait for! I’m excited about items too truth be told, because that gets me one step closer to a “complete” character. I feel like that’s going to be a big milestone, since that means I can pivot to having that character interact with the world.

Experience

This ended up being way simpler than I thought, which is nice because it was pretty quick in the bag. This really ended up being doing what I had already done, just in two different tracks. Now that says nothing about the spending of experience, which shouldn’t be too complex, just wider in range. but that really just leaves items to deal with in terms of my immediate hit list. So back to it!

Itemizing

This was kind of a whirlwind for me. First, Godot had my back with the following functions:

_get_drag_data()
set_drag_preview()
_can_drop_data()
_drop_data()

These are built-ins that do the heavy lifting for moving things around control nodes. I learned about them in this tutorial:
Drag & Drop Inventory Using Resources In Under 25 minutes || Part 1 Godot 4.2 (youtube.com)
This was interesting because I haven’t referenced a tutorial in what feels like forever now. I learned something about myself that I think I always had an idea of:
My brain doesn’t like video tutorials.
That being said, this tutorial was very well done and got me through the biggest hurdle, which was moving items around. But man was I missing stuff all over the place. I thought I had a few bugs in the code, which at first I thought may have been on the tutorial, but ended up being me smooth-braining shit like not returning functions correctly. I think my problem is that with a written tutorial or documentation, I can scan the text better/faster than in a video, which is what exposed the issues.
I also found myself leaving knowledge I have on the table when I watch a tutorial. There were a few parts in the video where I was just baffled by something, only to realize a minute later I actually knew the information, I just connected the dots way later for some reason. Again, this is not on the video, it was great.
Anyways, I have the ground work for items in, but there is still a lot to do. I’m super excited to get going on it though. I’ll be messing with equipping next, as well as the ability to leave items on the world map, and converting scenarios into item drops when the scenario has been completed, but not all the items have been taken.

Closing Thoughts:

I went my whole life not knowing I could do this:

"%s\n%s" % [item_data.item_name, item_data.item_description]

which would’ve made my life way easier when I was building task resolution and the accompanying logs for it. I may go back and re-write that chunk at some point.
Oh, and I laid in the groundwork for the save system! This came about when I was writing the item implementation, and I couldn’t see the data updating to the CharacterRecord. I thought I was doing something wrong, but I’m assuming it was just in memory, waiting to be saved. In either case, that adventure just doubled down my initial thought of relying heavily on the Godot resource system. Saving those files is super easy, so I will be trying to implement everything I can into them going forward.
Okay I think that will wrap this one up. See you in the next one!