fixing bug and adding new features



Fixing Bugs and Adding New Features
Introduction:
For this dev log, I’ve fixed two errors that were preventing the game from compiling—one caused by the Combat Manager script and the other by an animation issue. I also added two new scripts that introduce fresh mechanics to the game: the Interactables script and the Enemy Spawner script.

Errors
The Combat Manager script error happened when I transferred the turn-based combat scripts from a test project. This included the combat script (which controls the turn system and interacts with the Stats script attached to both player and enemies) and the target button script (which handles the combat UI). The problem was that I missed some pieces of code when I rewrote the script to fit the rest of the game’s systems. The fix was simple—I just added back the missing code. I haven’t tested it fully with the rest of the game yet since the full game loop isn’t in place.

The animation error came from me accidentally adding an unnamed event to the “Running Left 1” animation. I didn’t realize I had created the event, and since it had no function linked to it, it threw an error. To fix it, I just removed the event. That said, this mistake actually introduced me to animation events, which I’ll be using later to sync animations with actions like watering and harvesting.

Features
The Interactables script introduces a new system that allows the player to interact with the tile map and objects in the world using different actions. Right now, the only implemented action is placing farmland through the hoeing mechanic, which tills the ground. I’m using number keys to trigger actions—for example, pressing 1 activates the hoeing action. Other planned actions include watering, harvesting, and destroying objects. These will all be linked to animations using either events (like I mentioned earlier) or possibly through script—it’s still undecided. below are to images has still can't create gifs to show placing of the farm land:


in this image you can see were the highlighted tile which were the till will spawn the farmland (this is visible to the player)


has you can see the tile has been placed exactly were the highlighted tile is when I pressed "1".

The Enemy Spawner script adds a mechanic for spawning enemies each night in a semi-random way that gets more difficult as more days pass. It uses 8 empty Game Objects as possible spawn points. Based on how many days have passed (which I can fetch from the player’s stats script), a certain number of those spawn points will activate. This system currently caps out at day 8/night 9, but if I keep working on the game after the deadline, I might add more enemy types and extend the progression.

Notes
The next dev log will focus on finishing the action mechanics and adding the related animations. I’ll also be working on plant growth logic—making plants progress through growth stages and either be harvested or die if not collected in time. Once that’s done, my focus will shift to linking day and night cycles, adding the store, and finishing up the combat system.

Leave a comment

Log in with itch.io to leave a comment.