Okay, thanks! I think I'll just go the VScript preset method for now since I am still unfamiliar when it comes to everything about VScripts, unless you or someone else here would be willing to walk me through how to do the inject method you mentioned.
So in this preset method I presume I need to do the following:
In the server's Vscripts folder, Make a bunch of copies of the c1m4_atrium_finale.nut, name them according to the preset like finalet1.nut, finalet2.nut, and so on
In each copy change the following line to whatever goal it needs to be for that tier
Code:
// number of cans needed to escape.
NumCansNeeded <- 13 //< change this number to the new goal
Then in my sourcemod plugin it would go something like
PHP Code:
public Action OnVScriptExecuted(const char[] sScript, char sOverride[PLATFORM_MAX_PATH], bool bOverride)
{
if( strcmp(sScript, "c1m4_atrium_finale") == 0 || (bOverride && strcmp(sOverride, "c1m4_atrium_finale") == 0) )
{
int totalSurvivors = GetSurvivorCount();
if(totalSurvivors > 4 && totalSurvivors <= 8)
{
//Set new scavenge goal of 17 cans
PrintToServer("Increase to 17");
sOverride = "c1m4_atrium_finalet1";
Ent_Fire("progress_display", "SetTotalItems", 17);
return Plugin_Changed;
}
else if(totalSurvivors > 8 && totalSurvivors <= 12)
{
//Set new scavenge goal of 21 cans
PrintToServer("Increase to 21");
sOverride = "c1m4_atrium_finalet2";
Ent_Fire("progress_display", "SetTotalItems", 21);
return Plugin_Changed;
}
//And so on
}
return Plugin_Continue;
}
For changing the progress display is it simply a matter of using disawar's method in their plugin, or has Sourcemod added a better way of doing this since then (with SetEntProp perhaps?)
PHP Code:
Ent_Fire(const String:sName[], const String:sInput[], Params = -1)
{
decl String:sEntName[64];
for (new i = 0; i < 4096; i++){
if (IsValidEntity(i)){
GetEntPropString(i, Prop_Data, "m_iName", sEntName, sizeof(sEntName));
if (StrEqual(sEntName, sName)){
#if debug
PrintToChatAll("[GS] ent_fire (%s %d, %s, %d)", sName, i, sInput, Params);
#endif
if (Params != -1)
SetVariantInt(Params);
AcceptEntityInput(i, sInput);
break;
}
}
}
}
Ent_Fire("game_scavenge_progress_display", "SetTotalItems", newTotalCans);
One last thing, is L4D2 smart enough to respawn gas cans in the same spawn points if it sees that there aren't enough cans to reach the goal, or does a plugin also have to tell it to do that? And/Or do I still have to make use of ScavengeRemixDS to make sure sufficient gas cans are spawned?