PDA

View Full Version : Problem with scorelimit in zpam



qwrtyp
3rd June 2014, 04:27
Hi!

I'm using a new version of pam mod (zpam v2.06) "zPAM edition made ​​by z0d" - I think he is a user of this forum, I tried to contact him and could not...

link: http://eu.cybergamer.com/files/6597/

but it has a problem, it is not possible to determine a maximum score for the end of deathmatch and team deathmatch.


scr_dm_scorelimit
ui_dm_scorelimit
scr_tdm_scorelimit
ui_dm_scorelimit

> The map does not end when the specified value is reached.

i have no idea how to fix it, if z0d appear here, or anyone knows how to fix I'd be grateful.

Tally
3rd June 2014, 11:05
From the enclosed server.cfg file:


/*This will allow you to trigger the end of a map/match by a team's TOTAL score, including the 1st half and 2nd half (is halftime is being used). 0 = disabled*/
seta scr_tdm_end_score "20"


So, the reason it wont work is because you are setting the wrong dvar. Try setting the right one and it will work.

qwrtyp
5th June 2014, 04:41
From the enclosed server.cfg file:


/*This will allow you to trigger the end of a map/match by a team's TOTAL score, including the 1st half and 2nd half (is halftime is being used). 0 = disabled*/
seta scr_tdm_end_score "20"


So, the reason it wont work is because you are setting the wrong dvar. Try setting the right one and it will work.


Sorry, my mistake in TDM mode. I will edit first post. The problem is only in DM mode.

I put this command to test:


seta scr_dm_scorelimit "1"

screenshot:
713
the game should have ended. note in the upper left corner "2/1".

Tally
5th June 2014, 07:28
I looked through the DM gametype file in the PAM mod you linked to and found that the scorelimit code has been commented out (made blank). Which means you can easily edit it back to being active.

Look in zPAM206.iwd/maps/pam for this:


updateGametypeCvars()
{
// ePAM
level endon("timeoutcalled");
timelimit = getCvarFloat("scr_dm_timelimit");
if (level.timelimit < timelimit)
{
timelimit = level.timelimit;
}
//
for(;;)
{
if(level.timelimit != timelimit)
{
if(timelimit > 1440)
{
timelimit = 1440;
setCvar("scr_dm_timelimit", "1440");
}

level.timelimit = timelimit;
setCvar("ui_dm_timelimit", level.timelimit);
level.starttime = getTime();

if(level.timelimit > 0)
{
if(!isDefined(level.clock))
{
level.clock = newHudElem();
level.clock.horzAlign = "left";
level.clock.vertAlign = "top";
level.clock.x = 8;
level.clock.y = 2;
level.clock.font = "default";
level.clock.fontscale = 2;
}
level.clock setTimer(level.timelimit * 60);
}
else
{
if(isDefined(level.clock))
level.clock destroy();
}

checkTimeLimit();
}

/*
scorelimit = getCvarInt("scr_dm_scorelimit");
if(level.scorelimit != scorelimit)
{
level.scorelimit = scorelimit;
setCvar("ui_dm_scorelimit", level.scorelimit);
level notify("update_allhud_score");
}
checkScoreLimit();
*/

wait level.fps_multiplier * 1;
}
}


And edit it to this:


updateGametypeCvars()
{
// ePAM
level endon("timeoutcalled");
timelimit = getCvarFloat("scr_dm_timelimit");
if (level.timelimit < timelimit)
{
timelimit = level.timelimit;
}
//
for(;;)
{
if(level.timelimit != timelimit)
{
if(timelimit > 1440)
{
timelimit = 1440;
setCvar("scr_dm_timelimit", "1440");
}

level.timelimit = timelimit;
setCvar("ui_dm_timelimit", level.timelimit);
level.starttime = getTime();

if(level.timelimit > 0)
{
if(!isDefined(level.clock))
{
level.clock = newHudElem();
level.clock.horzAlign = "left";
level.clock.vertAlign = "top";
level.clock.x = 8;
level.clock.y = 2;
level.clock.font = "default";
level.clock.fontscale = 2;
}
level.clock setTimer(level.timelimit * 60);
}
else
{
if(isDefined(level.clock))
level.clock destroy();
}

checkTimeLimit();
}

scorelimit = getCvarInt("scr_dm_scorelimit");
if(level.scorelimit != scorelimit)
{
level.scorelimit = scorelimit;
setCvar("ui_dm_scorelimit", level.scorelimit);
level notify("update_allhud_score");
}
checkScoreLimit();

wait level.fps_multiplier * 1;
}
}


Close and save.

qwrtyp
5th June 2014, 23:24
I made the change but it did not work.
I think this suggested change removed the need to restart the map to take effect in command scoreboard.

I was taking a look in the file you mentioned:
in maps/pam/dm.gsc

i found this:

checkScoreLimit()

.
.

/* Match Score Check */

/* Match Score Check */
if (level.matchscore1 > 0)
{
if(game["Team_1_Score"] < level.matchscore1 && game["Team_2_Score"] < level.matchscore1)
return;

iprintln(&"MP_SCORE_LIMIT_REACHED");

if(game["Team_1_Score"] == game["Team_2_Score"] && game["mode"] == "match" && getcvarint("g_ot") == 1) // have a tie and overtime mode is on
maps\pam\end_of_map::Prepare_map_Tie();
else
setCvar("g_ot_active", "0");

maps\pam\end_of_map::End_Match_Scoreboard();

if(level.mapended)
return;
level.mapended = true;

thread endMap();
}


then replace this old version:



if(level.scorelimit <= 0)
return;

if(self.score < level.scorelimit)
return;

if(level.mapended)
return;
level.mapended = true;

if(!level.splitscreen)
iprintln(&"MP_SCORE_LIMIT_REACHED");

level thread endMap();


Thanks a lot Tally, problem fixed!