Left 4 Dead 2

Left 4 Dead 2

54 ratings
Global Radar (Modders Guide)
By Ellie
This Guide explains to Modders how to add Global Radar support to their addons.
   
Award
Favorite
Favorited
Unfavorite
General Information
Difficulty :
Note that this Guide assumes you know how to make a custom infected / item replacement with a 3D Tool. It also assumes you use Blender, but you can use any other 3D Software.

Short description : The Global Radar is an addon I made that detects items and infected from a distance, and that displays the distance between you and them. Although it is compatible with reskins, it is not compatible with new models, unless you add something in the model, which this Guide is all about.

🛠️ Important : It is required to have basic knowledge in a 3D Graphics Software, such as Blender or Maya. This Guide will use Blender but it's doable with any other 3D Software.

Needed skills :
  • Basic knowledge of a 3D Software
  • Basic knowledge of Crowbar and QC files
  • Knowing how to pack and unpack a mod
What is Global Radar ?
What is it ?
Global Radar (2.0) is an addon I made that detects infected and items and displays how far from them you are. It could be considered as a cheat, but since it doesn't work (anymore) in Versus because the servers are sv_pure, it's a cool helping tool for the ones who want to make Campaign games (especially Realism games) easier.

It can also detects if the Tank is on fire, the Tank health, and if you're in a 'crown' position for the Witch. It also detects if a charger is charging.

https://steamcommunity.com/sharedfiles/filedetails/?id=2296329104
What's new in 2.0 ?
The Global Radar 1.0 is a mod that dates back to 2016. The 2020 version has new features:
- Detection distance boosted from 30 units to 74 units
- Added detection of L4D1 infected (courtesy of Hano).
- Added radars for Incendiary and Fire Ammo
- Added (restored) the Witch crown radar
- Added a radar to track the Tank health

Questions and Answers (Q&A)
Q : On what does it work ?
As of now, on Infected and Items. It doesn't work on Guns nor Melees, but it would be possible if I did the icons for them.
Q : Is it compatible with HUDs ?
It replaces a HUD file that is almost never used by HUDs, so it should be compatible with almost every HUD.
Q : Does that work on Versus ?
No, because Versus servers do not allow mods. It would probably be considered as a cheat if it did though.
Q : How does it work ?
It's complicated. In short, you add the radar itself in the infected / items, like a tattoo that would change depending on how far the infected / item is from you, then this tattoo is copied onto the HUD.

How much time does it take to add this to a mod ?
Probably less than 5 minutes per mod. You just need to add an extra material to your mod.
⏱️TL;DR Explanation
If you're an experienced modder, you can real this tl;dr fast explanation:

The only thing you need for the radar to detect your item / infected is to make sure it has a certain material (VMT) in its world model.

For example, if you make a new model for the Jockey, the radar will detect it automatically as long as your Jockey has this VMT in/on them (note that the VMT file itself is already included in the Core Radar Mod. You do not need to create this VMT, you just need to make sure your model has it):
vgui\radars\r_jockey.vmt
At the end of this Guide ([Appendix]), you can see all the names for all the radars, depending on what you want to add support for. They are all located in "vgui\radars\".

Note that the Witch / Charger / Tank have multiple radars for the different effects. You need to add them all for the radar to activate all the effects.

This also means you'll need to add one extra $cdmaterials line in your .qc file...
$cdmaterials "vgui\radars\"



In other words, if you (1) have that extra $cdmaterials line in your .qc and if you (2) see this in the compile log in Crowbar (i.e. for pain pills (r_pills)), the radar will detect your item/infected.



⚙️Add Radar Support
Note that you only need to do this for the world (w_) model and not for the view (v_) model

Adding the radar support requires you to add an extra material in your model, then add an extra $cdmaterials line. The steps can be resumed this way:
① : Create a new polygon and assign the radar to it
② : Hide the polygon within the material
➂ : Export and compile with an extra $cdmaterials line

As an example, I'll show you how I converted this mod to be detected by the Global Radar:
https://steamcommunity.com/sharedfiles/filedetails/?id=551700810
① Create a new polygon
STEP 0
Using Crowbar, decompile the MDL file you extracted from a .vpk addon, and convert it to an SMD file. Import that SMD file in Blender using the Blender Source Tools.



STEP 1
Select your item / infected in object mode, then switch to edit mode, and add a new plane.



