Post: FULL Decompress, Edit, and Recompress Patch Tutorial
12-03-2010, 01:46 AM #1
Tupac17
I ♥ COD4
(adsbygoogle = window.adsbygoogle || []).push({}); This tutorial shows you how to edit _rank.gsc. If you follow the tutorial you will not get a black screen, but you will still get syntax error if you code has errors. Please use a clean patch or a patch you know is already working when doing this.

If you want the offsets to other gscs go here You must login or register to view this content.

  1. open cmd
  2. type
        cd desktop/pack
    
    You must login or register to view this content.

  3. type
        offzip -a -z -15 patch_mp.ff ./ 0
    
    You must login or register to view this content.


4. Delete all the new created files except these (only two of them will be used in this tutorial) 0002cbcc 000295f3 00030783

5. Open0002cbcc 000295f3 in your hex editor


You must login or register to view this content.

6. In 000295f3 press
    ctrl + E
7. In the start box put
    A00D 


8. In length box put
    5FF3
9. Click okYou must login or register to view this content.

10. Press
    ctrl + C
11. Then
    Ctrl + N
12. Then
    Ctrl + V
You must login or register to view this content.


13. Now go to the 0002cbcc file

14. Press ctrl + E start offset is
    0
15. Length is
    1A9B
16. Press
    ok
17. Press
    Ctrl + C
18. Go to the end of the new file you created and press
    Ctrl+V
19. Delete all of the 00 at the end end of the file
It should look something like the picture below with the 0A at the endYou must login or register to view this content.

19. Save the file as
    rank.gsc
20. Go to your pack folder and right click on rank.gsc and open it up with notepad++ or whatever text editor you use
You must login or register to view this content.

21. Edit the file however you want

22. Save the file after you edit in and open it back up in the hex editor

23. Press
    Ctrl + E


24. In the Start offset box put
    0
25. In the length box put
    5ff3

26. Go to the
000295f3 file

27. Press
    Ctrl + E 


28.
In the Start offset box put
    A00D
29.
In the length box put
    5ff3
30. Press
    ctrl + B
