Skip to content

Commit

Permalink
zPAM3.21
Browse files Browse the repository at this point in the history
Bugs fixed:
- Updated Toujane FIX to version 2 - fixed link wall vault - https://youtu.be/DuoJOrDeaaM
- PAM installations checks - on some servers it says installation error even if installed correctly -> fixed

Update of existing:
- [3.3.10] Match info - ingame info with team names and score visibility is turned off by default now
- Strat - players are now spawned by SD spawn positions, not DM spawn positions - this make vallente map working in strat
  • Loading branch information
eyza-cod2 committed May 16, 2021
1 parent c7d5fa2 commit f0bea94
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ gsc_changes.txt
zpam_changes.txt
what_to_test.txt
source_compiled
/zpam320.iwd
/zpam321.iwd
50 changes: 34 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

Mod zPAM3.20 is new version of PAM mode for COD2.<br>
Mod zPAM3.21 is new version of PAM mode for COD2.<br>

The code form previous zPAM 2.07 version is completely rewritten and ported to new code base, which helped in the implementation of new features and bug fixes.

Expand All @@ -9,10 +9,11 @@ Work on this pam was iniciated by me in 2015 a was not never fully finished. In

## Download
- Actual version:
- 2021/05/05 - <b><a href="https://github.com/eyza-cod2/zpam3/raw/master/zpam320.zip">zPAM 3.20</a></b>
- 2021/05/16 - <b><a href="https://github.com/eyza-cod2/zpam3/raw/master/zpam321.zip">zPAM 3.21</a></b>


- Previous versions:
- 2021/05/05 - <b><a href="https://github.com/eyza-cod2/zpam3/tree/c7d5fa259e6e21a7fc510847421fab5338f19d0d">zPAM 3.20</a></b>
- 2021/01/05 - <b><a href="https://github.com/eyza-cod2/zpam3/tree/a365aa9d884f87a368e51879b016157b431ee449">zPAM 3.1 BETA 6</a></b></b>
- 2020/11/29 - <b><a href="https://github.com/eyza-cod2/zpam3/tree/b3e8711b13b493134ec1c762aeba17399eefb95d">zPAM 3.1 BETA 5</a></b></b>
- 2020/09/24 - <b><a href="https://github.com/eyza-cod2/zpam3/tree/2d3e3589dced881409bd42d2c5c500cc6ed3e0a1">zPAM 3.1 BETA 4</a></b></b>
Expand All @@ -22,6 +23,20 @@ Work on this pam was iniciated by me in 2015 a was not never fully finished. In


## Changelog
<details><summary>zPAM 3.21 changes (click to open)</summary>
<p>

#### Bugs fixed:
- Updated Toujane FIX to version 2 - fixed link wall vault - https://youtu.be/DuoJOrDeaaM
- PAM installations checks - on some servers it says installation error even if installed correctly -> fixed

#### Update of existing:
- [3.3.10] Match info - ingame info with team names and score visibility is turned off by default now
- Strat - players are now spawned by SD spawn positions, not DM spawn positions - this make vallente map working in strat
</p>
</details>


<details><summary>zPAM 3.20 changes (click to open)</summary>
<p>

Expand Down Expand Up @@ -66,33 +81,35 @@ r_polygonOffsetScale and r_polygonOffsetBias warning appears even if they were c
- [3.3.19] Bash mode - message is printed if it is bash round; map is not restarted after bash is over
- [3.3.26] Prone-peek is now processed better and is enabled by default. (400m delay is added only if pronepeek-able wall / conver is detected instead of adding it every time)
- [3.4.14] Strat time was set to 6 seconds for cg and cg_mr12 pam modes
Diagonal fix was removed
- Diagonal fix was removed
</p>
</details>


## Installation
- Download <b><a href="https://github.com/eyza-cod2/zpam3/raw/master/zpam320.zip">zPAM 3.20</a></b> and extract folders with files into following locations:
- Download <b><a href="https://github.com/eyza-cod2/zpam3/raw/master/zpam321.zip">zPAM 3.21</a></b> and extract folders with files into following locations:
- ./pb/pbsvuser.cfg
- ./main/zpam320.iwd
- ./main/mp_toujane_fix_v1.iwd
- ./main/zpam321.iwd
- ./main/mp_toujane_fix_v2.iwd
- ./main/mp_burgundy_fix_v1.iwd
- ./main/server.cfg


