#6. Zombie City

12 messages · Page 1 of 1 (latest)

wanton lion
#

This is a hangout map with some game structure. It uses concepts very similar to the infected game, where survivors become zombies and switch teams on death. When everyone is infected, the game resets, and starts a new round. There are no winners/losers in a hangout, but you can still use rounds to give some structure. In this mode, there is a hunger mechanic where the survivors need to find food to stay alive, as they will constantly be taking damage over time. Also, friendly fire is on and any time a survivor dies, they will come back as a zombie. Possibly due to there being no more room in hell?
Key Concepts:

  • Timers
  • Scoreboards
  • End Round action
#

Most of this game is very similar to the Infected Example, so I am not going to detail every aspect of it, just the key differences. For variables, there are 3 individual variables for tracking statistics that we want to show on scoreboards, Zombie Kills, Survivor Kills, and Survival Time. There is one Global variable called Intensity. This is a number that is used in the hunger mechanic. Players will take Hunger damage every 'Intensity' seconds, so as that value goes down, the need for food increases.

#

For setup, we use Round Start, the same way we used Match Setup in the Infected Example. The difference between the 2 is Match Setup runs only once at the start of the match. Round Start will run before each round. Since this game is going to use rounds to reset the state, Round Start is appropriate here.

#

The other difference is that instead of selecting one player to become the boss zombie, we want some percentage of players to start as zombies. I've gone with 1/5 of the player base. I use the operator Divide(Ceil) because that will round up any fractional players.(Divide(floor) rounds down)

#

In a Kill Enemy event, I increment the zombie kills or survivor kills variable when appropriate. These have no impact on the game, but are just tracked for use on a scoreboard.

#

In the Infect event for this mode, we use the Player Dies trigger. This will happen any time a player is killed by any means, so we don't need a separate kill enemy and self KO event to trigger this.

#

To do a round reset, we wait for an Elimination Complete event with team 1 surviving, and then call End Round with -1 as the winner, since nobody really wins in this game mode.

#

Now for the timers and hunger mechanic. A timer is an event trigger type. You specify the frequency of your timer in the expression next to the trigger type. For the first one, every minute, we want to reduce the delay between hunger ticks by 5 seconds, down to a minimum of every 15 seconds.

#

In a second timer, we use the Intensity variable as the delay time, and damage all players on team 0. The timer expression is evaluated every loop, so as Intensity reduces, this timer will execute more frequently.

#

There is one more timer used to track survival time. Every second it adds 1 to all players on team 0 survival time variable

#

For the scoreboards, you can assign any number variables you define, as well as some built in ones. Here are the properties for the survival time scoreboard:

#

Also note that the survival time is set to Reset Each Round, as is the Intensity variable. This only matters in a round based game like this, but will reset the variable to the default value each round. Zombie/Survivor kills are set to not reset, so those scoreboards will be cumulative across rounds. The survivor time will show your single longest time you stayed alive as a survivor.