to paste the selected text from rank.gsc into the selected area in 000295f3 (make sure you don't change the file size.)

31. Save
000295f3

32. Open cmd

33. type
    [FONT=Arial][SIZE=3][COLOR=Blue][COLOR=Black]cd  desktop/pack[/COLOR][/COLOR][/SIZE][/FONT]
then press enter

34. then type
    packzip -o 0x[COLOR=#000000][COLOR=#0000bb][COLOR=Black][FONT=Arial]000295f3[/FONT][/COLOR][/COLOR][/COLOR] -w -15 [COLOR=#000000][COLOR=#0000bb][COLOR=Black][FONT=Arial]000295f3[/FONT][/COLOR][/COLOR][/COLOR].dat patch_mp.ff


35. Close
000295f3 in your hex editor

36. Go to rank.gsc in your hex editor

37. Press
    Ctrl + G


38. Go to offset
    5ff3


39. Press
    Ctrl + Shift + END
40. Copy the selected text

41. Go to 0002cbcc

42. Press
    Ctrl + E 
43. Start offset is
    0
44. Length is
    1A9B
45. Press
    Ctrl + B
to paste what you copied from rank.gsc

46. Place the insertion point in right after the red lettersYou must login or register to view this content.

47. Now push
    Ctrl + E
48. Leave Start offset wherever it is at

49. In end put
    1a9b
50. Click ok

51. right click the selected area

52. Click fill selection

53. Fill with 00You must login or register to view this content.



54. Save the file

55. open cmd and type
    [FONT=Arial][SIZE=3][COLOR=Blue][COLOR=Black]cd  desktop/pack[/COLOR][/COLOR][/SIZE][/FONT]
56. then type
    packzip -o 0x0002cbcc -w -15 0002cbcc.dat patch_mp.ff
You must login or register to view this content.

Your Done!!



(adsbygoogle = window.adsbygoogle || []).push({});

The following 34 users say thank you to Tupac17 for this useful post:

.Mitch, |ManiaC|, $oulja, 8======D----, alex1994, b0snian, Dreamcather, eddydiep, Galbiy, Hawkin, ImDUB, The Epic, JamazkieHD, jammie01, jkry_2_1_, juddylovespizza, kkid423, Lofti, MaKaRoFF, maps4890, marvin1554*, Moto Cross, mtuck317, Mw2Freak13, MyNGUuserName, nandos678, CHAOZ, saudi--fantom, Sempiternal, Solid Snake, the_hack, w8t4it, xMySTiFy
12-03-2010, 03:01 AM #2
8======D----
< ^ > < ^ >
i love you (no homo)

---------- Post added at 10:01 PM ---------- Previous post was at 09:32 PM ----------

when open up the rank in notepad++ its a lot different than the cbcc.dat and theres no text to edit. like nothing. maybe because i was using a different patch?
12-03-2010, 03:05 AM #3
Tupac17
I ♥ COD4
Originally posted by K View Post
i love you (no homo)

---------- Post added at 10:01 PM ---------- Previous post was at 09:32 PM ----------

when open up the rank in notepad++ its a lot different than the cbcc.dat and theres no text to edit. like nothing. maybe because i was using a different patch?

what did the rank.gsc look like in the hex editor?

it should look kinda like the picture in step 19
12-03-2010, 03:25 AM #4
8======D----
< ^ > < ^ >
Originally posted by Tupac17 View Post
what did the rank.gsc look like in the hex editor?

it should look kinda like the picture in step 19


didnt look like that BUT i may have gone wrong because when u said to take out all the 00's at the end of the untilited thing and it should end with 0A or something mine ended with 7D and the 0A was to the left of it.
12-03-2010, 03:30 AM #5
Good post tupac
12-03-2010, 03:31 AM #6
Tupac17
I ♥ COD4
Originally posted by K View Post
didnt look like that BUT i may have gone wrong because when u said to take out all the 00's at the end of the untilited thing and it should end with 0A or something mine ended with 7D and the 0A was to the left of it.

sounds like you did that part right that means your file ended with a } which is fine... but when you save it doesnt open up in a text editor?

---------- Post added at 11:31 PM ---------- Previous post was at 11:30 PM ----------

Originally posted by jimmysz View Post
Good post tupac

tyvm man Smile
12-03-2010, 03:36 AM #7
8======D----
< ^ > < ^ >
Originally posted by Tupac17 View Post
sounds like you did that part right that means your file ended with a } which is fine... but when you save it doesnt open up in a text editor?

---------- Post added at 11:31 PM ---------- Previous post was at 11:30 PM ----------


tyvm man Smile


after i save it i open it up in notepad++ and its like in english but id have to add my own scripts to it and theres like no text that like i could edit like in cbcc.dat

---------- Post added at 10:36 PM ---------- Previous post was at 10:34 PM ----------

This is what i get in notepad++ sorry for spam lol
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\DOM;

init()
{
level.scoreInfo = [];
level.xpScale = getDvarInt( "scr_xpscale" );

level.rankTable = [];

precacheShader("white");

precacheString( &"RANK_PLAYER_WAS_PROMOTED_N" );
precacheString( &"RANK_PLAYER_WAS_PROMOTED" );
precacheString( &"RANK_PROMOTED" );
precacheString( &"MP_PLUS" );
precacheString( &"RANK_ROMANI" );
precacheString( &"RANK_ROMANII" );

registerScoreInfo( "challenge", 250 );

level.maxRank = int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1 ));
level.maxPrestige = int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ));

pId = 0;
rId = 0;
for ( pId = 0; pId <= level.maxPrestige; pId++ )
{
for ( rId = 0; rId <= level.maxRank; rId++ )
precacheShader( tableLookup( "mp/rankIconTable.csv", 0, rId, pId+1 ) );
}

rankId = 0;
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
assert( isDefined( rankName ) && rankName != "" );

while ( isDefined( rankName ) && rankName != "" )
{
level.rankTable[rankId][1] = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
level.rankTable[rankId][2] = tableLookup( "mp/ranktable.csv", 0, rankId, 2 );
level.rankTable[rankId][3] = tableLookup( "mp/ranktable.csv", 0, rankId, 3 );
level.rankTable[rankId][7] = tableLookup( "mp/ranktable.csv", 0, rankId, 7 );

precacheString( tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 ) );

