PDA

View Full Version : CoD4 - basics



BlancO
20th September 2013, 14:08
I've got some (maybe dumb) questions about CoD4.

1. How to save console_mp.log file?

I've got this in my .cfg:


set g_logsync "1"
set logfile "2"
set g_log "games_mp.log"


2. What is .ff file for? When should I update it to new one? (After every change in script, after new images file etc.)

3. What should I check when I want to build mod? (Mod Builder)
http://screenshu.com/static/uploads/temporary/js/g8/pw/h1hdx8.jpg

4. Do I need to select .csv and .gsc files? (Mod Builder)
http://screenshu.com/static/uploads/temporary/a9/qj/bw/pvgvqu.jpg

5. When I create graphic, do I need to create sth like materials (like in CoD2 - images & materials)?

6. Is it OK if I upload polish files on server? (I mean "zone/polish" and "main/localized_polish_iw*.iwd") If no where I can find english ones?

7. I heard something about 1.7a patch. What's the difference between 1.7?

8. Do I need a protection like "q3dirtravfix.so" in CoD2?

9. Is there a way to decompile .ff file?

10. How to disable shot-through walls?


Thanks in advance, BlancO ;)

Tally
20th September 2013, 14:46
I've got some (maybe dumb) questions about CoD4.

1. How to save console_mp.log file?

I've got this in my .cfg:


set g_logsync "1"
set logfile "2"
set g_log "games_mp.log"


2. What is .ff file for? When should I update it to new one? (After every change in script, after new images file etc.)

3. What should I check when I want to build mod? (Mod Builder)
http://screenshu.com/static/uploads/temporary/js/g8/pw/h1hdx8.jpg

4. Do I need to select .csv and .gsc files? (Mod Builder)
http://screenshu.com/static/uploads/temporary/a9/qj/bw/pvgvqu.jpg

5. When I create graphic, do I need to create sth like materials (like in CoD2 - images & materials)?

6. Is it OK if I upload polish files on server? (I mean "zone/polish" and "main/localized_polish_iw*.iwd") If no where I can find english ones?

7. I heard something about 1.7a patch. What's the difference between 1.7?

8. Do I need a protection like "q3dirtravfix.so" in CoD2?

9. Is there a way to decompile .ff file?


Thanks in advance, BlancO ;)

Wow, a lot of questions. Let's try to tackle them:

1. To create console_mp.log file, put this in your server config file:


set logfile "2"

2. fastfiles are the compression format used by XBOX 360. Infinity Ward decided to use it for PC also because it makes the game load faster than using RAW files.

3. You have it about right for mod builder. Personally, I don't use mod builder, even though I helped write it (I did the very first version of it. It was then taken over by Mike Denny for IW), because I prefer using batch files to create my mod.ff file.

4. You select everything that you want copied over from your mod folder to your mod tools RAW folder. There are batch commands in the EXE which simply copy all your files over from your mod folder to the raw folder. Similar to this:


xcopy english ..\..\raw\english /SY
xcopy fx ..\..\raw\fx /SY
xcopy images ..\..\raw\images /SY
xcopy maps ..\..\raw\maps /SY
xcopy materials ..\..\raw\materials /SY
xcopy mp ..\..\raw\mp /SY
xcopy openwarfare ..\..\raw\openwarfare /SY
xcopy sound ..\..\raw\sound /SY
xcopy soundaliases ..\..\raw\soundaliases /SY
xcopy ui_mp ..\..\raw\ui_mp /SY
xcopy vision ..\..\raw\vision /SY
xcopy xanim ..\..\raw\xanim /SY
xcopy xmodel ..\..\raw\xmodel /SY
xcopy xmodelparts ..\..\raw\xmodelparts /SY
xcopy xmodelsurfs ..\..\raw\xmodelsurfs /SY
xcopy weapons ..\..\raw\weapons /SY
xcopy animtrees ..\..\raw\animtrees /SY


If you don't check an item, it wont get copied over to the raw file, and as such, the latest version of your file wont get compiled into mod.ff

You DO NOT have to compile .GSC files while you are busy developing. The game will read .GSC files from RAW status. Simply put them in your IWD file like you did for COD2 while you are writing your code. Only when it is finalised do you need to compile it into fastfile.

The only files which MUST BE COMPILED into mod.ff are the following:

1. menu files
2. materials files
3. .CSV files
4. xmodel/xanim/xmodelparts/etc f
5. .EFX files

These will NOT be read in RAW state by the game. So, don't try to run the game with them in your IWD file, as they will be completely ignored by the game, as if they weren't there.

5. You create a materials files for COD4 just like you did for COD2, for every single image you want to show in your mod. But don't use COD2 materials files in COD4, as they are a different version number. The game wont crash, but you wont see any images as the version is out of date.

