PatmanSan Unlimited
eXtreme+ Modding => COD2 Tut Discussions => Topic started by: NickTheGrip on March 02, 2008, 08:36:09 pm
-
Help
(I am sure you NEVER hear that)
I am one of the admins for a server (COD2) that currently uses the 2.2 version
I am pulling my hari out trying to add flag caps and returns to my stats. I know the normal log file does not have that but I developed the code to insert into the cft.gsc file to get it to print. The problem is when I rebuild my Extreme2.2.iwd file the game no longer 'sees' it and simply boots to the normal COD2 multiplayer screen
any help would be greatly appreciated
Nick The Grip
Admin LCGExtreme gaming squad
-
Ok, slightly confused *L*
Any more info m8?
-
Well I will try my best
My clan runs X2.2 and they want stats on caps and returns like the old UO days. The problem is COD2 does not write caps and returns to the log file mp_games.log like UO did.
So I started looking though the code and eventually found buried in the file ctf.gsc the code that determines the flag handling. I wrote some code to add in there to write to the log file and after some go around with the syntax got it to work and write to the log file, i think.
The problem is when i put the ctf.gsc back into the extremev2.2.iwd file it seems to corrupt it and now when I start my server back up with the mod it wont access the extreme mod file. It just pops up into the normal unmodded start up screen (listen server, not dedicated). I am trying this out on my m/c at home because I dont want to screw up the gameservers server we have for the squad.
Is there a specific way you have to rebuild the .iwd file. I changed it over to zip filetype and extracted everything, made the change to ctf.gsc then rezipped it and changed the extension back to .iwd
Any help would be appreciated
-
Ok, think I gotcha now. Wanna post the code you wrote?
-
Ok, the file I modified is found in the extreme .iwd file in the following location
maps\mp\gametypes\ctf.gsc
under the main object flag() this was the old code:
if(isdefined(other.flag)) // Captured flag
{
println("CAPTURED THE FLAG!");
Right after that I added
// BEGIN NICKCODE
lpothernum = other getEntityNumber();
lpotherguid = other getGuid();
lpothername = other.name;
lpotherteam = other.pers["team"];
logPrint("A;" + lpotherguid + ";" + lpothernum + ";" + lpotherteam + ";" + lpothername + ";" + "ctf_captured" + "\n");
// END NICKCODE
I did the same for a return
Its hard to read here so here is a link to the file on my website
http://thegripweb.aowc.net/user/119455/files/ctf.gsc
I hope this helps.
NickI
-
This works:
if(self.atbase)
{
if(isdefined(other.flag)) // Captured flag
{
println("CAPTURED THE FLAG!");
friendlyAlias = "ctf_touchcapture";
enemyAlias = "ctf_enemy_touchcapture";
if(self.team == "axis")
enemy = "allies";
else
enemy = "axis";
thread playSoundOnPlayers(friendlyAlias, self.team);
thread playSoundOnPlayers(enemyAlias, enemy);
thread printOnTeamFIXED (&"MP_CTFB_ENEMY_FLAG_CAPTURED", self.team, other);
thread printOnTeamFIXED (&"MP_CTFB_YOUR_FLAG_WAS_CAPTURED", enemy, other);
other.flag returnFlag();
other detachFlag(other.flag);
other.flag = undefined;
other.statusicon = "";
other.score += level.ex_ctfpoints_playercf;
if(level.ex_ranksystem && !level.ex_score) other.pers["special"]+= level.ex_ctfpoints_playercf;
teamscore = getTeamScore(other.pers["team"]);
teamscore += level.ex_ctfpoints_teamcf;
setTeamScore(other.pers["team"], teamscore);
level notify("update_teamscore_hud");
lpselfnum = other getEntityNumber();
lpselfguid = other getGuid();
logPrint("A;" + lpselfguid + ";" + lpselfnum + ";" + other.name + ";" + "ctf_captured_flag" + "\n");
checkScoreLimit();
}
}