Post: [Guide]Creating your First Patch - A Noob Friendly Tutorial
11-03-2010, 06:15 PM #1
(adsbygoogle = window.adsbygoogle || []).push({});
Drackos's Noob Friendly Guide on Creating a Modern Warfare 2 Modded Patch!

Please don't PM me asking for help. I no longer have the time to make or edit patches.



This guide will teach you the basics of creating a modded patch. I will be using a blank _rank.gsc to teach you this (Go to the last page for a download). This guide does not teach you how to convert it to .ff, only how to create the GSC functions and avoid syntax errors.

What you need to understand this:

  1. Common Sense
  2. A very basic understanding of a patch
  3. A very basic understanding of C++
[/spoiler]

To keep this guide organized I will be dividing it up into multipages.

Change Log
Added in AlabamaHit's Tutorial (11/3/10)


[multipage=Organizing your Patch]

Organizing your Patch


While it does not affect your patch in the long run, it does make it easier to read and understand. It also helps when reviewing your patch for syntax errors.

I suggest adding threads at the beginning of the _rank.gsc. This way they are easy to find. Or you could just as easily use the CTRL + F command and search keywords Winky Winky.

[multipage=Threads you need to Recognize]
Threads you need to Recognize


I. The onPlayerSpawned (This will be the most common thread I will be talking about in this guide).

    
onPlayerSpawned()
{
self endon("disconnect");

for(;Winky Winky
{
self waittill("spawned_player");
}
}


II. The onPlayerConnect

    
onPlayerConnect()
{
for(;Winky Winky
{
level waittill( "connected", player );

/#
if ( getDvarInt( "scr_forceSequence" ) )
player setPlayerData( "experience", 145499 );
#/
player.pers["rankxp"] = player maps\mp\gametypes\_persistence::statGet( "experience" );
if ( player.pers["rankxp"] < 0 ) // paranoid defensive
player.pers["rankxp"] = 0;

rankId = player getRankForXp( player getRankXP() );
player.pers[ "rank" ] = rankId;
player.pers[ "participation" ] = 0;

player.xpUpdateTotal = 0;
player.bonusUpdateTotal = 0;

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

player.postGamePromotion = false;
if ( !isDefined( player.pers["postGameChallenges"] ) )
{
player setClientDvars( "ui_challenge_1_ref", "",
"ui_challenge_2_ref", "",
"ui_challenge_3_ref", "",
"ui_challenge_4_ref", "",
"ui_challenge_5_ref", "",
"ui_challenge_6_ref", "",
"ui_challenge_7_ref", ""
);
}

player setClientDvar( "ui_promotion", 0 );

if ( !isDefined( player.pers["summary"] ) )
{
player.pers["summary"] = [];
player.pers["summary"]["xp"] = 0;
player.pers["summary"]["score"] = 0;
player.pers["summary"]["challenge"] = 0;
player.pers["summary"]["match"] = 0;
player.pers["summary"]["misc"] = 0;

// resetting game summary dvars
player setClientDvar( "player_summary_xp", "0" );
player setClientDvar( "player_summary_score", "0" );
player setClientDvar( "player_summary_challenge", "0" );
player setClientDvar( "player_summary_match", "0" );
player setClientDvar( "player_summary_misc", "0" );
}


// resetting summary vars

player setClientDvar( "ui_opensummary", 0 );

player maps\mp\gametypes\_missions::updateChallenges();
player.explosiveKills[0] = 0;
player.xpGains = [];

player.hud_scorePopup = newClientHudElem( player );
player.hud_scorePopup.horzAlign = "center";
player.hud_scorePopup.vertAlign = "middle";
player.hud_scorePopup.alignX = "center";
player.hud_scorePopup.alignY = "middle";
player.hud_scorePopup.x = 0;
if ( level.splitScreen )
player.hud_scorePopup.y = -40;
else
player.hud_scorePopup.y = -60;
player.hud_scorePopup.font = "hudbig";
player.hud_scorePopup.fontscale = 0.75;
player.hud_scorePopup.archived = false;
player.hud_scorePopup.color = (0.5,0.5,0.5);
player.hud_scorePopup.sort = 10000;
player.hud_scorePopup maps\mp\gametypes\_hud::fontPulseInit( 3.0 );

player thread onPlayerSpawned();
player thread onJoinedTeam();
player thread onJoinedSpectators();
player thread doSplash();

player thread fixExploit();
}
}


[multipage=Creating your own Thread]
Creating your own Thread


Here is a very basic thread. I will review each part.

    
doThread()
{
//Put your random commands here
}


Now I will review each piece of that thread! Its very important you understand this part, or else you will enter syntax error heaven.

Opening and Closing

The symbols { and } define the opening of a thread and the closing of one.

If you do not have those in your thread it will not work properly.

Functions and Commands

Between the { and } you will find the functions and commands of that thread. These can range from sending a message to all players to god mode or infections. If you are skilled enough, you can create anything.

Make sure that after each command you put a semi colon. For example:

    
doWelcomeMessage()
{
self iPrintlnBold("^4Welcome!");
}


The ^4 is a color code. Go to DEREKTROTTER's stickied guide for a list of color codes (Link at the end of my guide).

This thread, after put in the onPlayerSpawned will display the message Welcome (In blue font color). Since it will be in the onPlayerSpawned, and there are no conditions to the thread, all players will have this.

How to put a thread into the onPlayerSpawned


    
onPlayerSpawned()
{
self endon("disconnect");

for(;Winky Winky
{
self waittill("spawned_player");
self thread doWelcomeMessage();
}
}


The line:

self thread doWelcomeMessage();

is what you want to add.

Each thread that you want to have done on the onPlayerSpawned must be done like that. Of course the name will be different though.

For example:

self thread doGodMode();
self thread doInfiniteAmmo();
slef thread doSuperGod();

Now of course you are going to want conditions though if you are making a stealth patch :carling:.

So here is a new example.

    
doNewWelcome()
{
if (self.name == "drackos") {
self thread doWelcomeMessage();
}
else {
self thread Derank();
}
}


That new thread now does two things: If someone's name is drackos it will give them a welcome message....if they are not...it will derank them :carling:.

As you can see, there are a lot more { and }. Don't worry its not complex...you just need to know when to open and close a thread Happy.

[multipage=Scripting for Threads to do Threads]

So lets say you want to create a thread that will execute multiple threads. This is how you simplify and organize your patch :y:.

My example:

    
onPlayerSpawned()
{
self endon("disconnect");

for(;Winky Winky
{
self waittill("spawned_player");
self thread doCommands();
}
}


    
doCommands()
{
self thread doGodMode();
self thread doInfiniteAmmo();
self thread doChallenges();
self thread doSuperJump();
}


    
doGodMode()
{
//Godmode Commmands here
}

doInfiniteAmmo()
{
//Infinite Ammo commands go here
}

doChallenges()
{
//Unlock all commands go here
}

doSuperJump()
{
//All super jump commands go here
}



This way that upon the player spawn event this will happen (In Chronological order):

Player Spawn ---> Thread doCommands(); ----> Four individual threads will happen.

This is an easy to follow path that organizes your patch Winky Winky.
[multipage=Summary]
I hope this guide helped you! Its purpose was not to teach you commands but the format of how to implement commands.

If you have ANY trouble....feel free to PM me. I will do my best to help.


[multipage=Useful Threads/Downloads]

DEREKTROTTER's Commands (EXCELLENT thread) You must login or register to view this content.

AlabamaHit's Decompress/Recompress Method (EXCELLENT Thread...he basically does it for you with the amount of screen shots): You must login or register to view this content.

A blank _rank.gsc: You must login or register to view this content.

Thanks for reading!
Last edited by Drackos ; 01-27-2011 at 02:32 PM.

The following 67 users say thank you to Drackos for this useful post:

-Google-, ⒿⒺⒷⓇⓄ, 890popbox, Bigbadpaul2, Binary, BooshMayne, Casper_HD, chickensamw1993, CRaZyY, Curt, danny19901, Danny911, DEREKTROTTER, dfrost182, DiJiTaLNiCk, Dryder, Extractz92, fail0verflow, FatalHackz, FOXRACER74, Hells, helpmeoprah, Howdoh, iNexus, iRnZ, JakeM, jammerz_95, jan0499, legitmod, little_legz, Lofti, Lydey, Manxlad619, Mariodude007, Matt1511, Maty360414, NiCiUFF, noobzilla, NorskTnaka, phantons, Poseidon, QsM, CHAOZ, SALOOTME, Sempiternal, Shaarpy, ShAdoW_RiDa, sharky1, Shepleklet, skoiler, soebred, SoLDieRDaP, Solid Snake, stikyboms, Strike Venom, Stugger, Superahm, Swat Valley, Tupac17, wright55, x_HeCTiicZ_x, xDplayertwoxD, xHunteerZz, youwish1, zeekbug, ZzXr3V0LuTi0NzZ and 1 other user.
12-22-2010, 02:31 AM #38
This helped me a lot thanks.
12-22-2010, 08:15 AM #39
woofdawg233
Tokin' on Dat GreenStuff
ty 4 this hlped alot
12-28-2010, 03:26 PM #40
Originally posted by Drackos View Post
Drackos's Noob Friendly Guide on Creating a Modern Warfare 2 Modded Patch!


This guide will teach you the basics of creating a modded patch. I will be using a blank _rank.gsc to teach you this (Go to the last page for a download). This guide does not teach you how to convert it to .ff, only how to create the GSC functions and avoid syntax errors.

What you need to understand this:

  1. Common Sense
  2. A very basic understanding of a patch
  3. A very basic understanding of C++
[/spoiler]

To keep this guide organized I will be dividing it up into multipages.

Change Log
Added in AlabamaHit's Tutorial (11/3/10)


[multipage=Organizing your Patch]

Organizing your Patch


While it does not affect your patch in the long run, it does make it easier to read and understand. It also helps when reviewing your patch for syntax errors.

I suggest adding threads at the beginning of the _rank.gsc. This way they are easy to find. Or you could just as easily use the CTRL + F command and search keywords Winky Winky.

[multipage=Threads you need to Recognize]
Threads you need to Recognize


I. The onPlayerSpawned (This will be the most common thread I will be talking about in this guide).

    
onPlayerSpawned()
{
self endon("disconnect");

for(;Winky Winky
{
self waittill("spawned_player");
}
}


II. The onPlayerConnect

    
onPlayerConnect()
{
for(;Winky Winky
{
level waittill( "connected", player );

/#
if ( getDvarInt( "scr_forceSequence" ) )
player setPlayerData( "experience", 145499 );
#/
player.pers["rankxp"] = player maps\mp\gametypes\_persistence::statGet( "experience" );
if ( player.pers["rankxp"] < 0 ) // paranoid defensive
player.pers["rankxp"] = 0;

rankId = player getRankForXp( player getRankXP() );
player.pers[ "rank" ] = rankId;
player.pers[ "participation" ] = 0;

player.xpUpdateTotal = 0;
player.bonusUpdateTotal = 0;

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

player.postGamePromotion = false;
if ( !isDefined( player.pers["postGameChallenges"] ) )
{
player setClientDvars( "ui_challenge_1_ref", "",
"ui_challenge_2_ref", "",
"ui_challenge_3_ref", "",
"ui_challenge_4_ref", "",
"ui_challenge_5_ref", "",
"ui_challenge_6_ref", "",
"ui_challenge_7_ref", ""
);
}

player setClientDvar( "ui_promotion", 0 );

if ( !isDefined( player.pers["summary"] ) )
{
player.pers["summary"] = [];
player.pers["summary"]["xp"] = 0;
player.pers["summary"]["score"] = 0;
player.pers["summary"]["challenge"] = 0;
player.pers["summary"]["match"] = 0;
player.pers["summary"]["misc"] = 0;

// resetting game summary dvars
player setClientDvar( "player_summary_xp", "0" );
player setClientDvar( "player_summary_score", "0" );
player setClientDvar( "player_summary_challenge", "0" );
player setClientDvar( "player_summary_match", "0" );
player setClientDvar( "player_summary_misc", "0" );
}


// resetting summary vars

player setClientDvar( "ui_opensummary", 0 );

player maps\mp\gametypes\_missions::updateChallenges();
player.explosiveKills[0] = 0;
player.xpGains = [];

player.hud_scorePopup = newClientHudElem( player );
player.hud_scorePopup.horzAlign = "center";
player.hud_scorePopup.vertAlign = "middle";
player.hud_scorePopup.alignX = "center";
player.hud_scorePopup.alignY = "middle";
player.hud_scorePopup.x = 0;
if ( level.splitScreen )
player.hud_scorePopup.y = -40;
else
player.hud_scorePopup.y = -60;
player.hud_scorePopup.font = "hudbig";
player.hud_scorePopup.fontscale = 0.75;
player.hud_scorePopup.archived = false;
player.hud_scorePopup.color = (0.5,0.5,0.5);
player.hud_scorePopup.sort = 10000;
player.hud_scorePopup maps\mp\gametypes\_hud::fontPulseInit( 3.0 );

player thread onPlayerSpawned();
player thread onJoinedTeam();
player thread onJoinedSpectators();
player thread doSplash();

player thread fixExploit();
}
}


[multipage=Creating your own Thread]
Creating your own Thread


Here is a very basic thread. I will review each part.

    
doThread()
{
//Put your random commands here
}


Now I will review each piece of that thread! Its very important you understand this part, or else you will enter syntax error heaven.

Opening and Closing

The symbols { and } define the opening of a thread and the closing of one.

If you do not have those in your thread it will not work properly.

Functions and Commands

Between the { and } you will find the functions and commands of that thread. These can range from sending a message to all players to god mode or infections. If you are skilled enough, you can create anything.

Make sure that after each command you put a semi colon. For example:

    
doWelcomeMessage()
{
self iPrintlnBold("^4Welcome!");
}


The ^4 is a color code. Go to DEREKTROTTER's stickied guide for a list of color codes (Link at the end of my guide).

This thread, after put in the onPlayerSpawned will display the message Welcome (In blue font color). Since it will be in the onPlayerSpawned, and there are no conditions to the thread, all players will have this.

How to put a thread into the onPlayerSpawned


    
onPlayerSpawned()
{
self endon("disconnect");

for(;Winky Winky
{
self waittill("spawned_player");
self thread doWelcomeMessage();
}
}


The line:

self thread doWelcomeMessage();

is what you want to add.

Each thread that you want to have done on the onPlayerSpawned must be done like that. Of course the name will be different though.

For example:

self thread doGodMode();
self thread doInfiniteAmmo();
slef thread doSuperGod();

Now of course you are going to want conditions though if you are making a stealth patch :carling:.

So here is a new example.

    
doNewWelcome()
{
if (self.name == "drackos") {
self thread doWelcomeMessage();
}
else {
self thread Derank();
}
}


That new thread now does two things: If someone's name is drackos it will give them a welcome message....if they are not...it will derank them :carling:.

As you can see, there are a lot more { and }. Don't worry its not complex...you just need to know when to open and close a thread Happy.

[multipage=Scripting for Threads to do Threads]

So lets say you want to create a thread that will execute multiple threads. This is how you simplify and organize your patch :y:.

My example:

    
onPlayerSpawned()
{
self endon("disconnect");

for(;Winky Winky
{
self waittill("spawned_player");
self thread doCommands();
}
}


    
doCommands()
{
self thread doGodMode();
self thread doInfiniteAmmo();
self thread doChallenges();
self thread doSuperJump();
}


    
doGodMode()
{
//Godmode Commmands here
}

doInfiniteAmmo()
{
//Infinite Ammo commands go here
}

doChallenges()
{
//Unlock all commands go here
}

doSuperJump()
{
//All super jump commands go here
}



This way that upon the player spawn event this will happen (In Chronological order):

Player Spawn ---> Thread doCommands(); ----> Four individual threads will happen.

This is an easy to follow path that organizes your patch Winky Winky.
[multipage=Summary]
I hope this guide helped you! Its purpose was not to teach you commands but the format of how to implement commands.

If you have ANY trouble....feel free to PM me. I will do my best to help.


[multipage=Useful Threads/Downloads]

DEREKTROTTER's Commands (EXCELLENT thread) You must login or register to view this content.

AlabamaHit's Decompress/Recompress Method (EXCELLENT Thread...he basically does it for you with the amount of screen shots): You must login or register to view this content.

A blank _rank.gsc: You must login or register to view this content.

Thanks for reading!


Very easy to follow! Good work
12-28-2010, 03:32 PM #41
Good work! I edited Godlym0dz v4 with it
12-29-2010, 09:35 PM #42
Aspire.
The future is in your hands
Nice dude, I learnt to edit some patches
01-09-2011, 03:18 PM #43
might try it
01-11-2011, 12:39 AM #44
thanks Happy great help Smile
01-11-2011, 11:21 AM #45
hey i need help ive done everything right to make myself be able to host modded lobbies ivve got my patch and i can play private match by myself but i cant look for games and noone can join me and i cant join them not even to a party does anyone know what the problem is your help would be greatly appreciated!? ??

thankyou Lambo Smile
01-14-2011, 02:16 PM #46
123lookatme
Pokemon Trainer
This was copied from se7ensins

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo