Entropy Zero 2: How to Set up a Map with a Custom Character

This guide will show you how to set up a map where the player character is a Civil Protection officer / metrocop instead of a Combine elite like in the Entropy : Zero 2 campaign. Knowledge of Hammer is assumed.

 

About this guide

This guide will give information about how to set up a map with a custom character, in this case a Civil Protection officer similar to Bad Cop in Chapter Zero.

It is assumed that you already know how to make maps using Hammer editor and that you have Hammer configured for Entropy : Zero 2.

Requirements
  • Hammer configured to map for Entropy : Zero 2
  • Knowledge of how to make maps with Hammer
  • GCFScape (or another tool which can open VPK files)

Custom weapon viewmodels

As a feature of Mapbase, weapon scripts can be overwritten on a map by map basis. You can use weapon script overrides to replace the viewmodels used by a weapon.

Example

Navigate to Steam/steamapps/common/EntropyZero2/entropyzero2/maps. This is where all the maps installed with the game are stored.

In the maps folder, you should see some text files related to particular maps. For an example, look at ez2_c0_1_weapon_pistol.txt.

ez2_c0_1_weapon_pistol.txt is a copy of weapon_pistol.txt from Entropy : Zero 2’s “scripts”. (You can find all the scripts within EZ2’s vpk files) However, it has this line:

"viewmodel"			"models/weapons/madcop/v_pistol.mdl"

This tells weapon_pistol use “models/weapons/madcop/v_pistol.mdl” as its view model. This is a viewmodel that was made particularly to represent Bad Cop in Chapter Zero.

Step 1: Locate the weapon script you want to override

For our example, let’s say you want to update the 357 to use metropolice arms.

Make sure you are using the latest version of EZ2 (not opted into any betas)

Navigate to Steam/steamapps/common/EntropyZero2/entropyzero2/ez2. Open up ez2_dir.vpk with GCFScape or another VPK tool.

Look in the “scripts” folder within the VPK. Locate weapon_357.txt. This is the weapon script for the 357.

Extract this file.

Step 2: Create a weapon script override for your map

Take the copy of weapon_357.txt from the previous step. Place it in your “maps” folder, adjacent to the map you are working on. Rename the file to <your_mapname>_weapon_357.txt.

WARNING! The file name must match the name of your map without the extension exactly, otherwise it will not apply.

Step 3: Update your viewmodel

Open up <your_mapname>_weapon_357.txt. Find the line for “viewmodel”.

"viewmodel"			"models/weapons/ez2/v_357.mdl"

Update this line to reference your viewmodel. In our case, we want the EZ1 as opposed to EZ2 version.

"viewmodel"			"models/weapons/ez1/v_357.mdl"
Save the file. You now have a weapon override that will make your weapon 357 in your map into a Metrocop version.

Custom weapon viewmodels conclusion

If you are shipping a workshop addon, be sure to include your weapon script overrides in the maps folder adjacent to your map file. You can repeat this for all of the weapons. If your addon has multiple maps, you will need to make a copy for each map.

Custom player character voice

About player responses

Bad Cop’s voice is controlled by the same response system as NPCs. You can read more information about the response system on the VDC.
https://developer.valvesoftware.com/wiki/Response_System

In particular, there is a response context which tells the game that the speaking entity is the player. This context is called “classname” and normally corresponds to the entity classname of a speaking entity.

Mapbase allows you to override this context within a map, which can be used to swap the voice of any character.

Changing the player’s voice in-game using the developer console
  1. Open the developer console.
  2. Enter the following command:
    ent_fire !player AddContext "classname:npc_metropolice"
  3. Test out different voicelines by entering combat. You should no longer hear Bad Cop’s voice, but instead a metrocop’s.
Changing the player’s voice in Hammer

Create a logic_auto entity. From the ouptut “OnMapSpawn”, trigger the input “AddContext” on “!player”. Set the parameter to classname:npc_metropolice.

Custom player character voice conclusion

You can use this technique to swap the player’s voice to any existing NPC that uses responses. Some NPCs will not have compatible response rules with the players’ responses.

If you want the player to be silent altogether, you can just assign a classname that has no responses. For example “classname:none”.

You can also use this technique to create entirely custom voices, but that falls outside of the scope of this guide.

Changing max armor back to 100

About max armor

The maximum armor the player can have in EZ2 is controlled by a ConVar. These are variables you can set in the developer console or in configuration files.

The value for maximum armor is:

sk_suit_maxarmor
About game_convar_mod

Entropy : Zero 2 is based on Mapbase. Mapbase adds an entity called game_convar_mod which can be used to change ConVars from within a map.

Mapbase entity list: https://github.com/mapbase-source/source-sdk-2013/wiki/Entity-List

Changing max armor in Hammer

Create a game_convar_mod anywhere in your map. Cal it “<mapname>_mod” or whatever name you think is appropriate.

In the “ConVars” key in entity properties, assign the value to this:

sk_suit_maxarmor 100

Create a logic_auto entity. From the output “OnMapSpawn”, trigger the input “Activate” on the entity “<mapname>_mod”.

WARNING – You may only have one game_convar_mod active at a time! If you need to modify more than one convar, please add the extra convars to the ConVar field separated by semicolons.

Example:

sk_suit_maxarmor 100; some_other_convar 1

 

Changing NVG color

About NVG color

The NVG color is applied using Source’s color correction system. We have a separate color correction file for the red NVG. When you turn on NVG, this color correction is applied.

The filename to look in for NVG is actually stored in another convar. Please see the previous step in this guide for information about convars.

The ConVar that stores the name of the NVG color correction file is:

sv_flashlight_cc_filename
Changing color correction in Hammer

Per the previous step in the guide, create a game_convar_mod anywhere in your map. Cal it “<mapname>_mod” or whatever name you think is appropriate.

In the “ConVars” key in entity properties, assign the value to this:

sv_flashlight_cc_filename ez2_overworld_simple.raw

ez2_overworld_simple.raw is a color correction filter that happens to have a nice Cyan blue color that lines up well with the metrocop vision. It is used for metrocop NVG in Chapter Zero.

Create a logic_auto entity. From the output “OnMapSpawn”, trigger the input “Activate” on the entity “<mapname>_mod”.

WARNING – You may only have one game_convar_mod active at a time! If you need to modify more than one convar, please add the extra convars to the ConVar field separated by semicolons.

Example:

sk_suit_maxarmor 100; sv_flashlight_cc_filename ez2_overworld_simple.raw

 

Change the player character’s kick model

About the kick

Kicking uses a separate viewmodel that is distinct from the weapon / hands model. Normally it is stored in models/weapons/ez2/v_kick.mdl.

You can change the kick viewmodel by firing an output to a logic_playerproxy entity. You can read more about logic_playerproxy on the VDC.
https://developer.valvesoftware.com/wiki/Logic_playerproxy

Assigning a new kick viewmodel in Hammer

Create a logic_playerproxy entity. Name the entity “playerproxy” or some other name.

Create a logic_auto entity. From the output “OnMapSpawn”, trigger the input “SetLegModel” on the entity “playerproxy”. Give the input a parameter of models/weapons/ez1/v_kick_police.mdl.


Thanks to 1upD for his excellent guide, all credit to his effort. if this guide helps you, please support and rate it via Steam Community. enjoy the game.

About Robins Chew

I'm Robins, who love to play the mobile games from Google Play, I will share the gift codes in this website, if you also love mobile games, come play with me. Besides, I will also play some video games relresed from Steam.

Leave a Comment