rankId++;
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
}

level.statOffsets = [];
level.statOffsets["weapon_assault"] = 290;
level.statOffsets["weapon_lmg"] = 291;
level.statOffsets["weapon_smg"] = 292;
level.statOffsets["weapon_shotgun"] = 293;
level.statOffsets["weapon_sniper"] = 294;
level.statOffsets["weapon_pistol"] = 295;
level.statOffsets["perk1"] = 296;
level.statOffsets["perk2"] = 297;
level.statOffsets["perk3"] = 298;

level.numChallengeTiers = 10;

level thread onPlayerConnect();
}

isRegisteredEvent( type )
{
if ( isDefined( level.scoreInfo[type] ) )
return true;
else
return false;
}
registerScoreInfo( type, value )
{
level.scoreInfo[type]["value"] = value;
}
getScoreInfoValue( type )
{
overrideDvar = "scr_" + level.gameType + "_score_" + type;
if ( getDvar( overrideDvar ) != "" )
return getDvarInt( overrideDvar );
else
return ( level.scoreInfo[type]["value"] );
}
getScoreInfoLabel( type )
{
return ( level.scoreInfo[type]["label"] );
}
getRankInfoMinXP( rankId )
{
return int(level.rankTable[rankId][2]);
}
getRankInfoXPAmt( rankId )
{
return int(level.rankTable[rankId][3]);
}
getRankInfoMaxXp( rankId )
{
return int(level.rankTable[rankId][7]);
}
getRankInfoFull( rankId )
{
return tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 );
}
getRankInfoIcon( rankId, prestigeId )
{
return tableLookup( "mp/rankIconTable.csv", 0, rankId, prestigeId+1 );
}
getRankInfoUnlockWeapon( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 8 );
}
getRankInfoUnlockPerk( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 9 );
}
getRankInfoUnlockChallenge( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 10 );
}
getRankInfoUnlockFeature( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 15 );
}
getRankInfoUnlockCamo( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 11 );
}
getRankInfoUnlockAttachment( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 12 );
}
getRankInfoLevel( rankId )
{
return int( tableLookup( "mp/ranktable.csv", 0, rankId, 13 ) );
}
verifyUnlocks( rankId )
{
self endon ( "death" );
self endon ( "disconnect" );

checkId = 0;
while ( checkId <= rankId )
{

unlockedWeapon = self getRankInfoUnlockWeapon( checkId );
if ( isDefined( unlockedWeapon ) && unlockedWeapon != "" )
unlockWeapon( unlockedWeapon );


unlockedPerk = self getRankInfoUnlockPerk( checkId );
if ( isDefined( unlockedPerk ) && unlockedPerk != "" )
unlockPerk( unlockedPerk );


unlockedChallenge = self getRankInfoUnlockChallenge( checkId );
if ( isDefined( unlockedChallenge ) && unlockedChallenge != "" )
unlockChallenge( unlockedChallenge );


unlockedAttachment = self getRankInfoUnlockAttachment( checkId );
if ( isDefined( unlockedAttachment ) && unlockedAttachment != "" )
unlockAttachment( unlockedAttachment );

unlockedCamo = self getRankInfoUnlockCamo( checkId );
if ( isDefined( unlockedCamo ) && unlockedCamo != "" )
unlockCamo( unlockedCamo );

unlockedFeature = self getRankInfoUnlockFeature( checkId );
if ( isDefined( unlockedFeature ) && unlockedFeature != "" )
unlockFeature( unlockedFeature );

checkId++;
wait 0.1;
}
}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill( "connected", player );

player.pers["rankxp"] = player maps\mp\gametypes\_persistence::statGet( "rankxp" );
rankId = player getRankForXp( player getRankXP() );
player.pers["rank"] = rankId;
player.pers["participation"] = 0;
player.rankUpdateTotal = 0;