6. If your server is running a Polish version of COD4, then of course you can use Polish files on the server. However, if the server is running English language, you MUST use english, otherwise your fonts wont be parsed properly.

7. the 1.7a patch is an "unofficial" patch which fixes a "denial of service" (DOS) vulnerability in 1.7.

8. I'm not familiar with "q3dirtravfix.so" so I can't answer that question.

9. There are decompilers for .FF files, but they only work for the text-based files in a .FF file (no menu files unfortunately). A programmer by the name of Tom BMX is working on a complete decompiler but it has not been released yet. If you want the text-based decompiler, please PM me and I will send one to you. I wont put it up for download as an attachment, because the status of decompilers is very controversial because it basically allows any noob to steal your code work. This has not gone down too well with some modders, who feel the program is a tool to be used by plagiarists.

BlancO
22nd September 2013, 15:59
1. I've already have logfile "2". I can't see the log file. (Should it be in fs_game?)

.sh start file


cd /home/cod4/server
LD_LIBRARY_PATH="/home/libcod/mysql" LD_PRELOAD="/home/libcod/libcod4_1_7.so" ./cod4_lnxded +set dedicated "2" +set net_port "28961" +set fs_basepath "/home/cod4/server" +set fs_game "mods/nl_zom" +exec zom.cfg +map_rotate


.cfg file


set rcon_password "testtest"
set sv_hostname "^4`^9nL^4.^7Zombies^4*"
set g_allowvote "0"
set sv_pure "1"
set developer "0"
set g_password ""
set sv_floodProtect "1"
set sv_maxPing "0"
set scr_drawfriend "1"
set scr_forcerespawn "0"
set scr_killcam "1"
set scr_teambalance "0"
set sv_timeout "60"
set sv_kickBanTime "300"
set g_no_script_spam "1"
set g_antilag "1"
set sv_voice "0"
set com_hunkmegas "512"
set sv_punkbuster "1"

set sv_maxclients "24"
set sv_privateclients "0"
set sv_privatePassword ""

set logfile "2"

set sv_mapRotationCurrent ""
set sv_MapRotation "gametype dm map mp_crash"



2. Where can I get 1.7a patch?

3. "q3dirtravfix.so" fixes that player can't download gsc files from a server by command "/download mod\maps\mp\gametypes\tdm.gsc"

4. How to disable shot-through walls?

kung foo man
22nd September 2013, 17:10
1) Yea, it's in fs_game but I can't see why it's working in some servers and others not by config :S

3) set sv_allowDownload 0 isn't enough for CoD4? Only the www-download needs to be enabled on CoD2.

Tally
22nd September 2013, 18:15
1. I've already have logfile "2". I can't see the log file. (Should it be in fs_game?)

.sh start file


cd /home/cod4/server
LD_LIBRARY_PATH="/home/libcod/mysql" LD_PRELOAD="/home/libcod/libcod4_1_7.so" ./cod4_lnxded +set dedicated "2" +set net_port "28961" +set fs_basepath "/home/cod4/server" +set fs_game "mods/nl_zom" +exec zom.cfg +map_rotate


.cfg file


set rcon_password "testtest"
set sv_hostname "^4`^9nL^4.^7Zombies^4*"
set g_allowvote "0"
set sv_pure "1"
set developer "0"
set g_password ""
set sv_floodProtect "1"
set sv_maxPing "0"
set scr_drawfriend "1"
set scr_forcerespawn "0"
set scr_killcam "1"
set scr_teambalance "0"
set sv_timeout "60"
set sv_kickBanTime "300"
set g_no_script_spam "1"
set g_antilag "1"
set sv_voice "0"
set com_hunkmegas "512"
set sv_punkbuster "1"

set sv_maxclients "24"
set sv_privateclients "0"
set sv_privatePassword ""

set logfile "2"

set sv_mapRotationCurrent ""
set sv_MapRotation "gametype dm map mp_crash"



2. Where can I get 1.7a patch?

3. "q3dirtravfix.so" fixes that player can't download gsc files from a server by command "/download mod\maps\mp\gametypes\tdm.gsc"

4. How to disable shot-through walls?

4. You cannot disable Deep Impact perk unless you have a mod, and run unranked server. You can't disable any perks if you run a ranked server. If you have a mod, it would be disabled by the dvar command that the mod maker created for that particular perk. With the modwarfare mod (the mod provided with the game), the dvar is:


set perk_allow_speciality_bulletpenetration "0"

BlancO
22nd September 2013, 20:54
1. Finally, I found console_mp.log. It was in "/root/.callofduty4/mods/nl_zom". To repair it I had to set homepath.



+set fs_homepath "/home/cod4/server"


3. After setting "set sv_allowDownload 0", all files will be downloaded from site and there won't be posibility to download gsc files?

