Search and Destroy Blueprint

This is a blueprint for the “Search and Destroy” game mode found in other shooter games.

Default rules:

This game has 2 teams: Attackers and Defenders. Either team can win by killing all players on the opposing team. (Classic elimination game.)

Attackers can also win by arming the bomb at one of the objectives and protecting it until the countdown ends. Only one bomb exists in the game in each round – any player on the attacking team can pick up the bomb and bring it to the objective. If they are killed while carrying the bomb, it will be respawned at the beginning (configurable, see below).

Defenders can win by disarming the bomb once it’s been armed. To disarm the bomb, any defender can simply interact with the bomb on the objective. This will end the round.

If the bomb is armed and there is less time remaining in the round than the countdown timer, additional time will be added to the round so that each team has a chance to win. If all of the Attackers are killed while the bomb is armed, the game will continue until the bomb explodes or the Defenders disarm it.

Config Options

(Note: I made this blueprint pretty quickly so it’s definitely not the best organized in terms of code. My apologies. I’ve listed all the relevant properties/entities/templates and where to find them below.)

The 2 core templates in this blueprint are the “Bomb” and the “Objective”.

The Bomb contains a “bombScript” with 2 important properties:

  • bombDisarmedMsg - A message to display to all players when the bomb is disarmed.
  • bombCollectedMsg - A message to display to the attacking team players when a player picks up the bomb.

Within the bombScript you’ll find an OnInteract function that checks the player’s team and does the appropriate things. If an attacker interacts with the bomb then they will pick it up. If a defender interacts with the bomb, and it is armed, they will disarm it.

The Objective contains an “objectiveScript” with 2 important properties:

  • bombArmedMsg - A message to display to all players when the bomb is armed.
  • countdownTime - The amount of time (in seconds) between arming the bomb and its round-ending explosion.

Within the objectiveScript you’ll find functions to arm the bomb (OnInteract), a function that controls the countdown timer, and the logic that ends the round when the countdown timer reaches zero.

Other things to know:

On the Player template there is a Health folder. That folder contains a healthScript with 2 relevant properties:

  • bombDroppedMsg - A message to display to the attacking team players when the player carrying the bomb is killed.
  • dropBombOnDeath - Boolean - If true, the bomb will be placed where the player carrying it died. Otherwise it will be respawned at its initial starting location.

On the gameController entity there is a gameScript with 1 important property:

  • teamWinScore - This is the number of points awarded to each team if they complete their objective (ie: destroying one of the objectives or disarming the bomb. This number should be larger than the number of players on either team to ensure completing the objective will make their team win.

On the gameController entity there is also an eliminationScript with 1 important property:

  • testMode - Boolean - If true, the game will not end when there is only one player remaining. This is so you can test the game. This MUST be set to false before publishing your game, otherwise the rounds will never end.

I think that’s about it. If you have questions, feel free to reach out to me (ekelrock) on the Crayta discord. If you update this blueprint and make it better, let me know on the discord so that I can delete my blueprint and yours can be the default.

1 Like