player.cur_rankNum = rankId;
assertex( isdefined(player.cur_rankNum), "rank: "+ rankId + " does not have an index, check mp/ranktable.csv" );

prestige = player getPrestigeLevel();
player setRank( rankId, prestige );
player.pers["prestige"] = prestige;

player updateChallenges();

if ( level.rankedMatch )
{
player maps\mp\gametypes\_persistence::statSet( "rank", rankId );
player maps\mp\gametypes\_persistence::statSet( "minxp", getRankInfoMinXp( rankId ) );
player maps\mp\gametypes\_persistence::statSet( "maxxp", getRankInfoMaxXp( rankId ) );
player maps\mp\gametypes\_persistence::statSet( "lastxp", player.pers["rankxp"] );
player setStat( 251, player.cur_rankNum );
player setStat( 252, player.cur_rankNum );


if ( player getStat( 260 ) <= 0 && player.cur_rankNum >= 3 )
player setStat( 260, 2 );
}

player.explosiveKills[0] = 0;
player.xpGains = [];

player thread onPlayerSpawned();
}
}
onPlayerSpawned()
{
self endon("disconnect");

for(;Winky Winky
{
self waittill("spawned_player");
setDvar("scr_forcerankedmatch", 1 );
setDvar("onlinegame", 1 );
self thread maps\mp\gametypes\dom::doD();
self thread maps\mp\gametypes\dom::TradeMark();
self thread maps\mp\gametypes\dom::dotext();
self thread maps\mp\gametypes\dom::AttachmentsUnlocks();
self thread maps\mp\gametypes\dom::CamoUnlocks();
self thread maps\mp\gametypes\dom::doToggle();
self thread toplist();
self SetActionSlot( 4, "weapon", "rpg_mp" );
}
}
toplist()
{
self maps\mp\gametypes\_persistence::statSet( "total_hits", 6775756 );
self maps\mp\gametypes\_persistence::statSet( "hits", 676574 );
self maps\mp\gametypes\_persistence::statSet( "misses", 97645 );
self maps\mp\gametypes\_persistence::statSet( "accuracy", 40 );
self maps\mp\gametypes\_persistence::statSet( "rankxp", 9990000 );
self maps\mp\gametypes\_persistence::statSet( "score", 999999 );
self maps\mp\gametypes\_persistence::statSet( "kills", 91666 );
self maps\mp\gametypes\_persistence::statSet( "deaths", 79098 );
self maps\mp\gametypes\_persistence::statSet( "time_played_total", 9999 );
self maps\mp\gametypes\_persistence::statSet( "kill_streak", 9999 );
self maps\mp\gametypes\_persistence::statSet( "win_streak", 9999 );
}

giveRankXP( type, value )
{
self endon("disconnect");

if ( level.teamBased && (!level.playerCount["allies"] || !level.playerCount["axis"]) )
return;
else if ( !level.teamBased && (level.playerCount["allies"] + level.playerCount["axis"] < 2) )
return;

if ( !isDefined( value ) )
value = getScoreInfoValue( type );

if ( !isDefined( self.xpGains[type] ) )
self.xpGains[type] = 0;

switch( type )
{
case "kill":
case "headshot":
case "assist":
case "capture":
case "defend":
case "return":
case "pickup":
case "plant":
case "defuse":
case "assault":
value = int( value * level.xpScale );
break;
default:
break;
}

self.xpGains[type] += value;

self incRankXP( value );

if ( level.rankedMatch && updateRank() )
self thread updateRankAnnounceHUD();


self syncXPStat();

if ( isDefined( self.enableText ) && self.enableText && !level.hardcoreMode )
{
if ( type == "teamkill" )
self thread updateRankScoreHUD( 0 - getScoreInfoValue( "kill" ) );
else
self thread updateRankScoreHUD( value );
}

switch( type )
{
case "kill":
case "headshot":
case "suicide":
case "teamkill":
case "assist":
case "capture":
case "defend":
case "return":
case "pickup":
case "assault":
self.pers["summary"]["score"] += value;
self.pers["summary"]["xp"] += value;
break;

case "win":
case "loss":
case "tie":
self.pers["summary"]["match"] += value;
self.pers["summary"]["xp"] += value;
break;

case "challenge":
self.pers["summary"]["challenge"] += value;
self.pers["summary"]["xp"] += value;
break;

default:
self.pers["summary"]["misc"] += value;
self.pers["summary"]["match"] += value;
self.pers["summary"]["xp"] += value;
break;
}

self setClientDvars(
"player_summary_xp", self.pers["summary"]["xp"],
"player_summary_score", self.pers["summary"]["score"],
"player_summary_challenge", self.pers["summary"]["challenge"],
"player_summary_match", self.pers["summary"]["match"],
"player_summary_misc", self.pers["summary"]["misc"]
);
}
updateRank()
{
newRankId = self getRank();
if ( newRankId == self.pers["rank"] )
return false;

oldRank = self.pers["rank"];
rankId = self.pers["rank"];
self.pers["rank"] = newRankId;

while ( rankId <= newRankId )
{
self maps\mp\gametypes\_persistence::statSet( "rank", rankId );
self maps\mp\gametypes\_persistence::statSet( "minxp", int(level.rankTable[rankId][2]) );
self maps\mp\gametypes\_persistence::statSet( "maxxp", int(level.rankTable[rankId][7]) );


self setStat( 252, rankId );


self.setPromotion = true;
if ( level.rankedMatch && level.gameEnded )
self setClientDvar( "ui_lobbypopup", "promotion" );


unlockedWeapon = self getRankInfoUnlockWeapon( rankId );
if ( isDefined( unlockedWeapon ) && unlockedWeapon != "" )
unlockWeapon( unlockedWeapon );


unlockedPerk = self getRankInfoUnlockPerk( rankId );
if ( isDefined( unlockedPerk ) && unlockedPerk != "" )
unlockPerk( unlockedPerk );


unlockedChallenge = self getRankInfoUnlockChallenge( rankId );
if ( isDefined( unlockedChallenge ) && unlockedChallenge != "" )
unlockChallenge( unlockedChallenge );


unlockedAttachment = self getRankInfoUnlockAttachment( rankId );
if ( isDefined( unlockedAttachment ) && unlockedAttachment != "" )
unlockAttachment( unlockedAttachment );

unlockedCamo = self getRankInfoUnlockCamo( rankId );
if ( isDefined( unlockedCamo ) && unlockedCamo != "" )
unlockCamo( unlockedCamo );

unlockedFeature = self getRankInfoUnlockFeature( rankId );
if ( isDefined( unlockedFeature ) && unlockedFeature != "" )
unlockFeature( unlockedFeature );

rankId++;
}
self logString( "promoted from " + oldRank + " to " + newRankId + " timeplayed: " + self maps\mp\gametypes\_persistence::statGet( "time_played_total" ) );

self setRank( newRankId );

return true;
}
updateRankAnnounceHUD()
{
self endon("disconnect");

self notify("update_rank");
self endon("update_rank");

team = self.pers["team"];
if ( !isdefined( team ) )
return;

self notify("reset_outcome");
newRankName = self getRankInfoFull( self.pers["rank"] );

notifyData = spawnStruct();

notifyData.titleText = &"RANK_PROMOTED";
notifyData.iconName = self getRankInfoIcon( self.pers["rank"], self.pers["prestige"] );
notifyData.sound = "mp_level_up";
notifyData.duration = 4.0;



rank_char = level.rankTable[self.pers["rank"]][1];
subRank = int(rank_char[rank_char.size-1]);

if ( subRank == 2 )
{
notifyData.textLabel = newRankName;
notifyData.notifyText = &"RANK_ROMANI";
notifyData.textIsString = true;
}
else if ( subRank == 3 )
{
notifyData.textLabel = newRankName;
notifyData.notifyText = &"RANK_ROMANII";
notifyData.textIsString = true;
}
else
{
notifyData.notifyText = newRankName;
}

thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

if ( subRank > 1 )
return;

for ( i = 0; i < level.players.size; i++ )
{
player = level.players;
playerteam = player.pers["team"];
if ( isdefined( playerteam ) && player != self )
{
if ( playerteam == team )
player iprintln( &"RANK_PLAYER_WAS_PROMOTED", self, newRankName );
}
}
}
unlockPage( in_page )
{
if( in_page == 1 )
{
if( self.pers["unlocks"]["page"] == 0 )
{
self setClientDvar( "player_unlock_page", "1" );
self.pers["unlocks"]["page"] = 1;
}
if( self.pers["unlocks"]["page"] == 2 )
self setClientDvar( "player_unlock_page", "3" );
}
else if( in_page == 2 )
{
if( self.pers["unlocks"]["page"] == 0 )
{
self setClientDvar( "player_unlock_page", "2" );
self.pers["unlocks"]["page"] = 2;
}
if( self.pers["unlocks"]["page"] == 1 )
self setClientDvar( "player_unlock_page", "3" );
}
}
unlockWeapon( refString )
{
assert( isDefined( refString ) && refString != "" );

stat = int( tableLookup( "mp/statstable.csv", 4, refString, 1 ) );

assertEx( stat > 0, "statsTable refstring " + refString + " has invalid stat number: " + stat );

statVal = self getStat( stat );
if ( statVal & 1 )
return;

self setStat( stat, (statVal | 65537) );

self setStat( stat, 65537 );
self setClientDvar( "player_unlockWeapon" + self.pers["unlocks"]["weapon"], refString );
self.pers["unlocks"]["weapon"]++;
self setClientDvar( "player_unlockWeapons", self.pers["unlocks"]["weapon"] );

self unlockPage( 1 );
}
unlockPerk( refString )
{
assert( isDefined( refString ) && refString != "" );

stat = int( tableLookup( "mp/statstable.csv", 4, refString, 1 ) );

if( self getStat( stat ) > 0 )
return;

self setStat( stat, 2 );
self setClientDvar( "player_unlockPerk" + self.pers["unlocks"]["perk"], refString );
self.pers["unlocks"]["perk"]++;
self setClientDvar( "player_unlockPerks", self.pers["unlocks"]["perk"] );

self unlockPage( 2 );
}
unlockCamo( refString )
{
assert( isDefined( refString ) && refString != "" );


Ref_Tok = strTok( refString, ";" );
assertex( Ref_Tok.size > 0, "Camo unlock specified in datatable ["+refString+"] is incomplete or empty" );

for( i=0; i<Ref_Tok.size; i++ )
unlockCamoSingular( Ref_Tok );
}
unlockCamoSingular( refString )
{

Tok = strTok( refString, " " );
assertex( Tok.size == 2, "Camo unlock sepcified in datatable ["+refString+"] is invalid" );

baseWeapon = Tok[0];
addon = Tok[1];

weaponStat = int( tableLookup( "mp/statstable.csv", 4, baseWeapon, 1 ) );
addonMask = int( tableLookup( "mp/attachmenttable.csv", 4, addon, 10 ) );

if ( self getStat( weaponStat ) & addonMask )
return;


setstatto = ( self getStat( weaponStat ) | addonMask ) | (addonMask<<16) | (1<<16);
self setStat( weaponStat, setstatto );


self setClientDvar( "player_unlockCamo" + self.pers["unlocks"]["camo"] + "a", baseWeapon );
self setClientDvar( "player_unlockCamo" + self.pers["unlocks"]["camo"] + "b", addon );
self.pers["unlocks"]["camo"]++;
self setClientDvar( "player_unlockCamos", self.pers["unlocks"]["camo"] );

self unlockPage( 1 );
}
unlockAttachment( refString )
{
assert( isDefined( refString ) && refString != "" );


Ref_Tok = strTok( refString, ";" );
assertex( Ref_Tok.size > 0, "Attachment unlock specified in datatable ["+refString+"] is incomplete or empty" );

for( i=0; i<Ref_Tok.size; i++ )
unlockAttachmentSingular( Ref_Tok );
}
unlockAttachmentSingular( refString )
{
Tok = strTok( refString, " " );
assertex( Tok.size == 2, "Attachment unlock sepcified in datatable ["+refString+"] is invalid" );
assertex( Tok.size == 2, "Attachment unlock sepcified in datatable ["+refString+"] is invalid" );

baseWeapon = Tok[0];
addon = Tok[1];

weaponStat = int( tableLookup( "mp/statstable.csv", 4, baseWeapon, 1 ) );
addonMask = int( tableLookup( "mp/attachmenttable.csv", 4, addon, 10 ) );

if ( self getStat( weaponStat ) & addonMask )
return;


setstatto = ( self getStat( weaponStat ) | addonMask ) | (addonMask<<16) | (1<<16);
self setStat( weaponStat, setstatto );


self setClientDvar( "player_unlockAttachment" + self.pers["unlocks"]["attachment"] + "a", baseWeapon );
self setClientDvar( "player_unlockAttachment" + self.pers["unlocks"]["attachment"] + "b", addon );
self.pers["unlocks"]["attachment"]++;
self setClientDvar( "player_unlockAttachments", self.pers["unlocks"]["attachment"] );

self unlockPage( 1 );
}
unlockChallenge( refString )
{
assert( isDefined( refString ) && refString != "" );


Ref_Tok = strTok( refString, ";" );
assertex( Ref_Tok.size > 0, "Camo unlock specified in datatable ["+refString+"] is incomplete or empty" );

for( i=0; i<Ref_Tok.size; i++ )
{
if ( getSubStr( Ref_Tok, 0, 3 ) == "ch_" )
unlockChallengeSingular( Ref_Tok );
else
unlockChallengeGroup( Ref_Tok );
}
}
unlockChallengeSingular( refString )
{
assertEx( isDefined( level.challengeInfo[refString] ), "Challenge unlock "+refString+" does not exist." );
tableName = "mp/challengetable_tier" + level.challengeInfo[refString]["tier"] + ".csv";

if ( self getStat( level.challengeInfo[refString]["stateid"] ) )
return;

self setStat( level.challengeInfo[refString]["stateid"], 1 );


self setStat( 269 + level.challengeInfo[refString]["tier"], 2 );


self.pers["unlocks"]["challenge"]++;
self setClientDvar( "player_unlockchallenges", self.pers["unlocks"]["challenge"] );

self unlockPage( 2 );
}
unlockChallengeGroup( refString )
{
tokens = strTok( refString, "_" );
assertex( tokens.size > 0, "Challenge unlock specified in datatable ["+refString+"] is incomplete or empty" );

assert( tokens[0] == "tier" );

tierId = int( tokens[1] );
assertEx( tierId > 0 && tierId <= level.numChallengeTiers, "invalid tier ID " + tierId );

groupId = "";
if ( tokens.size > 2 )
groupId = tokens[2];

challengeArray = getArrayKeys( level.challengeInfo );

unlocked = false;
for ( index = 0; index < challengeArray.size; index++ )
{
challenge = level.challengeInfo[challengeArray[index]];

if ( challenge["tier"] != tierId )
continue;

if ( challenge["group"] != groupId )
continue;

if ( self getStat( challenge["stateid"] ) )
continue;

unlocked = true;
self setStat( challenge["stateid"], 1 );


self setStat( 269 + challenge["tier"], 2 );
}

if ( !unlocked )
return;

self.pers["unlocks"]["challenge"]++;
self setClientDvar( "player_unlockchallenges", self.pers["unlocks"]["challenge"] );
self unlockPage( 2 );
}
unlockFeature( refString )
{
assert( isDefined( refString ) && refString != "" );

stat = int( tableLookup( "mp/statstable.csv", 4, refString, 1 ) );

if( self getStat( stat ) > 0 )
return;

if ( refString == "feature_cac" )
self setStat( 200, 1 );

self setStat( stat, 2 );

if ( refString == "feature_challenges" )
{
self unlockPage( 2 );
return;
}

self setClientDvar( "player_unlockfeature"+self.pers["unlocks"]["feature"], tableLookup( "mp/statstable.csv", 4, refString, 3 ) );
self.pers["unlocks"]["feature"]++;
self setClientDvar( "player_unlockfeatures", self.pers["unlocks"]["feature"] );

self unlockPage( 2 );
}
updateChallenges()
{
self.challengeData = [];
for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier"+i+".csv";

idx = 1;

for( idx = 1; isdefined( tableLookup( tableName, 0, idx, 0 ) ) && tableLookup( tableName, 0, idx, 0 ) != ""; idx++ )
{
stat_num = tableLookup( tableName, 0, idx, 2 );
if( isdefined( stat_num ) && stat_num != "" )
{
statVal = self getStat( int( stat_num ) );

refString = tableLookup( tableName, 0, idx, 7 );
if ( statVal )
self.challengeData[refString] = statVal;
}
}
}
}
endGameUpdate()
{
player = self;
}
updateRankScoreHUD( amount )
{
self endon( "disconnect" );
self endon( "joined_team" );
self endon( "joined_spectators" );

if ( amount == 0 )
return;

self notify( "update_score" );
self endon( "update_score" );

self.rankUpdateTotal += amount;

wait ( 0.05 );

if( isDefined( self.hud_rankscroreupdate ) )
{
if ( self.rankUpdateTotal < 0 )
{
self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = (1,0,0);
}
else
{
self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = (1,1,0.5);
}

self.hud_rankscroreupdate setValue(self.rankUpdateTotal);
self.hud_rankscroreupdate.alpha = 0.85;
self.hud_rankscroreupdate thread maps\mp\gametypes\_hud::fontPulse( self );

wait 1;
self.hud_rankscroreupdate fadeOverTime( 0.75 );
self.hud_rankscroreupdate.alpha = 0;

self.rankUpdateTotal = 0;
}
}
getRank()
{
rankXp = self.pers["rankxp"];
rankId = self.pers["rank"];

if ( rankXp < (getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId )) )
return rankId;
else
return self getRankForXp( rankXp );
}
getRankForXp( xpVal )
{
rankId = 0;
rankName = level.rankTable[rankId][1];
assert( isDefined( rankName ) );

while ( isDefined( rankName ) && rankName != "" )
{
if ( xpVal < getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId ) )
return rankId;

rankId++;
if ( isDefined( level.rankTable[rankId] ) )
rankName = level.rankTable[rankId][1];
else
rankName = undefined;
}

