top of page
Search

Cowzy Friday: Toolbar UI & Villager Builidng

  • Writer: Wesley Chartrand
    Wesley Chartrand
  • Mar 7
  • 1 min read

Welcome back to another Cowzy Friday update! 🐄🐄

This week I'll be discussing:

  • Toolbar UI updates

  • More Interface implementation

  • Getting villagers building


Toolbar activation


When players press the associated button, the icon on the toolbar now activates!


We got this working by:

  • Added the select/deselect options to our toolbar struct and then implement those in the datatable.

  • Created functions to select and deselect buttons.

    • Deselect buttons loops through all buttons and sets all to the Icon texture

    • Select buttons uses an input enum and selects our specific buttons


Getting Townsfolk working

The house may or may not eat the Townsfolk. This is supposed to cozy, not horror!!!

Our second major accomplishment was implementing our jobs as an Interface and using that to implement our work logic and townsfolk can actually build their buildings!! Let's dig into this.

  • As mentioned, we now have a IJob interface. Currently it has one function called ExecuteJob

  • Our current jobs are Building, Mining, and Lumberjack

  • Our Job Datatable has a IJob class

  • Our Townsfolk BP have a IJob variable

  • When we assigned a job to a villager, we create a Job object and then assign it to the variable.

    • NOTE: Because the created Job is an object, this means Unreal's garbage collection will clean it up when the Job object is no longer referenced!!


The 'right click' workflow for a villager
The 'right click' workflow for a villager

What's next!?

Next week I'll be focusing more on fleshing out the building logic and perhaps making it so the house doesn't eat the villager! 🐄🐄


Thanks for reading and hope to catch you next week!!

 
 
 

Comentários


bottom of page