Mapping/Model Replacement Guide

From Sven Co-op
Jump to navigation Jump to search

1 What is Model Replacement?

Model replacements allows you to replace a model with something else on a global basis. This is useful for well themed maps to easily use alternative models for weapons, without having to define the model for each weapon/ammo entity you put in your maps. You can replace models globally and locally.

2 How to set up Global Model Replacement

1. Create a GMR file in the "maps" folder matching a map name (eg. mymap.gmr).

2. Copy and paste groups of weapon models into the file. In this example I'm replacing the crowbar model with a custom candy cane model.

"models/p_crowbar.mdl" "models/christmas/p_candycane.mdl"
"models/v_crowbar.mdl" "models/christmas/v_candycane.mdl"
"models/w_crowbar.mdl" "models/christmas/w_candycane.mdl"

3. Open or create the map CFG file (eg. mymap.cfg) in the "maps" folder and add this line to the end for your map:

globalmodellist ../../maps/mymap.gmr

4. Save both the GMR and CFG file and load up your map.

3 How to set up Local Model Replacement

Each individual entity can also have a custom model by simply adding the path to the custom model in the 'Custom Model' field of the entity. This Barney for example now uses the Blue Shift model.

Error creating thumbnail: File missing

For weapons you can select custom models for p_, w_ and v_ models.

4 Using Global Model Replacement to free up resources

It can also be used to strip out default weapon models for maps that have the "512 model limit exceeded" crash upon loading. You can take out weapon models that aren't used in the map to free up some model precache slots. In the following example I'm not using the Egon, so I'm going to replace it with the not-precached model.

"models/p_egon.mdl" "models/not_precached.mdl"
"models/v_egon.mdl" "models/not_precached.mdl"
"models/w_egon.mdl" "models/not_precached.mdl"

5 Notes

  • In the CFG file using "../../" is important, as the working directory doesn't start at "svencoop".
  • You also need to use the quotation marks " ".
  • You cannot use comments (// or ##) in the GMR file.
  • Be aware that you should not take out remove donor specific models just because you don't expect any donors to be joining your server.