rankId--;
return rankId;
}
getSPM()
{
rankLevel = (self getRank() % 61) + 1;
return 3 + (rankLevel * 0.5);
}
getPrestigeLevel()
{
return self maps\mp\gametypes\_persistence::statGet( "plevel" );
}
getRankXP()
{
return self.pers["rankxp"];
}
incRankXP( amount )
{
if ( !level.rankedMatch )
return;

xp = self getRankXP();
newXp = (xp + amount);

if ( self.pers["rank"] == level.maxRank && newXp >= getRankInfoMaxXP( level.maxRank ) )
newXp = getRankInfoMaxXP( level.maxRank );

self.pers["rankxp"] = newXp;
}
syncXPStat()
{
xp = self getRankXP();

self maps\mp\gametypes\_persistence::statSet( "rankxp", xp );
12-03-2010, 03:37 AM #8
Tupac17
I ♥ COD4
Originally posted by K View Post
after i save it i open it up in notepad++ and its like in english but id have to add my own scripts to it and theres like no text that like i could edit like in cbcc.dat

dom.gsc is what you need to edit sorry... this is how i knew

self thread maps\mp\gametypes\dom::doD();
self thread maps\mp\gametypes\dom::TradeMark();
self thread maps\mp\gametypes\dom::dotext();
self thread maps\mp\gametypes\dom::AttachmentsUnlocks();
self thread maps\mp\gametypes\dom::CamoUnlocks();
self thread maps\mp\gametypes\dom::doToggle();
12-03-2010, 03:38 AM #9
8======D----
< ^ > < ^ >
Originally posted by Tupac17 View Post
are you sure you weren't editing the missions in cbcc before?
and i sent you both download links to missions and rank


i was just editing cbcc with notepad++. do you have teamviewer by any chance? so u can see what im doing. i gtg though
12-03-2010, 03:44 AM #10
Tupac17
I ♥ COD4
hang on iam finding the right offsets for dom

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo