From e65f81ae23544d511023dffb71dd1cc705f99c65 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Thu, 13 Feb 2025 23:24:43 -0800 Subject: [PATCH] rules/deathmatch: move precaches into their own dedicated function --- README.md | 3 ++- engine.h | 6 +++--- quake.rc | 3 +++ src/files.dat | 42 ++++++++++++++++++++--------------------- src/rules/deathmatch.qc | 13 ++++++++++--- 5 files changed, 39 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 7b803e6..7bce84f 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,10 @@ Git clone [Nuclide](https://code.idtech.space/vera/nuclide) first, run `make upd ``` git clone https://code.idtech.space/fn/hl2 hl2 make game GAME=hl2 +make plugins GAME=hl2 ``` -The last command will build the game-logic. +The last command will build the plugins required for the engine to load the data files. The one before it will build the game-logic. Make sure that Nuclide-SDK has `fteqcc` and `fteqw` present for building and running, respectively. It will also respect versions installed by the package manager, just make sure it's up to date. diff --git a/engine.h b/engine.h index cb715e3..7ba49ae 100644 --- a/engine.h +++ b/engine.h @@ -1,9 +1,9 @@ #define FULLENGINENAME "Rad-Therapy II" #define GAME_SHORTNAME "halflife2" #define GAME_BASEGAMES "hl2","hl2mp" -#define GAME_PROTOCOL "FTE-RadTherapy2" -#define GAME_DEFAULTCMDS "game_hl2;fteplug_ffmpeg;fteplug_hl2;fteplug_ode;plug_load ffmpeg;plug_load hl2;plug_load ode" -#define GAME_DOWNLOADSURL "https://www.frag-net.com/pkgs/list" +#define GAME_PROTOCOL "Rad-Therapy-II" +#define GAME_DEFAULTCMDS "hl2-patch-radtherapy2;fteplug_ffmpeg;fteplug_ode;fteplug_hl2;exec quake.rc" +#define GAME_DOWNLOADSURL "https://www.frag-net.com/pkgs/halflife2.txt" #define BRANDING_ICON "freecs.ico" #define DISTRIBUTION "RT2" diff --git a/quake.rc b/quake.rc index c1b058a..e445523 100644 --- a/quake.rc +++ b/quake.rc @@ -2,3 +2,6 @@ exec default_controls.cfg exec default_cvar.cfg exec default_video.cfg exec default_hl2.cfg + +plug_load ode +plug_load hl2 diff --git a/src/files.dat b/src/files.dat index 288052d..6e41282 100644 --- a/src/files.dat +++ b/src/files.dat @@ -1396,27 +1396,27 @@ 1 materials/sfx/spot_flare.tga 1 materials/sfx/steam.mat 1 materials/sfx/steam.tga -1 materials/ui/avatar_missing.tga -1 materials/ui/m_bottom.tga -1 materials/ui/m_bottomleft.tga -1 materials/ui/m_bottomright.tga -1 materials/ui/m_left.tga -1 materials/ui/m_linebottom.tga -1 materials/ui/m_linebottomleft.tga -1 materials/ui/m_linebottomright.tga -1 materials/ui/m_lineleft.tga -1 materials/ui/m_linemid.tga -1 materials/ui/m_lineright.tga -1 materials/ui/m_linetop.tga -1 materials/ui/m_linetopleft.tga -1 materials/ui/m_linetopright.tga -1 materials/ui/m_mid.tga -1 materials/ui/m_right.tga -1 materials/ui/m_top.tga -1 materials/ui/m_topleft.tga -1 materials/ui/m_topright.tga -1 materials/ui/voice_off.tga -1 materials/ui/voice_on.tga +1 gfx/ui/avatar_missing.tga +1 gfx/ui/m_bottom.tga +1 gfx/ui/m_bottomleft.tga +1 gfx/ui/m_bottomright.tga +1 gfx/ui/m_left.tga +1 gfx/ui/m_linebottom.tga +1 gfx/ui/m_linebottomleft.tga +1 gfx/ui/m_linebottomright.tga +1 gfx/ui/m_lineleft.tga +1 gfx/ui/m_linemid.tga +1 gfx/ui/m_lineright.tga +1 gfx/ui/m_linetop.tga +1 gfx/ui/m_linetopleft.tga +1 gfx/ui/m_linetopright.tga +1 gfx/ui/m_mid.tga +1 gfx/ui/m_right.tga +1 gfx/ui/m_top.tga +1 gfx/ui/m_topleft.tga +1 gfx/ui/m_topright.tga +1 gfx/ui/voice_off.tga +1 gfx/ui/voice_on.tga 1 models/airboat.mdl.doll 1 models/alyx.mdl.doll 1 models/alyx_emptool_prop.mdl.doll diff --git a/src/rules/deathmatch.qc b/src/rules/deathmatch.qc index 4350bfb..8fe453c 100644 --- a/src/rules/deathmatch.qc +++ b/src/rules/deathmatch.qc @@ -58,6 +58,16 @@ AllowFlashlight(void) return cvars.GetBool("mp_flashlight"); } +void +CodeCallback_Precache(void) +{ + precache.Entity("player_mp"); + + for (int i = 0; i < g_stockHL2MPPlayerModels.length; i++) { + precache.Model(g_stockHL2MPPlayerModels[i]); + } +} + void CodeCallback_StartGameType(void) { @@ -71,9 +81,6 @@ CodeCallback_StartGameType(void) } game.SetSpawnPoint("info_player_deathmatch"); - for (int i = 0; i < g_stockHL2MPPlayerModels.length; i++) { - precache.Model(g_stockHL2MPPlayerModels[i]); - } } void