STEP 3
Open the "Material Properties" section on the right, then press on the + to add a new material. Then, press on the "New" button that just appeared.



STEP 4
You will now need to rename the material ("Material.001" in the example).
If it's for pills, name it r_pills. If it's for charger, name it r_charger... actually, go at the very end of that Guide in the [Appendix] section to see what name you must write.

When you changed the default name to the correct one, make sure the plane (square) is still selected, and press on Assign. If you did everything right, you can now use the "Select/Deselect" button to select and unselect the plane.


This is how it should look at this point


② Hide the polygon
STEP 5
Still in edit mode, go to the Object Data Properties tab. Make sure your plane is still selected, then Assign it (by clicking on said button) to ValveBiped.weapon_bone or, if this one does not exist, on any entry that contains 'head' (for infected mainly).

If you have prop_static as a choice, you can also assign to this.



STEP 6
Press on the S key with the plane (square) still selected and make it very small.



STEP 7
Press on the G key with the plane (square) still selected and then press on the X, Y or Z key and move your mouse to make the plane (square) enter your item. Right-click to validate. You might need to do this multiple times and with different (X/Y/Z) axis.
You can stop once the plane is in the item, or in the head of the infected.


This is what is should look like from inside the item / infected just before you right click on it for the last time. At this point the square is in the model and ready to compile.

STEP ⟲
You might need to do steps 1 to 7 again to add a second radar if you are adding support for:
- Charger (you need to redo it for r_chargerc)
- Witch (you need to redo it for r_witchc)
- Tank (you need to redo it twice for r_tankf and r_tankhealth)


➂ Compile and $cdmaterials
STEP 8
Under the Scene Properties tab, choose SMD as export format, then define the Export Path to the folder where you decompiled your mod. Press on export and go to the folder you exported the material to, where the .QC file is located.



STEP 9
In the .QC compile file, look for the $definebone lines and unquote them if they are still quoted.

In other words, change this...
// $definebone
...into this.
$definebone

STEP 10
Still in the .QC compile file, add this anywhere.
$cdmaterials "vgui\radars\"

STEP 11
Open Crowbar and compile your mod as usual with the .QC file you just modified.
If you did steps 1 to 7 correctly, you should see this in the compile log...
Processing LOD for material: r_####
... where the #### are the correct radar for the item you just added support for.



STEP 12
In Crowbar, press on the "Go To" or "Go To Model File" button at the bottom. Copy what has just been compiled into your mod, pack it back in a .vpk as usual, and you're good to go, you just added radar support and you can test it in game.

[Appendix] Radar names
Note that if you want to add radar support for an unlisted item, such as a gun, I could make icons for it. Please contact me in private if you're interested.

Items
Adrenaline
r_adrenaline
Ammo (piles)
r_ammo
Ammo (explosive bullets)
r_explosiveammo
Ammo (fire bullets)
r_fireammo
Bile Jar
r_bilejar
Defibrilator
r_defibrilator
Laser Sights
r_laser
Medkit
r_medkit
Molotov Cocktail
r_molotov
Pain Pills
r_pills
Pipe Bomb
r_pipebomb

Infected
Boomer
r_boomer
Charger
r_charger r_chargerc
Hunter
r_hunter
Jockey
r_jockey
Smoker
r_smoker
Spitter
r_spitter
Tank
r_tank r_tankf r_tankhealth
Witch
r_witch r_witchc
5 Comments
MHG Apr 22, 2023 @ 7:27pm 
it not work , i only download this : https://steamcommunity.com/sharedfiles/filedetails/?id=2296329104
does i have to download orther global radar ?
Ellie  [author] Aug 28, 2021 @ 3:22am 
@Yoimiya : This might be linked to LOD settings (or an update to L4D2 I dunno). If you have low graphic settings for models, it might do that. Try to higher your graphics settigns and see if this is still present.
Yoimiya Aug 26, 2021 @ 1:47am 
@Ellie : I encountered a problem. After the rendering distance (about 23 units) is exceeded, the item radar will not display. Is there any way to solve this problem?

I saw in your global radar 2.0 video that even if there are more than 23 units, the item radar is still visible.
Yoimiya Jul 31, 2021 @ 12:10am 
@A you can do it yourself
仓鼠箘 Nov 25, 2020 @ 1:23am 
You've been working very hard