xXDeathreusXx, that would be nice. I just pushed an update to fix this plugin's model issue on spawn. A bunch of the current work I plan to do is make it more developer friendly and make the code easier to read.
I am happy to say, that I've added a easy way to add models, sounds, materials, and other misc configuration stuff.
for instance, you put VSHA_LoadConfiguration("configs/vsha/saxtonhale.cfg"); in your public void OnAllPluginsLoaded() function.
Code:
// saxtonhale.cfg
"VSHA_CONFIGURATION"
{
"sounds"
{
"HaleTheme1" "saxton_hale/saxtonhale.mp3"
"HaleTheme2" "saxton_hale/haletheme2.mp3"
"HaleTheme3" "saxton_hale/haletheme3.mp3"
"HaleComicArmsFallSound" "saxton_hale/saxton_hale_responce_2.wav"
"HaleLastB" "vo/announcer_am_lastmanalive"
"HaleKSpree" "saxton_hale/saxton_hale_responce_3.wav"
"HaleKSpree2" "saxton_hale/saxton_hale_responce_4.wav" //this line is broken and unused
"HaleRoundStart" "saxton_hale/saxton_hale_responce_start" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_start1.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_start2.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_start3.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_start4.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_start5.wav" //1-5
"HaleJump" "saxton_hale/saxton_hale_responce_jump" //1-2
"AutoLoad" "saxton_hale/saxton_hale_responce_jump1.wav" //1-2
"AutoLoad" "saxton_hale/saxton_hale_responce_jump2.wav" //1-2
"HaleRageSound" "saxton_hale/saxton_hale_responce_rage" //1-4
"AutoLoad" "saxton_hale/saxton_hale_responce_rage1.wav" //1-4
"AutoLoad" "saxton_hale/saxton_hale_responce_rage2.wav" //1-4
"AutoLoad" "saxton_hale/saxton_hale_responce_rage3.wav" //1-4
"AutoLoad" "saxton_hale/saxton_hale_responce_rage4.wav" //1-4
"HaleKillMedic" "saxton_hale/saxton_hale_responce_kill_medic.wav"
"HaleKillSniper1" "saxton_hale/saxton_hale_responce_kill_sniper1.wav"
"HaleKillSniper2" "saxton_hale/saxton_hale_responce_kill_sniper2.wav"
"HaleKillSpy1" "saxton_hale/saxton_hale_responce_kill_spy1.wav"
"HaleKillSpy2" "saxton_hale/saxton_hale_responce_kill_spy2.wav"
"HaleKillEngie1" "saxton_hale/saxton_hale_responce_kill_eggineer1.wav"
"HaleKillEngie2" "saxton_hale/saxton_hale_responce_kill_eggineer2.wav"
"HaleKSpreeNew" "saxton_hale/saxton_hale_responce_spree" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_spree1.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_spree2.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_spree3.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_spree4.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_spree5.wav" //1-5
"HaleWin" "saxton_hale/saxton_hale_responce_win" //1-2
"AutoLoad" "saxton_hale/saxton_hale_responce_win1.wav" //1-2
"AutoLoad" "saxton_hale/saxton_hale_responce_win2.wav" //1-2
"HaleLastMan" "saxton_hale/saxton_hale_responce_lastman" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_lastman1.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_lastman2.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_lastman3.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_lastman4.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_responce_lastman5.wav" //1-5
"HaleFail" "saxton_hale/saxton_hale_responce_fail" //1-3
"AutoLoad" "saxton_hale/saxton_hale_responce_fail1.wav" //1-3
"AutoLoad" "saxton_hale/saxton_hale_responce_fail2.wav" //1-3
"AutoLoad" "saxton_hale/saxton_hale_responce_fail3.wav" //1-3
"HaleJump132" "saxton_hale/saxton_hale_132_jump_" //1-2
"AutoLoad" "saxton_hale/saxton_hale_132_jump_1.wav" //1-2
"AutoLoad" "saxton_hale/saxton_hale_132_jump_2.wav" //1-2
"HaleStart132" "saxton_hale/saxton_hale_132_start_" //1-5
"AutoLoad" "saxton_hale/saxton_hale_132_start_1.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_132_start_2.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_132_start_3.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_132_start_4.wav" //1-5
"AutoLoad" "saxton_hale/saxton_hale_132_start_5.wav" //1-5
"HaleKillDemo132" "saxton_hale/saxton_hale_132_kill_demo.wav"
"HaleKillEngie132" "saxton_hale/saxton_hale_132_kill_engie_" //1-2
"AutoLoad" "saxton_hale/saxton_hale_132_kill_engie_1.wav" //1-2
"AutoLoad" "saxton_hale/saxton_hale_132_kill_engie_2.wav" //1-2
"HaleKillHeavy132" "saxton_hale/saxton_hale_132_kill_heavy.wav"
"HaleKillScout132" "saxton_hale/saxton_hale_132_kill_scout.wav"
"HaleKillSpy132" "saxton_hale/saxton_hale_132_kill_spie.wav"
"HaleKillPyro132" "saxton_hale/saxton_hale_132_kill_w_and_m1.wav"
"HaleSappinMahSentry132" "saxton_hale/saxton_hale_132_kill_toy.wav"
"HaleKillKSpree132" "saxton_hale/saxton_hale_132_kspree_" //1-2
"AutoLoad" "saxton_hale/saxton_hale_132_kspree_1.wav" //1-2
"AutoLoad" "saxton_hale/saxton_hale_132_kspree_2.wav" //1-2
"HaleKillLast132" "saxton_hale/saxton_hale_132_last.wav"
"HaleStubbed132" "saxton_hale/saxton_hale_132_stub_" //1-4
"AutoLoad" "saxton_hale/saxton_hale_132_stub_1.wav" //1-4
"AutoLoad" "saxton_hale/saxton_hale_132_stub_2.wav" //1-4
"AutoLoad" "saxton_hale/saxton_hale_132_stub_3.wav" //1-4
"AutoLoad" "saxton_hale/saxton_hale_132_stub_4.wav" //1-4
}
"models"
{
"HaleModel" "models/player/saxton_hale/saxton_hale.mdl"
"HaleModelPrefix" "models/player/saxton_hale/saxton_hale"
}
"materials"
{
"MaterialPrefix" "materials/models/player/saxton_hale/eye"
"MaterialPrefix" "materials/models/player/saxton_hale/hale_head"
"MaterialPrefix" "materials/models/player/saxton_hale/hale_body"
"MaterialPrefix" "materials/models/player/saxton_hale/hale_misc"
"MaterialPrefix" "materials/models/player/saxton_hale/sniper_red"
"MaterialPrefix" "materials/models/player/saxton_hale/sniper_lens"
}
}
Then when it loads your configuration file.. you can set your variables here:
Code:
public void VSHA_OnConfiguration_Load_Sounds(char[] skey, char[] value, bool &bPreCacheFile, bool &bAddFileToDownloadsTable)
{
// AutoLoad is not attached to any variable
if(StrEqual(skey, "AutoLoad"))
{
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleTheme1"))
{
strcopy(STRING(HaleTheme1), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleTheme2"))
{
strcopy(STRING(HaleTheme2), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleTheme3"))
{
strcopy(STRING(HaleTheme3), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleComicArmsFallSound"))
{
strcopy(STRING(HaleComicArmsFallSound), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleLastB"))
{
strcopy(STRING(HaleLastB), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKSpree"))
{
strcopy(STRING(HaleKSpree), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKSpree2"))
{
strcopy(STRING(HaleKSpree2), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleRoundStart"))
{
strcopy(STRING(HaleRoundStart), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleJump"))
{
strcopy(STRING(HaleJump), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleRageSound"))
{
strcopy(STRING(HaleRageSound), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillMedic"))
{
strcopy(STRING(HaleKillMedic), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillSniper1"))
{
strcopy(STRING(HaleKillSniper1), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillSniper2"))
{
strcopy(STRING(HaleKillSniper2), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillSpy1"))
{
strcopy(STRING(HaleKillSpy1), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillSpy2"))
{
strcopy(STRING(HaleKillSpy2), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillEngie1"))
{
strcopy(STRING(HaleKillEngie1), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillEngie2"))
{
strcopy(STRING(HaleKillEngie2), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKSpreeNew"))
{
strcopy(STRING(HaleKSpreeNew), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleWin"))
{
strcopy(STRING(HaleWin), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleLastMan"))
{
strcopy(STRING(HaleLastMan), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleFail"))
{
strcopy(STRING(HaleFail), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleJump132"))
{
strcopy(STRING(HaleJump132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleStart132"))
{
strcopy(STRING(HaleStart132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillDemo132"))
{
strcopy(STRING(HaleKillDemo132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillEngie132"))
{
strcopy(STRING(HaleKillEngie132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillHeavy132"))
{
strcopy(STRING(HaleKillHeavy132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillScout132"))
{
strcopy(STRING(HaleKillScout132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillSpy132"))
{
strcopy(STRING(HaleKillSpy132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillPyro132"))
{
strcopy(STRING(HaleKillPyro132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleSappinMahSentry132"))
{
strcopy(STRING(HaleSappinMahSentry132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillKSpree132"))
{
strcopy(STRING(HaleKillKSpree132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleKillLast132"))
{
strcopy(STRING(HaleKillLast132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleStubbed132"))
{
strcopy(STRING(HaleStubbed132), value);
bPreCacheFile = true;
bAddFileToDownloadsTable = true;
}
if(bPreCacheFile || bAddFileToDownloadsTable)
{
PrintToServer("Loading Sounds %s = %s",skey,value);
}
}
public void VSHA_OnConfiguration_Load_Materials(char[] skey, char[] value, bool &bPrecacheGeneric, bool &bAddFileToDownloadsTable)
{
if(StrEqual(skey, "MaterialPrefix"))
{
char s[PATHX];
char extensionsb[][] = { ".vtf", ".vmt" };
for (int i = 0; i < sizeof(extensionsb); i++)
{
Format(s, PATHX, "%s%s", value, extensionsb[i]);
if ( FileExists(s, true) )
{
AddFileToDownloadsTable(s);
PrintToServer("Loading Materials %s",s);
}
}
}
}
public void VSHA_OnConfiguration_Load_Models(char[] skey, char[] value, bool &bPreCacheModel, bool &bAddFileToDownloadsTable)
{
if(StrEqual(skey, "HaleModel"))
{
strcopy(STRING(HaleModel), value);
bPreCacheModel = true;
bAddFileToDownloadsTable = true;
}
else if(StrEqual(skey, "HaleModelPrefix"))
{
char s[PATHX];
char extensions[][] = { ".mdl", ".dx80.vtx", ".dx90.vtx", ".sw.vtx", ".vvd", ".phy" };
for (int i = 0; i < sizeof(extensions); i++)
{
Format(s, PATHX, "%s%s", HaleModelPrefix, extensions[i]);
if ( FileExists(s, true) )
{
AddFileToDownloadsTable(s);
PrintToServer("Loading Model %s = %s",skey,value);
}
}
}
if(bPreCacheModel || bAddFileToDownloadsTable)
{
PrintToServer("Loading Model %s = %s",skey,value);
}
}
public void VSHA_OnConfiguration_Load_Misc(char[] skey, char[] value)
{
}
Or you can just handle it mainly via a triggered public void VSHA_AddToDownloads(){};
That is the developer's choice. I personally think having VSHA handle the loading of your configuration file is much easier than creating your custom loader.
if you want VSHA engine to Precache files for you, just change bPreCacheFile to true, or bPreCacheModel to true.
if you want VSHA engine to Add To Downloads Table, then change bAddFileToDownloadsTable to true.
VSHA_OnConfiguration_Load_Misc(char[] skey, char[] value) is created so that if you want to have custom configurations in the same file as the models, sounds, and materials.. then you can add those into a section called "misc" {} in the configuration file, and load them into your sub plugin.
You can check how I did it in this link:
https://github.com/War3Evo/VSH-Advan...-saxtonhale.sp
To get details on what I've done so far, check out:
https://github.com/War3Evo/VSH-Advanced/commits/develop
Overall, the whole focus is flexibility.
Note: I still need to make it easier to handle "Multiple Bosses" for SaxtonHale sub plugin. Currently I do not think I'm handling that part easily. It is doable, but not easy for the developer.
Just note this plugin will be compatible to allow a Multiple Boss Mode if the server owner wants to enable that feature.
I still need to figure out how to go about that.. In the "force teams" part as far as mutliple boss mode. If anyone knowledgeable on how FF2 does that, please let me know.
__________________