Creating a combat log in Blueprint

Consider the following setup:

  • we’ll need 2 widgets for this: 1 representing the log itself (wCombatLog) and 1 representing a line of text (wLogLine)
  • the *wLogLine *has a Text Block bound text variable (Log Line Text), it’s Instance Editable & Exposed on Spawn - so it shows up when the line widget is created, as seen below. It’s used to feed data to the wLogLine
  • the *wCombatLog *has a scroll box to which it adds *wLogLines *via a custom event:

When *wLogLines *is added, we Scroll to End in order to show the most recent entry - optional.

The player creates the *wCombatLog *and uses the reference to call the custom event inside it; here sending info about what we collided with and the keypresses. (you will surely have a plethora of events that may want to add to the log)

For something truly basic, formatting text might be enough. For something more involved, with fancy colours and icons, look into rich text.

vid:

https://i.gyazo.com/d95a0ebd5ef4173e…7d32a9ff70.mp4

1 Like