4. Do You think it will be good?

- check BulletTrace on damage
- possibly return if player is behind the wall

Tally
22nd September 2013, 21:49
1. Finally, I found console_mp.log. It was in "/root/.callofduty4/mods/nl_zom". To repair it I had to set homepath.



+set fs_homepath "/home/cod4/server"


3. After setting "set sv_allowDownload 0", all files will be downloaded from site and there won't be posibility to download gsc files?

4. Do You think it will be good?

- check BulletTrace on damage
- possibly return if player is behind the wall

1. I'm not sure of your problem, but I get the impression you are trying to run a server from the COD4 "main" folder (hence why you weren't looking in your mod folder). Mods WILL NOT RUN in the "main" folder. IW have restricted all mods to only work in mod folders (i.e fs_game folders). So, you cannot mod a ranked game in any way. The game will simply ignore any mod files you put in the "main" folder, as if they weren't even there; they will be invisible to a ranked game.

If I have misunderstood you on this, then I apologise.

3. You can stop GSC files downloading in 2 ways:

1. put them in a raw folder on your server. They wont download to anyone as raw folders don't download to clients;
2. Put them in an IWD file, with "_svr_" in the IWD file name. Just like in COD 1 1.5 and COD UO. IWDs with "_svr_" in their name don't download to clients.

4. You cannot stop Deep Impact with any kind of physics trace (bullteTrace or otherwise) to return on if found because it is hard coded. Where would you put the code? What file? There isn't one!

The only way of restricting perks from a player's saved class data is by intercepting them on the class loadout ( maps\mp\gametypes\_class::giveloadout() ). There is a function there to set any perks on the player. Simply intercept Deep Impact at that function and unsetPerk() on the player if Deep Impact is found. You wont be able to take it out of their saved class data, but it will stop them being able to use Deep Impact during a game.

Peterlankton
22nd September 2013, 22:08
3. You can stop GSC files downloading in 2 ways:

1. put them in a raw folder on your server. They wont download to anyone as raw folders don't download to clients;
2. Put them in an IWD file, with "_svr_" in the IWD file name. Just like in COD 1 1.5 and COD UO. IWDs with "_svr_" in their name don't download to clients.


Maybe I am wrong on this, but I think the q3dirtrav was not fixed by IW in CoD4. So it's basically possible to download any file from the main folder of the server and from the fs_game folder as well, including gscs. Also, at least in CoD2 you can, as a client, simply hex-edit your multiplayer .exe and change the part with '_svr_' to for example '_sxr_' and the client downloads that .iwd automatically.

Tally
22nd September 2013, 22:53
Maybe I am wrong on this, but I think the q3dirtrav was not fixed by IW in CoD4. So it's basically possible to download any file from the main folder of the server and from the fs_game folder as well, including gscs. Also, at least in CoD2 you can, as a client, simply hex-edit your multiplayer .exe and change the part with '_svr_' to for example '_sxr_' and the client downloads that .iwd automatically.

Yeah, but you are talking about hacking. I am talking about normal users who don't hack. With a hack, you can do anything - break into secure sites, steal money, steal a persons whole identity, the lot. I am talking about ordinary law-abiding citizens who don't resort to hacking. So, excuse me for not talking about the exceptions to the rule. I just talk about normal functions of cod games, and with normal functions, raw folders don't download, and neither do IWD files with _svr_ in their name.

BlancO
22nd September 2013, 23:42
I don't want to run server from main folder. After setting "+set fs_homepath "/home/cod4/server"" console_mp.log is in fs_game folder so I think it's ok.

Will the "q3dirtravfix.so" from CoD2 work in CoD4?

What if I will check bullettrace before calling damage function?



/*================
Called when a player has taken damage.
self is the player that took damage.
================*/
CodeCallback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset)
{
// Check for bulletTrace
...
...
...

if(trace)
return;
//

self endon("disconnect");
[[level.callbackPlayerDamage]](eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset);
}

Tally
23rd September 2013, 00:33
I don't want to run server from main folder. After setting "+set fs_homepath "/home/cod4/server"" console_mp.log is in fs_game folder so I think it's ok.

Will the "q3dirtravfix.so" from CoD2 work in CoD4?

What if I will check bullettrace before calling damage function?



/*================
Called when a player has taken damage.
self is the player that took damage.
================*/
CodeCallback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset)
{
// Check for bulletTrace
...
...
...

if(trace)
return;
//

self endon("disconnect");
[[level.callbackPlayerDamage]](eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset);
}


What do you mean what if you check bullettrace before calling damage? What are you trying to do? If you are trying to stop Deep Impact/specialty_bulletpenetration, it wont work. You can't intercept the depth of impact of Deep Impact because, as I said, it is hard coded, and it's done in the engine, not in script. The only perks which are done in script are:

