How to add Ammo & Health supplies without editing a map in Radiant.
1. Extract the mapname.script out of the map.pk3 (maps folder)
2. Open the mapname.script with Notepad++ or Visual Studio Code
3. At the begining of the script find those lines:
and add following code:
Now it should look like this :
SHORT EXPLANATION :
4. Open Enemy Territory and load the map on which you would add the supplies.
5. Go to the position where you want to have the supplies , open your console and type "viewpos"
--this will show your current position ( Example: (4037 -2630 208) : 90 )
6. Enter the first three numbers under "origin"
!!!NOTE!!! Subtract the last number with 60 because the last number is the height of your eyes and not the height of your actual position.
7. Enter the fourth number under "angle"
viewpos output : 4037 -2630 208
origin value : 4037 -2630 146
8. Save your script and upload the mapname.script (not compressed) to your server (into the mapscripts folder you given in your mod.cfg)
etpro.cfg : set b_mapscriptdirectory "mapscripts"
nitmod.cfg : set g_mapScriptDirectory "mapscripts"
8.1 Off course you can also make an additional pk3 file , but then players have to download extra files. :/
9. Restart the map or your server ... That's it.
1. Extract the mapname.script out of the map.pk3 (maps folder)
2. Open the mapname.script with Notepad++ or Visual Studio Code
3. At the begining of the script find those lines:
C++:
game_manager
{
spawn
{
C++:
create
{
scriptname "scrf_health"
targetname "scrf_health"
origin "4037 -2683 146"
classname "misc_cabinet_health"
angle "180"
mins "-20 -8 -25"
maxs "20 8 25"
modelscale "1"
contents "1"
clipmask "1"
model "models/mapobjects/supplystands/stand_health.md3"
}
create
{
scriptname "scrf_healthtr"
targetname "scrf_healthtr"
classname "trigger_heal"
target "scrf_health"
origin "4037 -2683 146"
mins "-45 -45 -25"
maxs "45 45 25"
healthtotal "12"
healthrate "1"
contents "1"
clipmask "1"
}
create
{
scriptname "scrf_ammo"
targetname "scrf_ammo"
origin "4037 -2630 146"
classname "misc_cabinet_supply"
angle "180"
mins "-20 -8 -25"
maxs "20 8 25"
modelscale "1"
contents "1"
clipmask "1"
model "models/mapobjects/supplystands/stand_ammo.md3"
}
create
{
scriptname "scrf_ammotr"
targetname "scrf_ammotr"
classname "trigger_ammo"
target "scrf_ammo"
origin "4037 -2630 146"
mins "-45 -45 -25"
maxs "45 45 25"
ammototal "24"
ammorate "1"
contents "1"
clipmask "1"
}
Now it should look like this :
C++:
game_manager
{
spawn
{
create
{
scriptname "scrf_health"
targetname "scrf_health"
origin "4037 -2683 146"
classname "misc_cabinet_health"
angle "180"
mins "-20 -8 -25"
maxs "20 8 25"
modelscale "1"
contents "1"
clipmask "1"
model "models/mapobjects/supplystands/stand_health.md3"
}
create
{
scriptname "scrf_healthtr"
targetname "scrf_healthtr"
classname "trigger_heal"
target "scrf_health"
origin "4037 -2683 146"
mins "-45 -45 -25"
maxs "45 45 25"
healthtotal "12"
healthrate "1"
contents "1"
clipmask "1"
}
create
{
scriptname "scrf_ammo"
targetname "scrf_ammo"
origin "4037 -2630 146"
classname "misc_cabinet_supply"
angle "180"
mins "-20 -8 -25"
maxs "20 8 25"
modelscale "1"
contents "1"
clipmask "1"
model "models/mapobjects/supplystands/stand_ammo.md3"
}
create
{
scriptname "scrf_ammotr"
targetname "scrf_ammotr"
classname "trigger_ammo"
target "scrf_ammo"
origin "4037 -2630 146"
mins "-45 -45 -25"
maxs "45 45 25"
ammototal "24"
ammorate "1"
contents "1"
clipmask "1"
}
//REST OF THE SCRIPT
SHORT EXPLANATION :
C++:
create // Creates a new entity
{
scriptname "scrf_ammo" // Scriptname to show the script here's something happening
targetname "scrf_ammo" // Declare a targetname
origin "4037 -2630 146" // The position where your entity should be in the map
classname "misc_cabinet_supply" // the classname of the entity
angle "180" // In which direction the entity should look
mins "-20 -8 -25" // The origin-clip around the entity (leave it as it is)
maxs "20 8 25" // The origin-box around the entity (leave it as it is)
modelscale "1" // Size of the model (it's better you leave it as it is)
contents "1" // Enables collisions of the model
clipmask "1" // No idea but set this to 1 should be the best solution
model "models/mapobjects/supplystands/stand_ammo.md3" // model of the ammo stand
}
create // Creates a new entity
{
scriptname "scrf_ammotr" // Scriptname to show the script here's something happening
targetname "scrf_ammotr" // Declare a targetname
classname "trigger_ammo" // Declare a trigger to say the game HERE IS AN AMMO SUPPLY
target "scrf_ammo" // Enter the targetname you given in the part above ( targetname "scrf_ammo" )
origin "4037 -2630 146" // The position where your entity should be in the map (must be the same like the value of the origin above)
mins "-45 -45 -25" // The origin-clip around the entity (leave it as it is)
maxs "45 45 25"
ammototal "24" // How many seconds to respawn ammo packs
ammorate "1" // How many ammo packs are available
contents "1" // Enables collisions of the model
clipmask "1" // No idea but set this to 1 should be the best solution
}
4. Open Enemy Territory and load the map on which you would add the supplies.
5. Go to the position where you want to have the supplies , open your console and type "viewpos"
--this will show your current position ( Example: (4037 -2630 208) : 90 )
6. Enter the first three numbers under "origin"
!!!NOTE!!! Subtract the last number with 60 because the last number is the height of your eyes and not the height of your actual position.
7. Enter the fourth number under "angle"
viewpos output : 4037 -2630 208
origin value : 4037 -2630 146
8. Save your script and upload the mapname.script (not compressed) to your server (into the mapscripts folder you given in your mod.cfg)
etpro.cfg : set b_mapscriptdirectory "mapscripts"
nitmod.cfg : set g_mapScriptDirectory "mapscripts"
8.1 Off course you can also make an additional pk3 file , but then players have to download extra files. :/
9. Restart the map or your server ... That's it.