- Notes:
- When your server is runned, you may get an error message saying "PAM is not installed correctly". To fix this error, follow instructions in [Troubleshooting](#troubleshooting) section
- <i>mp_toujane_fix_v1.iwd</i> and <i>mp_burgundy_fix_v1.iwd</i> are fixed version of original maps - these files needs to be included with PAM, more info in [Questions & Answers](#questions--answers) section
- <i>mp_toujane_fix_v2.iwd</i> and <i>mp_burgundy_fix_v1.iwd</i> are fixed version of original maps - these files needs to be included with PAM, more info in [Questions & Answers](#questions--answers) section
- Toujane FIX changes: https://github.com/eyza-cod2/mp_toujane_fix
- Burgundy FIX changes: https://github.com/eyza-cod2/mp_burgundy_fix.
- <i>server.cfg</i> - exec this file for fast server configuration and in case you are running a public server (+exec server)
- you have to enable downloading via cvar <i>sv_wwwDownload 1</i> and specify a download url via cvar <i>sv_wwwBaseURL "url"</i>; if you dont have any, you can use <i>sv_wwwBaseURL "http://cod2x.me/zpam320"</i> (this is to make sure fixed maps are downloaded in fast way for players)
- you have to enable downloading via cvar <i>sv_wwwDownload 1</i> and specify a download url via cvar <i>sv_wwwBaseURL "url"</i>; if you dont have any, you can use <i>sv_wwwBaseURL "http://cod2x.me/zpam321"</i> (this is to make sure fixed maps are downloaded in fast way for players)


## Contact
Write message on discord <b>LetsPlay Europe</b> in <b>#cod2-zpam-3</b> channel.<br>
Or add me on discord <b>eyza#7930</b><br>
Or write me on email <b>[email protected]</b><br>
<br>
Supporters: askeslav, tomik, cokY, Sk1lzZ, YctN, kebit, foxbuster, <==Mustang==>Clan from Hungary
Supporters: askeslav, tomik, cokY, Sk1lzZ, YctN, kebit, foxbuster, <==Mustang==>Clan from Hungary, hubertgruber / dutch, excel
<br><br>
Please support this work on my Paypal -> https://paypal.me/kratasy
<br>
Expand All @@ -101,7 +118,7 @@ Please support this work on my Paypal -> https://paypal.me/kratasy

## Questions & Answers

### What is Toujane FIX (mp_toujane_fix_v1) and Burgundy FIX (mp_burgundy_fix_v1)
### What is Toujane FIX (mp_toujane_fix_v2) and Burgundy FIX (mp_burgundy_fix_v1)
These are recompiled version of original maps that contains a bug fixes.
List of all changes are available in these repositories: [mp_toujane_fix](https://github.com/eyza-cod2/mp_toujane_fix), [mp_burgundy_fix](https://github.com/eyza-cod2/mp_burgundy_fix).
Other maps will follow in next release.<br>
Expand Down Expand Up @@ -311,30 +328,31 @@ Example: "autorecording_1|matchinfo_1|score_0|playersleft_1"
## Known bugs
- When quick messages menu is opened, auto-recording will not start (its not able to close quick messages menu via pam)
- You cannot take screenshot of new scoreboard via F12 (in menu binds are not working)
- When you spawn a bot in strat, this bot will occupy player slot on server even if the bot is kicked; server restart is needed then

<br>
<br>

## Troubleshooting
### Error "zPAM is not installed correctly"
#### Iwd file zpam320.iwd must be installed in main folder. (fs_game)
- From version 3.20, all iwd files have to be installed in main folder.
#### Iwd file zpam321.iwd must be installed in main folder. (fs_game)
- From version 3.21, all iwd files have to be installed in main folder.
This is because of bug that cvars / settings changed in game are not saved into the config when running a game with fs_game set.
Make sure cvar /fs_game is empty and iwd files are placed in main folder.

#### Error while getting loaded iwd files. Make sure iwd files does not contains spaces.
- PAM was not able to parse loaded iwd files. Some of the iwd files have probably name with spaces.

#### Iwd file mp_toujane_fix_v1.iwd must be installed in main folder<br>Iwd file mp_burgundy_fix_v1.iwd must be installed in main folder
#### Iwd file mp_toujane_fix_v2.iwd must be installed in main folder<br>Iwd file mp_burgundy_fix_v1.iwd must be installed in main folder
- From version 3.20, fixed versions of some maps are available. PAM is forcing to include these files to make sure maps are available on every server.

#### WWW downloading must be enabled. Set sv_wwwDownload and sv_wwwBaseURL
- You have to enable www downloading via cvar /sv_wwwDownload 1 and specify a download url via cvar /sv_wwwBaseURL "url".
- If you dont have any url, you can use /sv_wwwBaseURL "http://cod2x.me/zpam320"
- If you dont have any url, you can use /sv_wwwBaseURL "http://cod2x.me/zpam321"
- This is to make sure fixed maps are downloaded in fast way for players

#### Old pam detected in main folder. Delete following iwd file:
- Your main folder contains also a other versions of pam. Delete all .iwd files with prefix "zpam".
#### Old pam / maps detected in main folder. Delete iwd file you see above.
- Your main folder contains also a other versions of pam or maps. Delete all .iwd files that the game prints on screen.



Expand Down
25 changes: 9 additions & 16 deletions source/maps/mp/gametypes/_matchinfo.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,15 @@ onConnected()
// Ingame match info bar
if (!isDefined(self.pers["matchinfo_ingame"]))
{
// By default show match info ingame
self.pers["matchinfo_ingame"] = true;
self.pers["matchinfo_ingame_visible"] = true;
self.pers["matchinfo_showedForSpectator"] = false;
// By default show match info ingame
self.pers["matchinfo_ingame"] = false;
self.pers["matchinfo_ingame_visible"] = false;
self.pers["matchinfo_showedForSpectator"] = false;

// Show really only if enabled by rules
if (game["scr_matchinfo"] > 0)
{
self setClientCvarIfChanged("ui_matchinfo_ingame_show", "1");
}
else
{
self setClientCvarIfChanged("ui_matchinfo_ingame_show", "0");
self setClientCvarIfChanged("ui_matchinfo_ingame_team1_sideColor", ""); // bg elements cannot be dependend on _show cvar, needs to be set separately
self setClientCvarIfChanged("ui_matchinfo_ingame_team2_sideColor", "");
}
// always hide ingame bar on first connect - if is enabled by settings, it will be showed later
self setClientCvarIfChanged("ui_matchinfo_ingame_show", "0");
self setClientCvarIfChanged("ui_matchinfo_ingame_team1_sideColor", ""); // bg elements cannot be dependend on _show cvar, needs to be set separately
self setClientCvarIfChanged("ui_matchinfo_ingame_team2_sideColor", "");
}


Expand Down Expand Up @@ -465,7 +458,7 @@ ToUpper(char)

GetMapName(mapname)
{
if (mapname == "mp_toujane" || mapname == "mp_toujane_fix_v1") return "Toujane";
if (mapname == "mp_toujane" || mapname == "mp_toujane_fix_v2") return "Toujane";
if (mapname == "mp_burgundy" || mapname == "mp_burgundy_fix_v1") return "Burgundy";
if (mapname == "mp_dawnville" || mapname == "mp_dawnville_fix") return "Dawnville";
if (mapname == "mp_matmata" || mapname == "mp_matmata_fix") return "Matmata";
Expand Down
2 changes: 1 addition & 1 deletion source/maps/mp/gametypes/_menu_map.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ init()
map["mp_toujane"] = 13;
map["mp_trainstation"] = 14;

map["mp_toujane_fix_v1"] = true;
map["mp_toujane_fix_v2"] = true;
map["mp_burgundy_fix_v1"] = true;
map["mp_dawnville_fix"] = true;
map["mp_matmata_fix"] = true;
Expand Down
2 changes: 1 addition & 1 deletion source/maps/mp/gametypes/_pam.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ init()
{
if(game["firstInit"])
{
precacheString2("STRING_VERSION_INFO", &"zPAM 3.20"); // ZPAM_RENAME
precacheString2("STRING_VERSION_INFO", &"zPAM 3.21"); // ZPAM_RENAME
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/maps/mp/gametypes/_record.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ generateDemoName()
mapname = level.mapname;


if (mapname == "mp_toujane" || mapname == "mp_toujane_fix_v1") mapname = "tj";
if (mapname == "mp_toujane" || mapname == "mp_toujane_fix_v2") mapname = "tj";
else if (mapname == "mp_burgundy" || mapname == "mp_burgundy_fix_v1") mapname = "bg";
else if (mapname == "mp_dawnville" || mapname == "mp_dawnville_fix") mapname = "dw";
else if (mapname == "mp_matmata" || mapname == "mp_matmata_fix") mapname = "mat";
Expand Down
60 changes: 34 additions & 26 deletions source/maps/mp/gametypes/global/pam.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ init()

// Errors
precacheString2("STRING_PAM_DONT_STEAL", &"This version of pam is only for testing! Dont steal!");
precacheString2("STRING_PAM_MUST_EXISTS_UNDER_MAIN", &"Iwd file ^9zpam320.iwd^7 must be installed in ^9main^7 folder. (fs_game)"); // ZPAM_RENAME
precacheString2("STRING_PAM_MUST_EXISTS_UNDER_MAIN", &"Iwd file ^9zpam321.iwd^7 must be installed in ^9main^7 folder. (fs_game)"); // ZPAM_RENAME
precacheString2("STRING_PAM_GETTING_IWD_FILES_ERROR", &"Error while getting loaded iwd files. Make sure iwd files does not contains spaces.");
precacheString2("STRING_PAM_TOUJANE_FIX_MISSING", &"Iwd file ^9mp_toujane_fix_v1.iwd^7 must be installed in ^9main^7 folder");
precacheString2("STRING_PAM_TOUJANE_FIX_MISSING", &"Iwd file ^9mp_toujane_fix_v2.iwd^7 must be installed in ^9main^7 folder");
precacheString2("STRING_PAM_BURGUNDY_FIX_MISSING", &"Iwd file ^9mp_burgundy_fix_v1.iwd^7 must be installed in ^9main^7 folder");
precacheString2("STRING_PAM_WWW_DOWNLOADING", &"WWW downloading must be enabled. Set ^9sv_wwwDownload^7 and ^9sv_wwwBaseURL");
precacheString2("STRING_PAM_BLACKLIST", &"Old pam detected in ^9main^7 folder. Delete following iwd file:");
precacheString2("STRING_PAM_BLACKLIST", &"Old pam / maps detected in ^9main^7 folder. Delete iwd file you see above.");


// Help url
Expand All @@ -38,7 +38,7 @@ init()
}


level.pam_folder = "main/zpam320"; // ZPAM_RENAME
level.pam_folder = "main/zpam321"; // ZPAM_RENAME

level.pam_mode_change = false;

Expand Down Expand Up @@ -99,18 +99,12 @@ CheckInstallation()

// Wait untill sv_referencedIwds is set
// Dont know why, but sv_referencedIwds cvars is defined after 4 frames
sv_referencedIwds = "";
sv_referencedIwdNames = "";
sv_iwdNames = "";
sv_iwds = "";
while(sv_referencedIwds == "" || sv_referencedIwdNames == "" || sv_iwdNames == "" || sv_iwds == "")
{
wait level.frame;
sv_referencedIwds = getCvar("sv_referencedIwds");
sv_referencedIwdNames = getCvar("sv_referencedIwdNames");
sv_iwdNames = getCvar("sv_iwdNames");
sv_iwds = getCvar("sv_iwds");
}
wait level.fps_multiplier * 0.3; // just to be sure - on some servers cvars are set twice with different value every time

sv_referencedIwds = getCvar("sv_referencedIwds");
sv_referencedIwdNames = getCvar("sv_referencedIwdNames");
sv_iwdNames = getCvar("sv_iwdNames");
sv_iwds = getCvar("sv_iwds");

// Referenced contains only loaded iwds, but full path!
//"sv_referencedIwds" is: "-340018619 473749641 181429573 780394069 1101180720 1046874969 1053665859 -1652414412 " default: ""
Expand Down Expand Up @@ -146,6 +140,8 @@ CheckInstallation()
// Number of items is not same - may be due to spaces in iwd names!
if (fullNumbersArray.size != fullNameArray.size)
{
level thread printTextInLoop("Diagnostics info: referencedIwds", sv_referencedIwdNames, sv_referencedIwdNames, fullNumbersArray.size + "!=" + fullNameArray.size);

setError(game["STRING_PAM_GETTING_IWD_FILES_ERROR"]);
return;
}
Expand All @@ -165,6 +161,8 @@ CheckInstallation()
// Number of items is not same - may be due to spaces in iwd names!
if (numbersArray.size != nameArray.size)
{
level thread printTextInLoop("Diagnostics info: iwds", sv_iwds, sv_iwdNames, numbersArray.size + "!=" + nameArray.size);

setError(game["STRING_PAM_GETTING_IWD_FILES_ERROR"]);
return;
}
Expand All @@ -180,12 +178,13 @@ CheckInstallation()

if (!arrayContains(fullNameArray, level.pam_folder))
{
println("sv_referencedIwdNames does not contain " + level.pam_folder);
level thread printTextInLoop("Diagnostics info: sv_referencedIwdNames does not contain " + level.pam_folder);

setError(game["STRING_PAM_MUST_EXISTS_UNDER_MAIN"]);
return;
}

if (!arrayContains(nameArray, "mp_toujane_fix_v1"))
if (!arrayContains(nameArray, "mp_toujane_fix_v2"))
{
setError(game["STRING_PAM_TOUJANE_FIX_MISSING"]);
return;
Expand Down Expand Up @@ -222,6 +221,8 @@ CheckInstallation()
blackList[blackList.size] = "zpam310_beta5";
blackList[blackList.size] = "zpam310_beta6";
blackList[blackList.size] = "zpam320_test";
blackList[blackList.size] = "zpam320";
blackList[blackList.size] = "mp_toujane_fix_v1";


for(i = 0; i < blackList.size; i++)
Expand All @@ -241,15 +242,22 @@ CheckInstallation()
}


printTextInLoop(text)
printTextInLoop(line1, line2, line3, line4)
{
for(;;)
{
iprintlnbold(" ");
iprintlnbold(" ");
iprintlnbold(" ");
iprintlnbold(" ");
iprintlnbold(text);

if (!isDefined(line4)) iprintlnbold(" ");
if (!isDefined(line3)) iprintlnbold(" ");
if (!isDefined(line2)) iprintlnbold(" ");
if (!isDefined(line1)) iprintlnbold(" ");

if (isDefined(line1)) iprintlnbold(line1);
if (isDefined(line2)) iprintlnbold(line2);
if (isDefined(line3)) iprintlnbold(line3);
if (isDefined(line4)) iprintlnbold(line4);

wait level.fps_multiplier * 5;
}
}
Expand Down Expand Up @@ -309,7 +317,7 @@ setError(error)
text1.alignx = "center";
text1.aligny = "top";
text1.x = 320;
text1.y = 100;
text1.y = 200;
text1.fontscale = 1.9;
text1.alpha = 1;
text1.sort = -2;
Expand All @@ -321,7 +329,7 @@ setError(error)
text2.alignx = "center";
text2.aligny = "top";
text2.x = 320;
text2.y = 125;
text2.y = 225;
text2.fontscale = 1.4;
text2.alpha = 1;
text2.sort = -1;
Expand All @@ -333,7 +341,7 @@ setError(error)
text3.alignx = "center";
text3.aligny = "top";
text3.x = 320;
text3.y = 235;
text3.y = 255;
text3.fontscale = 1.2;
text3.alpha = 1;
text3.sort = -1;
Expand Down
25 changes: 19 additions & 6 deletions source/maps/mp/gametypes/strat.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,23 @@ onStartGameType()


// Spawn points
spawnpointname = "mp_tdm_spawn";
spawnpointname = "mp_sd_spawn_attacker";
spawnpoints = getentarray(spawnpointname, "classname");

if(!spawnpoints.size)
{
maps\mp\gametypes\_callbacksetup::AbortLevel();
AbortLevel();
return;
}
for(i = 0; i < spawnpoints.size; i++)
spawnpoints[i] placeSpawnpoint();

spawnpointname = "mp_sd_spawn_defender";
spawnpoints = getentarray(spawnpointname, "classname");
if(!spawnpoints.size)
{
AbortLevel();
return;
}
for(i = 0; i < spawnpoints.size; i++)
spawnpoints[i] PlaceSpawnpoint();

Expand Down Expand Up @@ -378,11 +386,16 @@ spawnPlayer()
}
else
{
spawnpointname = "mp_tdm_spawn";
// Select correct spawn position according to selected team
if(self.pers["team"] == "allies")
spawnpointname = "mp_sd_spawn_attacker";
else
spawnpointname = "mp_sd_spawn_defender";

spawnpoints = getentarray(spawnpointname, "classname");
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_NearTeam(spawnpoints);
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random(spawnpoints);

if(isDefined(spawnpoint))
if(isdefined(spawnpoint))
self spawn(spawnpoint.origin, spawnpoint.angles);
else
maps\mp\_utility::error("NO " + spawnpointname + " SPAWNPOINTS IN MAP");
Expand Down
Loading

0 comments on commit f0bea94

Please sign in to comment.