04- Twin Capture

In this slightly more complicated example, I will explain the creation of a "Twin Capture" Objective, in which two players are needed to take a point. The is the most Kismet heavy of any objective. It is used for the Sluice in Dark Forest and the Trebuchet in Hillside. I will be working from the example map AOCTO-4-TwinCapture.

--

 

Actors and Properties

Assets needed.

AOCObjective_Generic Actor

2 AOCHUDMarkers

4 Agatha Banner Skeletal Meshes: SkeletalMesh'chv_flags.Meshes.wall_hanging.S_Banner_Agatha_4_wall_hanging'

4 Flag Pole Static Meshes

2 Static Mesh Base to indicate Capture Zones

4 AOC Trigger Volumes (2 Agatha, 2 Mason)

 

These Will be split across 2 Capture Points. As Seen below:

 

You can enable the cloth on the flags in the actor properties (F4). This is expensive. Use it sparingly. We will be switching the Flag mesh color within Kismet later.

Pre Game Kismet

Initial Game Logic will be the same as in past example. Setting round length, and setting the Toggle to off for Game Play relevant actors.

Round Start Kismet

This setup is the same as the prior example maps. Check out 01- Initial Setup for more detailed information. The only unique thing, is the enabling of HUD Markers and AOC Trigger Volumes.

Capture Point Kismet

This is going to be the most complicated Kismet I will get into. The premise of what is happening, is that the Left Capture Point Logic, and Right Capture Point Logic are both performing volume checks for players, and comparing the teams of the players to determine if the objective progresses. A Matinee is played, lowering the Agatha Flag, replacing it with a Mason Flag, then Raising it. When both flags are fully raised Mason Flags, the objective completes. There is some HUD logic at the bottom that I will detail as well. There is another "box" of Kismet containing test bots. 

 

I will start with only the Left Capture Point. The AOCTriggerVolume_0 Touch Event fires only the first time is touched. It then initiates a Delay which ultimately loops back into itself, effectively acting as a tick event that makes checks every .15 seconds. This check enters the Count AOCPawn Action. These actions are checking the AOC Trigger Volumes placed earlier. The Light Blue number is an Integer Value it is storing, which is the amount of each faction in the volume. These will be compared later. 

 

Zooming out will start to make sense of the volume checks. Count AOCPawn enters a Compare Int Condition. This is comparing the Agatha Players in the volume (A) to the Mason Players (B). If Agatha is Greater than or Equal to Mason, Reverse the Matinee, and set it's complete status value to 0. If there are less Agatha Players (A<B), The Matinee of the Agatha Flag lowering, then Mason Flag raising will be played. Upon Completion, the first of two points have been captured, and it's complete status will be set to (1.)  I will not go to far into Matinee here, as it is covered thoroughly in the UDN Documentation. 

http://udn.epicgames.com/Three/MatineeUserGuide.html

LeftFlagLowered and LeftFlagRevert are Matinee Event Tracks. Lowered changes the mesh to a Mason Flag, Revert changes it back to Agatha. Both use set Mesh to accomplish this.

Agatha: SkeletalMesh'chv_flags.Meshes.wall_hanging.S_Banner_Agatha_4_wall_hanging'

Mason: SkeletalMesh'chv_flags.Meshes.wall_hanging.S_Banner_Mason_4_wall_hanging'

 

The Right Capture Point is nearly identical:

Objective Complete Checks

Taking the Left and Right Capture Point Kismet, we will be comparing their complete status. Here is a zoomed out overview. The only new Kismet is the middle box. Every time a Matinee completes from either point, it will fire into the Multiply Int Action. Multiply Int is comparing the "complete status" Integers that we set before. It is multiply the Left Point by the Right Point. If a Point is complete, it's value is 1. If it is not complete, it is 0.

Left Point = A

Right Point = B

Complete = 1

Incomplete = 0

 

If A * B = 1 , Objective Complete. Compare Int is just take the result of the two being multiplied, and seeing if it is equal to 1. If it is, it goes out to the AOCObjective Complete Event, ending the round/objective. All Hud Markers and Trigger Volumes are then Toggled off.

Console Event Test Bots

These are very straight forward. You can spawn them to check if the team comparisons are working and to test if the volume can be captured by two people. This will spawn a bot on a playerstart or pathnode, using Unreal Console Command Events.

 

HUD Indication

Progress Bar Hud is one of the trickier things to setup in this example.

 

Your HUD Marker Properties need the options under TBSHUD. The most notable setting is f Max Value Progress. This should be the length of the Matinee it is tied to in Kismet. In this case, 30 seconds.

 

Open up Kismet, and add a Get Property Action. Set the Property Name to fCurrentProgressValue. Use the HUD Marker as the Target Variable. The AOCTriggerVolume Touch Event from before will activate Get Property as well.

 

Get Property outputs to a Delay. This Delay, on Finished, will feed back into it's Start Input, as well as into a Compare Float Condition. Effectively checking the referenced variables and updating the HUD at intervals equal to the Delay. In this case, an update will occur every second. Most of these checks, are just referencing whether or not the progress bar updates, and it might be best just to copy the Kismet for this into your level. The Compare Float will be output data comparing the current position of the Matinee to the Overall time needed to complete, (30) seconds. An Objective Complete is what the off screen links are coming from, and disables the bar.