Two Cat Games


Perang: 3 Card Battle

Choose a class below to learn about

The Attack Buttons

Picture of the attack button in Unreal Engine

There is no Java equivalent for the Button blueprint as the Java edition is all text based and relied on the user typing in a command over a mouse click.

Event Begin Play

Event Begin Play events for Button blueprint.

This long list of nodes was the event begin play for the button before I broke it into pieces.

Shortened Event Begin Play.

This is better and still accomplishes the same task. It looks cleaner and is easier to read.

Set All Visibility Off

Set all Visibility Off custom event.

Sets the visibility for all meshes and effects to false. This keeps them from appearing instantly when they are spawned.

Set Materials

Set Materials custom event.

Creates the Dynamic Material Instances required then sets the active material to black. The instances will allow for the hover material changes.

Materialize and DeMaterialize Button

Materialize and DeMaterialize Button custom events.

These events do as they are named, materialize and dematerialize the buttons. A sound effect is played, followed by changing to a dynamic material instance which has a special scalar parameter to 'materialize' meshes. Once the mesh is fully visible, the material is set back to a standard color. This keeps the texture complexity down when the effect is not in use. Dematerialize does everything in reverse then destroys the actor.

Materialize VFX material provided by W3 Studios. All button sound effects provided by Sidearm Studios.

Throw Projectile

Throw Projectile Custom event.

A projectiles get thrown by the player and the AI. The player activates it by clicking on the button. The event starts by activating the sound effects and changing visibilities of the projectile meshes. The projectile and the fx flash have their locations set and a 'Move Component To' function is used to send the projectile across the board. It all ends with a custom end event.

Projectile Helper Events

Projectile helper events.

There are three helper events for the 'Throw Projectile' event. Two to play the sound and one to end the projectile at its final destination.

Change Material Events

Change Materials custom event.

The above events are simple events to set the material for the button and are used by the button's hover state machine.

Hover Events

On Begin Cursor Over and On End Cursor Over override events.

When hovering over the button with the mouse cursor, a sound gets played and an instance of the hover state machine is started. The state machine uses the 'Hovering?' boolean to move through the states. This is another example of events that do not necessarily require a state machine to function, but worked better in testing.

Click Event

On Click override event.

Clicking on the button plays a sound to start. In a future version, this sound will get moved to the state machine because it plays whether you click on your button or one of the AI's buttons. The same goes for the hover sound, it will get moved to the state machine. A dispatcher is called on click which is bound inside the level blueprint. Then the a very simple state machine is started to handle firing off the remaining events.

Choose a class below to learn about

Card Card Slot Deck Board State Machines
Project Outline Button Widgets Level Database