This article relates to the game "Counter-Strike: Condition Zero - Deleted Scenes". Click here for more information.

MAT file

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)

A MAT file is what Condition Zero Deleted Scenes Condition Zero Deleted Scenes uses for it's uniquely built particle system that is specific to the textures in the game. It covers everything that you might imagine a particle effect could do. For example, when a concrete wall is shot in game, one would expect that things like a bullet decal, gray smoke would be emitted, chips of concrete would fall out of the wall, Among other things such as the gravity, fade speed, color and what sprite the chips of concrete use. The .MAT format is highly customizable and very easy to work with once the terms and formatting are explained. But there are limits to what we can do in Condition Zero Deleted Scenes Condition Zero Deleted Scenes because of the mostly hardcoded nature of the game itself.

Can be used to make a cool particle effect when you shoot a wall in Condition Zero Deleted Scenes Condition Zero Deleted Scenes.

Tip.pngTip:Remember to use the 🖿czeror_addon directory when replacing vanilla files, so that it's easy to revert to vanilla files if something muffs up. (Unfortunately, since Condition Zero Deleted Scenes Condition Zero Deleted Scenes already uses Counter-Strike Counter-Strike as a fallback_dir, it isn't possible to use that as a workaround)
Icon-Important.pngImportant:On Windows Windows, if MAT files are associated with Wikipedia icon Microsoft Access, they will not have an "open in" option when right-clicking them in file explorer. If this happens, follow this tutorial on MatLab Central to change the file association for MAT files.

Limits

Limitations of the .MATs on Condition Zero Deleted Scenes Condition Zero Deleted Scenes.

Warning.pngWarning:Limit on material .MATs. You'd initially think that you could just make a new material (for example, Blood.mat) and chuck it in the 'default' directory and assign it to a texture in the level. Unfortunately, that's not possible. For some reason, the materials have a hard coded limit in the game. This means that you can only replace the .MATs in the 'default' directory. There is one single slot named 'custom' for a user defined .MAT though.
Warning.pngWarning:Unclear Properties. Now, this one is difficult to explain. None of the settings for the materials have explanations for their settings. So I don't fully know what some of the settings do. This is a result of there being a lack of documentation for the game.

File format

The file structure is important. There are two directories that .MATs should be. One for defining the .MATs for levels, and one for creating material .MATs to be used.

Directory for defining .MATs for a level:

Files in 🖿materials\ directory define the .MAT file for your levels, and can also be the area where a global czero.MAT is stored for loading when the game is started. The format for these is generally YOURMAPNAME.MAT, with the exception of the global czero.mat.

Directory for defining the material .MATs: Files in 🖿materials\defaults\ subdirectory define the materials used within the above mentioned directory. Basic materials such as dirt and grass are stored and referenced from here, as well as the prior mentioned 'custom' .MAT.

These two directories are linked in a way. So you should always place the correct file in the correct directory, otherwise they may not work as intended. The next section is going to explain how to create and link a texture a .MAT file.

Linking a texture to an effect

Lets say we have a brick texture. We need to assign the correct .MAT material for this texture. How do we do this? We need to create a .MAT file for our level first. We can copy one from the base game directory, rename it to whatever your custom map name is, and put it in the materials folder.

Next, open your new custom level .MAT using notepad, I am using notepad++ for this. Delete all it's contents and use this handy prefab.

texture "YOUR_TEXTURE_NAME"
[
	material
	{
		type "brick"
	}
]

If you used the above prefab, this would assign the "brick" base material that can be found in the "default" directory, to the texture name you put in. This means that, when the texture is hit, it will make the "brick" particle effect. You can choose other base materials out of that folder too. Play around with the different materials and see what suits the texture that you put in. Save your custom level .MAT file and fire up your map in game and test it out. If we want to define more materials, just copy the previous entry, change the texture name and the basic material and it should work.

Note.pngNote: It is important to note that we can hotload the material list after saving using the mat_reload command within the command console.

Files

[Todo]