top of page
Search

Etheri Dev Log #6: Learning about gameplay tags, lambda functions and creating a cool ghost globe effect.

Not only do gameplay tags provide great value in terms of organisation and structure for your project. The GAS system in unreal provides additional functionality for your project through the use of gameplay tags. For example you can block abilities with certain tags, you can make certain tags a requirement to apply a gameplay effect and you can grant gameplay tags through the use gameplay effect application.

You can create your gameplay tags manually in the project settings or through the use of data tables. You can have parent tags and child tags the same way class hierarchy works.


A bool function called MatchesTag is useful for querying through your gameplay tags to find one that you need for a section of code. It filters through the tags from top to bottom so it checks the parent tag first and checks the child tags. There's also a matches tag exact function, which means if you're filtering for an example tag of Messages.Potions you have to pass in Messages.Potions into the parameters in order for the function tag to return true. Matches Tag will also just return true with Messages.


I also learnt about lambda functions when refactoring my callback functions. They're useful for functions that are only being called in one place. You don't have to name them and their definition also acts as they're declaration. They are structed with [](){}. The () brackets act as the input parameters like any other function, the curly brackets{} act as the body where the code goes like normal. However a lambda function does not have access to any member objects outside of the body. So anything declared in the header file is not accessible to the lambda function that's what the square brackets are for it captures any information/objects you put inside it. In my circumstances that's why I include "this" which refers to the class the lambda is in.


Lambda function
Lambda function

Ghost Globe effect

The video shows cool visual effect that I added to the health and mana bars. I recently picked up Monster Hunter and in that game they have a red squiggly line effect whenever the player is about to receive damage. My effect isn't like that but having those sort effects in your game help differentiate it from a 24 hour game jam on itch, to a game that someone has clearly put a lot of effort into.



Part 1 of the functionality behind the effect
Part 1 of the functionality behind the effect

Part 2 of the functionality behind the effect
Part 2 of the functionality behind the effect

So part 1 is how I'm getting the effect to occur I'm interpolating the ghost progress bar to the main progress bar that's bound to the health and mana attribute. Since you can only call the delay function in the event graph I made a custom event called globe percent set to add the delay which gives the ghost progress bar that trail effect behind the red one and to also set the target for the interp function.


The percent is being passed in from set progress bar in part 2 as it calls this custom event in the state where the progress bar has been initialised which is always except on load. When I set both progress bars and the target for interpolation manually.

 
 
 

Comments


bottom of page