specialty_bulletdamage
specialty_armorvest
specialty_explosivedamage

The script for handling those perks can be found in maps\mp\gametypes\_class::cac_modified_damage(). All the other perks are done in the engine, and they are hard coded.

IzNoGoD
23rd September 2013, 07:05
Cant it be that the bulletpenetration is a property of the weaponfile, so you can edit the weaponfile to set something like "wallpenetration" to 0? (never did cod4, but this seems logical...)

serthy
23rd September 2013, 08:41
Cant it be that the bulletpenetration is a property of the weaponfile, so you can edit the weaponfile to set something like "wallpenetration" to 0? (never did cod4, but this seems logical...)

bulletpen can be influenced by a file its sth like hitloc table and i guess itrs in the mp folder
there you can set different penetration depths for the surfaces

or you check if the if( iDFlags & level.iDFlags_Bulletpen ) and change it there in CodeCallback_PlayerDamage

just a guess

Tally
23rd September 2013, 08:50
Cant it be that the bulletpenetration is a property of the weaponfile, so you can edit the weaponfile to set something like "wallpenetration" to 0? (never did cod4, but this seems logical...)

No, there is no such weapon setting.

Tally
23rd September 2013, 08:55
bulletpen can be influenced by a file its sth like hitloc table and i guess itrs in the mp folder
there you can set different penetration depths for the surfaces

or you check if the if( iDFlags & level.iDFlags_Bulletpen ) and change it there in CodeCallback_PlayerDamage

just a guess

I've never seen such a file, and I have a set of raw files which was given to me by the developers. It has EVERY file used in COD4. But, I guess there could always be one file they missed. Could you pass one to me please?

Also, there is no such flag as level.iDFlags_Bulletpen. But having had a look through callback_playerdamage, I found there is one such flag relating to Deep Impact:

eInflictor.wasDamagedFromBulletPenetration

But that only relates to C4 for some reason. However, having said that, that would be the flag that someone wishing to intercept Deep Impact would need to work on. But I seem to remember someone saying that you can't intercept damage from wasDamagedFromBulletPenetration. But that might have been because they were lame and didn't really know what they were doing. So, I guess the question is still open, and someone may find a solution to it.

serthy
23rd September 2013, 12:28
raw/info/bullet_penetration_mp

i would suggest to simply spawn a bot behind a wall, and shoot at him and print the iDFlags in callback_playerdamage, if it stays at 0, you have to use bulletTraces to check for this, otherwise check for this flag

BlancO
23rd September 2013, 13:33
Thx, serthy!

If bullet went through wall then iDFlags = 8.

Just edit _callbacksetup.gsc to disable it.



CodeCallback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset)
{
if(iDFlags == 8)
return;

self endon("disconnect");
[[level.callbackPlayerDamage]](eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset);
}


About "q3dirtravfix.so" - it prevents from downloading files from server with other extensions than .iwd and .pk3. So I think It won't work in CoD4 because there are .ff files too. So do You know another way to protect your .gsc files?

kung foo man
23rd September 2013, 13:51
What's the problem with: set sv_allowDownload 0?

BlancO
23rd September 2013, 14:10
Players won't be able to download mods.

randall
23rd September 2013, 14:20
set sv_wwwDownload "1"
set sv_allowdownload "0"
seta sv_wwwBaseURL "http://"
set sv_wwwDLDisconnected "0"

BlancO
23rd September 2013, 14:23
What if player don't want to downlod mod from www? (set cl_wwwDownload 0)

Peterlankton
23rd September 2013, 16:00
What if player don't want to downlod mod from www? (set cl_wwwDownload 0)

I think nobody on earth is interested in downloading any files with 12kb/s. So don't worry about that.

iCore
8th October 2013, 17:54
The set sv_allowDownload "0" that you advice is ONLY a solution in CoD2. In CoD4 if you set sv_allowDownload to 0, then nor wwwDownload will work! So in CoD4 you HAVE TO set allowDownload to 1. If you want to protect your files, then the best you can do is using the serverfile of Ninja, which fixes q3dirtrav attacks. If you can't use his one, then maybe my writing about it can help you HERE (www.moddb.com/tutorials/steal-protection).

Tally
9th October 2013, 13:48
The set sv_allowDownload "0" that you advice is ONLY a solution in CoD2. In CoD4 if you set sv_allowDownload to 0, then nor wwwDownload will work! So in CoD4 you HAVE TO set allowDownload to 1. If you want to protect your files, then the best you can do is using the serverfile of Ninja, which fixes q3dirtrav attacks. If you can't use his one, then maybe my writing about it can help you HERE (www.moddb.com/tutorials/steal-protection).

Very nice write up on stopping the hacks on COD4 servers. Thank you!