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.
02-19-2011, 08:15 PM #74
Nice job thanks for helping:black:
02-21-2011, 02:46 AM #75
I can finally do my own patch thx dude!
02-21-2011, 11:33 PM #76
this is a really nice tutorial it has helped me a lot in making patches. my friend had shown me the tutorial and then we started making patches. i mean probably the best cut to the chase tutorial i have ever seen.
:arate:

---------- Post added at 06:33 PM ---------- Previous post was at 06:29 PM ----------

thanks again
02-25-2011, 04:16 AM #77
LucidPerceptions
Pokemon Trainer
This is very helpful man THANK YOu i was a noob at this stuff not anymore ur amazign xD
03-06-2011, 05:34 AM #78
Cub Scout

The_Platypus's Avatar

Join Date: Feb 2011
Location: Ontario, Canada
Posts: 200
Reputation: 24
The_Platypus is just trying on his newb shortz
My PSN is PsYcHo_Platypus-
My COD4 Level is Prestige 10 My COSad AwesomeWAW Level is Prestige 10 My MW2 Level is Prestige 10 My Black Ops Prestige is None
Points: 9,584.99
Bank: 28,242.44
Total Points: 37,827.43
Donate

Default
good post but that must taken forever
03-14-2011, 06:36 PM #79
ty very mach
03-18-2011, 01:32 PM #80
Ada Wong
So cute!
editing is diffrent
03-20-2011, 09:53 PM #81
Good guide man but I only have one question I know the in's and out's of c++ can u or someone tell me how I apply the patch to my ps3.
03-30-2011, 03:06 AM #82
i need help

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo