Skip to content

Commit

Permalink
zPAM3.34
Browse files Browse the repository at this point in the history
- new mappack version 4 (new maps: mp_leningrad_tls, mp_trainstation_fix, mp_vallente_fix, mp_dawnville_sun, mp_crossroads, mp_carentan_bal)
- bug fix - SCOPE / SHOTGUN not pickable in strattime when dropped
- new button in weapon menu: "Replace secondary with pistol" - fixes an issue when you click again on the currently selected weapon and the secondary weapon is removed
- weapon menu fix - when "[ESC] Close" button is clicked, menu does not close properly and only cursor stays visible
- adjusted streamer layout (team scores and names moved next to player bars; match time and score from previous maps moved next to compass; round info moved next to time; made sure that compass has always the same size, lagometer is hidden, fps is hidden)
- feature to save server data into file (match info, player positions, score, health), could be used as API
- russians are enabled by default on winter maps
- feature to show posters on walls (for lans)
- new weapon FG42 (disabled by default)
- balanced BAR - damage increased from 40 to 45 (disabled by default)
- removed PCW mode, replaced with custom mode, which can be adjusted for specific needs (nightcups, lans, ...)
- fixed false grenade hit indication when enemy is killed by other player in the same moment
  • Loading branch information
eyza-cod2 committed Aug 25, 2024
1 parent abbc16d commit e73c0fd
Show file tree
Hide file tree
Showing 101 changed files with 1,223 additions and 1,011 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.gitignore
.atom
.vscode
source_compiled
/*.iwd
/*.txt
/*.txt
256 changes: 137 additions & 119 deletions README.md

Large diffs are not rendered by default.

Binary file modified images/streamer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion source/default_mp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sets _match_team2 "-"
sets _match_score "-"
sets _match_round "-"

sets _zpam "3.33" // ZPAM_RENAME
sets _zpam "3.34" // ZPAM_RENAME



Expand Down
Binary file added source/images/fg42early.iwi
Binary file not shown.
Binary file added source/images/hud_fg42.iwi
Binary file not shown.
Binary file added source/images/weapon_fg42.iwi
Binary file not shown.
File renamed without changes.
Binary file added source/images/~fg42early_n-gggr.iwi
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions source/maps/mp/gametypes/_callbacksetup.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ CodeCallback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath
if(!isdefined(vDir))
iDFlags |= level.iDFLAGS_NO_KNOCKBACK;

// Ignore grenade hit to dead player (happends when player is hitted by multiple players)
if (sMeansOfDeath == "MOD_GRENADE_SPLASH" && !isAlive(self))
return;

damageFeedback = 1;


Expand Down
10 changes: 10 additions & 0 deletions source/maps/mp/gametypes/_custom_rules.gsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
LoadCvars() {
arr = [];

// Use the code line below to change cvar values to your liking
// You may set if the change may be indicated as warning to players or not

//arr = maps\mp\gametypes\rules\custom::AddCustomCvar(arr, "scr_sd_strat_time", 3, false);

return arr;
}
264 changes: 264 additions & 0 deletions source/maps/mp/gametypes/_file.gsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
#include maps\mp\gametypes\global\_global;

init()
{
addEventListener("onCvarChanged", ::onCvarChanged);
registerCvarEx("I", "scr_file", "BOOL", 0);

addEventListener("onConnected", ::onConnected);

if (!level.scr_file)
return;

level thread file();
}

// This function is called when cvar changes value.
// Is also called when cvar is registered
// Return true if cvar was handled here, otherwise false
onCvarChanged(cvar, value, isRegisterTime)
{
switch(cvar)
{
case "scr_file":
level.scr_file = value;
if (!isRegisterTime)
{
if (level.scr_file) // enabled
{
level thread file();
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];
player onConnected();
}
}
else // disabled
{
level notify("file_stop");
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];
player notify("file_stop");
}
}
}
return true;
}
return false;
}

onConnected()
{
if (!level.scr_file)
return;

self.streamerSystem_file_bulletImpactPos = undefined;
self.streamerSystem_file_deathPosition = undefined;

self thread player_loop();
}

player_loop()
{
self endon("disconnect");
self endon("file_stop");

last_current = "none";
last_clipAmmo = 0;
while(1)
{
wait level.frame;

self.streamerSystem_file_bulletImpactPos = undefined;

if (!isAlive(self))
continue;

self.streamerSystem_file_deathPosition = self getOrigin();

current = self getcurrentweapon();

// Player dont have weapon - for example player is on ladder
if(current == "none")
continue;

weapon1 = self getweaponslotweapon("primary");
weapon2 = self getweaponslotweapon("primaryb");
weapon1_clipAmmo = self getweaponslotclipammo("primary");
weapon2_clipAmmo = self getweaponslotclipammo("primaryb");


current_clipAmmo = -1;
if(current == weapon1) current_clipAmmo = weapon1_clipAmmo;
if(current == weapon2) current_clipAmmo = weapon2_clipAmmo;

// Bullet fired
if (last_current == current && current_clipAmmo < last_clipAmmo && current_clipAmmo >= 0)
{
//self iprintln(gettime() + " fired");
self.streamerSystem_file_bulletImpactPos = self getLookingAtPosition();
}

// TODO MG firing

last_current = current;
last_clipAmmo = current_clipAmmo;
}
}


file()
{
level endon("file_stop");

wait level.frame * 3; // wait untill players from previous round get connected

i = 0;
ip = getCvar("net_ip");
port = getCvar("net_port");

while(true)
{
wait level.frame;
waittillframeend;

// Resets the infinite loop check timer, to prevent an incorrect infinite loop error when a lot of script must be run
resettimeout();

players = getentarray("player", "classname");

/*
s = Scr_GetString(arg);
len = strlen(s);
FS_Write(s, len, level.openScriptIOFileHandles[filenum]);
FS_Write(",", 1, level.openScriptIOFileHandles[filenum]);
*/

str = "1" + "\n";
str = str + gettime() + "," + i + "," + level.gametype + "," + level.mapname + "," + players.size + "\n";

for(p = 0; p < players.size; p++)
{
player = players[p];

origin = player getOrigin();
if (isDefined(player.streamerSystem_file_deathPosition) && !isAlive(player))
origin = player.streamerSystem_file_deathPosition;
angles = player getPlayerAngles();

bulletImpactPos = "0,0,0";
if (isDefined(player.streamerSystem_file_bulletImpactPos))
{
//player iprintln(gettime() + " fire printed");
bulletImpactPos = player.streamerSystem_file_bulletImpactPos[0] + "," + player.streamerSystem_file_bulletImpactPos[1] + "," + player.streamerSystem_file_bulletImpactPos[2];
}

team = player.sessionteam;
if (isDefined(player.pers["team"]) && player.pers["team"] != "")
team = player.pers["team"];

str = str +
player getEntityNumber() + "," +
origin[0] + "," + origin[1] + "," + origin[2] + "," +
angles[0] + "," + angles[1] + "," + angles[2] + "," +
team + "," +
player.health + "," +
bulletImpactPos + "," +
player.spectatorclient + "," +
"\"" + player.name + "\"" + "\n";
}

str = str + level.streamerSystem_playerID + "\n";

if (level.gametype == "sd")
{
if (isDefined(level.bombzoneA) && !level.bombplanted)
str = str + level.bombzoneA[0] + "," + level.bombzoneA[1] + "," + level.bombzoneA[2] + "\n";
else str = str + "undefined\n";
if (isDefined(level.bombzoneB) && !level.bombplanted)
str = str + level.bombzoneB[0] + "," + level.bombzoneB[1] + "," + level.bombzoneB[2] + "\n";
else str = str + "undefined\n";

if (level.bombplanted && !level.bombexploded)
{
str = str +
level.bombmodel.origin[0] + "," + level.bombmodel.origin[1] + "," + level.bombmodel.origin[2] + "," +
level.bombmodel.angles[0] + "," + level.bombmodel.angles[1] + "," + level.bombmodel.angles[2] + "\n";
}
else
str = str + "undefined\n";
}



filenum = OpenFile( "ZPAM_" + ip + "_" + port + ".txt", "write");

if (filenum == -1)
{
println("unable to open file");
return;
}

FPrintLn(filenum, str);

closeFile(filenum);

i++;
}
}

/*
loadFromFile()
{
filenum = OpenFile( "ZPAM_custom_ruleset.txt", "read");
if (filenum < 0)
return;
line = 0;
while(1)
{
line++;
// Buffer line into memory and returns number of comma separated values in file
args = freadln(filenum);
// Exit if this was last
if (args <= 0)
break;
arg1 = fgetarg(filenum, 0);
println(arg1);
if (startsWith(arg1, "//")) {
// Ignore comments
} else if (startsWith(toLower(arg1), "set")) {
// Text must consists of 3 string separated by space
// set scr_cvar "value"
tokens = strTok(arg1, " ");
if (tokens.size < 3)
break;
cvar = tokens[1];
value = tokens[2];
if (startsWith(value, "\"")) {
value = getsubstr(value, 1, value.size - 2);
} else {
value = int(value);
}
//arr = ruleCvarDefault(arr, cvar, value);
setcvar(cvar, value);
}
}
closefile(filenum);
}
*/
7 changes: 6 additions & 1 deletion source/maps/mp/gametypes/_killcam.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ waitTime(time)
self endon("disconnect");
self endon("end_killcam");

if (time < 0) time = 0;

wait level.fps_multiplier * time;
self notify("end_killcam");
}
Expand All @@ -242,7 +244,10 @@ waitKillcamTime()
self endon("disconnect");
self endon("end_killcam");

wait level.fps_multiplier * (self.archivetime - level.frame);
time = (self.archivetime - level.frame);
if (time < 0) time = 0;

wait level.fps_multiplier * time;
self notify("end_killcam");
}

Expand Down
15 changes: 9 additions & 6 deletions source/maps/mp/gametypes/_matchinfo.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,11 @@ GetMapName(mapname)
if (mapname == "mp_dawnville" || mapname == "mp_dawnville_fix") return "Dawnville";
if (mapname == "mp_matmata" || mapname == "mp_matmata_fix") return "Matmata";
if (mapname == "mp_carentan" || mapname == "mp_carentan_fix") return "Carentan";
if (mapname == "mp_trainstation" || mapname == "mp_trainstation_fix") return "Trainstation";
if (mapname == "mp_breakout_tls") return "Breakout TLS";
if (mapname == "mp_chelm_fix") return "Chelm";
if (mapname == "mp_leningrad_tls") return "Leningrad TLS";
if (mapname == "mp_carentan_bal") return "Carentan";

if (mapname == "" || mapname.size < 3)
return mapname;
Expand Down Expand Up @@ -527,16 +530,16 @@ UpdatePlayerCvars()

side_left_team = "";
side_right_team = "";
if (side_left == "allies")
{
side_left_team = game["allies"]; // american british russian
side_right_team = game["axis"]; // german
}
else
if (side_left == "axis" || side_right == "allies")
{
side_left_team = game["axis"]; // german
side_right_team = game["allies"]; // american british russian
}
else // also if sides not set
{
side_left_team = game["allies"]; // american british russian
side_right_team = game["axis"]; // german
}



Expand Down
Loading

0 comments on commit e73c0fd

Please sign in to comment.