Post: Save Space In Your Patch
02-01-2011, 04:42 PM #1
d7w7z
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); Quite a few people will already know about this but this is for the people who dont know. Smile

Almost anything with brackets that you have to repeat alot can be made shorter which means less space is used = profit? :carling:

Here is one example from my patch.
    txt(var) { self iPrintln(var);}


Basicly var gets replaced by what ever you want. So if you have the above in your patch you can do
    txt("Hello");


Instead of having to put
    self iPrintln("Hello");



Doesnt look like it saves much space but when you do it with a few different things and throughout your whole patch it can make a big difference.

Here is a list of some that I use with an example. Smile
    
txt(var) { self iPrintln(var);}
// txt("Message"); *Killfeed text*

txt2(var) { self iPrintlnBold(var);}
// txt2("Message"); *text in the middle of your screen*

doDvar(var,val){self setClientDvar(var,val);}
// doDvar( "g_gravity", "20" ); *Infections*

NPC(N, C){self notifyOnPlayerCommand( N, C );}
// NPC( "dpad_up", "+actionslot 1" ); *Binds*

GivePerk(var) { self maps\mp\perks\_perks::givePerk("specialty_"+var); }
// GivePerk("marathon"); *Give perks*

GiveKS(var){ self maps\mp\killstreaks\_killstreaks::giveKillstreak(var,false); }
// GiveKS("uav"); *Give Killstreaks*

SN(var) { self notify(var);}
// SN("StopGodMode"); *Stop Things*



Here is some posted that people may find useful ( Credits to x_DaftVader_x )
    
sa(Val) { self setPlayerAngles(self.angles + (Val)); }
// sa(0, 180, 270); *Changes players angles*

iP(text) { self iprintlnbold(text); }
// iP("Message"); *Killfeed text*

w(V) { wait(V); }
// w(0.1); *Waits so many seconds 1 = 1 second ect*

ms(text) { self thread maps\mp\gametypes\_hud_message::hintMessage(text); }
// ms("Message"); *Text in the middle of your screen*

dD(var, val) { self setClientDvar(var, val); }
// dD( "g_gravity", "20" ); *Infections*

sD(var, val) { setDvar(var, val); }
// sD("party_connectTimeout",1000); *Temp Infections*

CU(n,t){self notifyOnPlayerCommand(n,t);}
shi(t) { self notify(t);}
// Added because of the 1337 names... xD



Credits to TheUnkn0wn for doDvar and for giving me the idea to make more!

NOTE - you cannot use this for self endon

These are just examples. k thx bye Dancing

More Advanced Usage

So you can use this to make a massive reduction is the size of your coding.

I'll Just explain what I know from my short time of coding.

This is best used for things that have a lot of repeating, e.g Text.

The Letters get replaced by your input which you can later use to change small parts of the coding while keeping the main structure.
    Test( C ) 
{
if (C==1) { txt("Hey Honey"); }
else if (C==2) { txt( "GTFO" ); }
}


If I was to do
    
doMessage()
{
Test( 1 )
}


C is replaced by 1.
So the if (C==1){ is like saying if (1==1) { because we have replaced C with 1.

Thats about the best I can do to explain it to you, Be Creative!

Heres an example from my patch. Its for magic bullets
    MagicBullets( bull )
{
self endon ( "death" );
self endon ( "StopMagicBullets" );
self notify ("StopExplosives");
for (;Winky Winky {
self waittill( "weapon_fired" );
MagicBullet( bull, self getTagOrigin("tag_eye"), self GetCursorPos(), self );
wait 0.2;
} }


Then I can just do something like
    MagicBullets( "at4_mp" );


Which means that because bull has been replaced by "at4_mp"
    MagicBullet( bull, self getTagOrigin("tag_eye"), self GetCursorPos(), self );

Is now
    MagicBullet( "at4_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
(adsbygoogle = window.adsbygoogle || []).push({});

The following 4 users say thank you to d7w7z for this useful post:

Blackstorm, DEREKTROTTER, dogyplop, iJokaa
02-01-2011, 05:31 PM #11
Originally posted by TheEliteMossy View Post
Similar to how i did it in my Private Patch Winky Winky

---------- Post added at 12:22 PM ---------- Previous post was at 12:20 PM ----------

It is a shame i have not released my PPv2, you could have seen how advanced the coding is, and how i fit so much into the patch, without loosing any functionality in the game.


I bet your whole patch looks something like this now.. :carling:
    
i[]+> for(;Winky Winkyi++
N[]
n[1]
x-- +<l while(x>i)
subSt(p+i = x>=N
if(switch)i+N[]
.
.
.
.
.
02-01-2011, 05:32 PM #12
EliteMossy
TheDigitalBoard.com
Originally posted by d7w7z View Post
Haha, I would have I wasnt sure what they were called. I just learned from looking at Mossys Coloured class names in his v8 :whistle:

---------- Post added at 05:25 PM ---------- Previous post was at 05:23 PM ----------


You'll release it some day and then I'll see Happy


Heh, i have a screenshot somewhere hold on

---------- Post added at 12:32 PM ---------- Previous post was at 12:31 PM ----------

You must login or register to view this content.

The following user thanked EliteMossy for this useful post:

d7w7z
02-01-2011, 05:36 PM #13
Originally posted by TheEliteMossy View Post
Heh, i have a screenshot somewhere hold on

---------- Post added at 12:32 PM ---------- Previous post was at 12:31 PM ----------

You must login or register to view this content.


NOOOO, not bloody doHeart... /facepalm

The following user thanked x_DaftVader_x for this useful post:

iJokaa
02-01-2011, 05:39 PM #14
d7w7z
Bounty hunter
Originally posted by TheEliteMossy View Post
Heh, i have a screenshot somewhere hold on


I bet you put ALOT of hours into that! Smile

Also I take it you didnt see my message on PSN about how my patch had 2 admins and 10 VIPs with no lag at all and no crashes!! :black:
02-01-2011, 05:44 PM #15
Woof
...hmm
Originally posted by TheEliteMossy View Post
Heh, i have a screenshot somewhere hold on

---------- Post added at 12:32 PM ---------- Previous post was at 12:31 PM ----------

You must login or register to view this content.

what this do ?
    menuSlideIn()
02-01-2011, 05:52 PM #16
iJokaa
Haters Keep Me Going Winky Winky
Originally posted by TheEliteMossy View Post
Heh, i have a screenshot somewhere hold on

---------- Post added at 12:32 PM ---------- Previous post was at 12:31 PM ----------

You must login or register to view this content.


Menuhide? is the menu and test on from spawn but you just hide it when your not using it?
02-01-2011, 06:13 PM #17
d7w7z
Bounty hunter
Originally posted by Newelly View Post
Like Me Happy

I added a new part in spoilers at the bottom, Hope it helps to explain how it works a little bit better. Smile

The following user thanked d7w7z for this useful post:

02-01-2011, 06:48 PM #18
DEREKTROTTER
You're Goddamn Right
Originally posted by d7w7z View Post
Q


You made me even more space, +351 rep Claps
02-01-2011, 06:53 PM #19
d7w7z
Bounty hunter
Originally posted by DEREKTROTTER View Post
You made me even more space, +351 rep Claps

Haha, Bet you didnt think I'd be able to help you when you were helping me get mods for Mw2 on PC working Cool Man (aka Tustin)

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo