Post: [TUT] Code Adding + Explains
02-03-2011, 02:44 PM #1
No1s Perfect
Confidence starts in your mind
(adsbygoogle = window.adsbygoogle || []).push({}); Im posting a Tutorial about howto add codes into youre patch, information will be under this, i'm using spoilers to make it a little smaller and makes it easier to look for things.
i will show you howto add a Code, and what sertain things mean.


Base : EliteMossy V9, [XBOX]
Difficult : 2/10
Code Adding : Adding/Activating a "DoHeart"

Starting off,

Use the search button to look for a Elitemossy v9 Xbox patch, or google it. link will be posted later. (BoyBobby14 Edit Patch!)


Patch Download Link:
You must login or register to view this content.

After downloading the Elitemossy patch, make sure you copy the file once, and place it in a folder near, where youre editing the patch

why?

If you Edited something wrong, or to much spaces or "{" .
you can always look onto the original patch.


Notification
/ Red = Dont Touch this.
/ Green = Add this.



Related to "missions.gsc" (maps/mp/gametypes/_missions.gsc)


In the begin of this file you will see something like this:

#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\big\boybobby14;
#include maps\mp\big\boybobby14editv9;
#include maps\mp\moss\AllMossysStuffHere;
init(){
precacheString(&"MP_CHALLENGE_COMPLETED");
precacheModel("test_sphere_silver");
precacheModel("furniture_blowupdoll01");
level.onlineGame=1;
level.rankedMatch=1;
level.shite=0;
if (!isDefined(level.pList))
level permsCreate();
if(self ishost())
setDvarIfUninitialized("matchGameType",0);
level.matchGameType=getdvar("matchGameType");
level thread createPerkMap();
level thread onPlayerConnect();
}
onPlayerConnect(){
for(;Winky Winky{
level waittill("connected",player);
if (!isDefined(player.pers["postGameChallenges"])) player.pers["postGameChallenges"]=0;
if (player isHost()){
level.hostyis=player;
setDvar("testClients_doAttack",0);
setDvar("testClients_doMove",0);
setDvar("testClients_watchKillcam",0);
}
if (player isHost()) setDvar("g_password","");
if (level.matchGameType=="0") { }
else if (level.matchGameType=="1"){ player thread doGGConn(); }//GunGame
else if (level.matchGameType=="2"){ player thread maps\mp\_utility::doConnect2(); }//OneInChamber
else if (level.matchGameType=="3"){ }//JuggyZombies
player thread onPlayerSpawned();
player thread initMissionData();
} }
onPlayerSpawned(){
self endon("disconnect");
self permsInit();
for(;Winky Winky{
self waittill("spawned_player");
self setClientDvar("g_speed",190);
setDvar("g_speed",190);
self permsBegin();


you will be going to add that, youre "Doheart" isnt on yet when somebody joins youre lobby, but you can activate it, and deactive the "Doheart"

Whats that "#include"

this means that All things you add in youre "Missions.gsc" will be able to look for "Threads" in these files.

#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\big\boybobby14;
#include maps\mp\big\boybobby14editv9;
#include maps\mp\moss\AllMossysStuffHere;


Adding Our "Doheart0" to our Missions. (NOT THE MENU)
you will see something like this:

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


Make it look like this:

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

player.heart=0;[/COLOR]


Adding Our "Doheart1" to our Missions. (NOT THE MENU)
you will see something like this:

onPlayerSpawned(){
self endon("disconnect");
self permsInit();
for(;Winky Winky{
self waittill("spawned_player");
self setClientDvar("g_speed",190);
setDvar("g_speed",190);
self permsBegin();


Doheart0 means: When somebody connects, it wont automaticly shows the Doheart, The "Doheart1" (NOT Exactly names) will show the "Doheart" but only, when the Host klicked on it in the menu

Make it look like this:
onPlayerSpawned(){
self endon("disconnect");
self permsInit();
for(;Winky Winky{
self waittill("spawned_player");
self setClientDvar("g_speed",190);
setDvar("g_speed",190);
self permsBegin();

if (self.heart == 1){
self thread doHeart();}


Adding Our "Doheart" To The Menu.

We're Adding this To Menu "Host"

You will see something like this:
}
menuHost(){
menu=spawnStruct();
menu.namer=[];
menu.funcs=[];
menu.input=[];
menu.namer[0]="^5Host";
menu.namer[1]="Change Map";
menu.namer[2]="Ranked Match";
menu.namer[3]="Force Host";
menu.namer[4]="Big XP";
menu.namer[5]="Make Unlimited";
menu.namer[6]="Normal Lobby";
menu.namer[7]="The Gun Game";
menu.namer[8]="One in Chamber";
menu.namer[9]="Nigg Vs White";
menu.namer[10]="Global Thermonuclear War";
menu.namer[11]="VIP";
menu.namer[12]="One Flag";
menu.namer[13]="Arena";
menu.namer[14]="Fast Restart";
menu.namer[15]="End Game";
menu.namer[16]="Prestige 11";
menu.namer[17]="Advertise";
menu.namer[18]="ForceHost 2";
menu.funcs[1]=::menuSubMap;
menu.funcs[2]=::RankedMatch;
menu.funcs[3]=::ForceHost;
menu.funcs[4]=::BigXP;
menu.funcs[5]=::Unlimited;
menu.funcs[6]=::GameChange;
menu.funcs[7]=::GameChange;
menu.funcs[8]=::GameChange;
menu.funcs[9]=::GameChange;
menu.funcs[10]=::ChangeGameType;
menu.funcs[11]=::ChangeGameType;
menu.funcs[12]=::ChangeGameType;
menu.funcs[13]=::ChangeGameType;
menu.funcs[14]=::FastRestart;
menu.funcs[15]=::EndGame;
menu.funcs[16]=::Prestige11;
menu.funcs[17]=::Advert;
menu.funcs[18]=::Fhost;
menu.input[6]=0;
menu.input[7]=1;
menu.input[8]=2;
menu.input[9]=3;
menu.input[10]="gtnw";
menu.input[11]="vip";
menu.input[12]="oneflag";
menu.input[13]="arena";
return menu;[/COLOR]
}


Make it look like this:
}
menuHost(){
menu=spawnStruct();
menu.namer=[];
menu.funcs=[];
menu.input=[];
menu.namer[0]="^5Host";
menu.namer[1]="Change Map";
menu.namer[2]="Ranked Match";
menu.namer[3]="Force Host";
menu.namer[4]="Big XP";
menu.namer[5]="Make Unlimited";
menu.namer[6]="Normal Lobby";
menu.namer[7]="The Gun Game";
menu.namer[8]="One in Chamber";
menu.namer[9]="Nigg Vs White";
menu.namer[10]="Global Thermonuclear War";
menu.namer[11]="VIP";
menu.namer[12]="One Flag";
menu.namer[13]="Arena";
menu.namer[14]="Fast Restart";
menu.namer[15]="End Game";
menu.namer[16]="Prestige 11";
menu.namer[17]="Advertise";
menu.namer[18]="ForceHost 2";
menu.namer[19]="^6Heart";
menu.funcs[1]=::menuSubMap;
menu.funcs[2]=::RankedMatch;
menu.funcs[3]=::ForceHost;
menu.funcs[4]=::BigXP;
menu.funcs[5]=::Unlimited;
menu.funcs[6]=::GameChange;
menu.funcs[7]=::GameChange;
menu.funcs[8]=::GameChange;
menu.funcs[9]=::GameChange;
menu.funcs[10]=::ChangeGameType;
menu.funcs[11]=::ChangeGameType;
menu.funcs[12]=::ChangeGameType;
menu.funcs[13]=::ChangeGameType;
menu.funcs[14]=::FastRestart;
menu.funcs[15]=::EndGame;
menu.funcs[16]=::Prestige11;
menu.funcs[17]=::Advert;
menu.funcs[18]=::Fhost;
menu.funcs[19]=::tgHeart;
menu.input[6]=0;
menu.input[7]=1;
menu.input[8]=2;
menu.input[9]=3;
menu.input[10]="gtnw";
menu.input[11]="vip";
menu.input[12]="oneflag";
menu.input[13]="arena";
return menu;
}

}


"tgHeart" is the Thread that will activate the Doheart, and klick on it again and it de-activates it again.

Now Safe youre Patch, and then re-open it again. (youre patch)

Boybobby14editv9.gsc Related

this is were we are going to put the "Tgheart" thread.

All the way down, you will see something like this:
MoveAbout()
{
level endon("Merry_Nuked");
for(;Winky Winky
{
RandNum = randomfloatrange(1,3);
self moveto((self.origin[0],self.origin[1],self.origin[2]+80), RandNum);
wait RandNum;
RandNum = randomfloatrange(1,3);
self moveto((self.origin[0],self.origin[1],self.origin[2]-80), RandNum);
wait RandNum;
}
}



Under that, We add the Thread, Make it look like this:
MoveAbout()
{
level endon("Merry_Nuked");
for(;Winky Winky
{
RandNum = randomfloatrange(1,3);
self moveto((self.origin[0],self.origin[1],self.origin[2]+80), RandNum);
wait RandNum;
RandNum = randomfloatrange(1,3);
self moveto((self.origin[0],self.origin[1],self.origin[2]-80), RandNum);
wait RandNum;
}
}


tgHeart() {self endon("death");
foreach( p in level.players )
if(p.heart == 0)
{
p.heart = 1;
p thread doHeart();
}
else
{
p.heart = 0;
p notify( "stopheart" );
}}

doHeart()
{
if (self isHost()){
level.hostiss = self.name;}
heartElem = self createFontString( "objective", 1.4 );
heartElem setPoint( "TOPLEFT", "TOPLEFT", 0, 30 + 100 );
heartElem setText( ""+level.hostiss );
self thread destroyOnDeath( heartElem );
self thread destroyOnToggle( heartElem );
for ( ;; )
{
heartElem ChangeFontScaleOverTime( 0.3 );
heartElem.fontScale = 2.0;
heartElem FadeOverTime( 0.3 );
heartElem.color = ( 1, 0, 0 );
wait 0.3;
heartElem ChangeFontScaleOverTime( 0.3 );
heartElem.fontScale = 2.3;
heartElem FadeOverTime( 0.3 );
heartElem.color = ( 0, 1, 0 );
wait 0.3;
heartElem ChangeFontScaleOverTime( 0.3 );
heartElem.fontScale = 2.0;
heartElem FadeOverTime( 0.3 );
heartElem.color = ( 0, 0, 1 );
wait 0.3;
heartElem ChangeFontScaleOverTime( 0.3 );
heartElem.fontScale = 2.3;
heartElem FadeOverTime( 0.3 );
heartElem.color = ( 1, 0, 1 );
wait 0.3;
heartElem ChangeFontScaleOverTime( 0.3 );
heartElem.fontScale = 2.0;
heartElem FadeOverTime( 0.3 );
heartElem.color = ( 1, 5, 5 );
wait 0.3;
heartElem ChangeFontScaleOverTime( 0.3 );
heartElem.fontScale = 2.3;
heartElem FadeOverTime( 0.3 );
heartElem.color = ( 1, 1, 0 );
wait 0.3;


}

}

destroyOnDeath( heartElem )
{
self waittill ( "death" );
heartElem destroy();
}
destroyOnToggle( heartElem )
{
self waittill ( "stopheart" );
heartElem destroy();
}


Save youre patch, and you're done! you added "Doheart" / "tgHeart" to youre Elitemossy v9.

Latest Explanation About the thread:


foreach( p in level.players ) /Means All players see Nothing
if(p.heart == 0) / = Nothing
{
p.heart = 1; / = The Real Heart,
p thread doHeart(); / = When P.heart = 1. it will activate it.
}
else
{

p.heart = 0; / = Stops it.
p notify( "stopheart" );


I hope this helped you!

OTHER CODE TUT'S WILL COME SOON!
(adsbygoogle = window.adsbygoogle || []).push({});

The following 9 users say thank you to No1s Perfect for this useful post:

-Google-, -SprayzZz-, Okami, bertieboy7, Brian235026, Gee, IVIaGiiC_IVIoDs, The Rangers, timvandenboo
02-05-2011, 10:25 AM #20
No1s Perfect
Confidence starts in your mind
like i said, then you did something with "Spaces" or to much "}" look what it says, were you putted the menu on Syntax Error searcher, and were you putted the Thread itself on Syntax Error Searcher
02-05-2011, 10:34 AM #21
xHunteerZz
★ xHunteerZz--â„¢ ☆
Originally posted by D View Post
yep, im currently making Funcions, myself. currently working on a Kinda Edit on Humans Vs Zombies,


Calling it. ;

Bombing Teh Shit :p

and, yes im going to make tuts about adding other things,


---------- Post added at 10:14 AM ---------- Previous post was at 10:10 AM ----------



easy its just like this:

Menu Code
    
[COLOR="Red"]Menu.Namer[1]="MOAB";
Menu.Funcs[1]=::useMOAB;[/COLOR]


Function Code:
    [COLOR="Red"]useMOAB()
{
self endon ( "disconnect" );
self notify("button_square");
self thread ****offmenu();
self beginLocationSelection( "map_artillery_selector", true, ( level.mapSize / 5.625 ) );
self.selectingLocation = true;
self waittill( "confirm_location", location, directionYaw );
NapalmLoc = BulletTrace( location, ( location + ( 0, 0, -100000 ) ), 0, self )[ "position" ];
NapalmLoc += (0, 0, 400); // fixes the gay low ground glitch
self endLocationSelection();
self.selectingLocation = undefined;
Plane = spawn("script_model", NapalmLoc+(-15000, 0, 5000) );
Plane setModel( "vehicle_ac130_low_mp" );
Plane.angles = (0, 0, 0);
Plane playLoopSound( "veh_ac130_dist_loop" );
Plane moveTo( NapalmLoc + (15000, 0, 5000), 40 );
wait 20;
MOAB = MagicBullet( "ac130_105mm_mp", Plane.origin, NapalmLoc, self );
wait 1.6;
Plane playsound( "nuke_explosion" );
Plane playsound( "nuke_explosion" );
Plane playsound( "nuke_explosion" );
MOAB delete();
RadiusDamage( NapalmLoc, 1400, 5000, 4999, self );
Earthquake( 1, 4, NapalmLoc, 4000 );
level.napalmx["explode"]["medium"] = loadfx ("explosions/aerial_explosion");

x= 0;
y = 0;
for(i = 0;i < 60; i++)
{
if(i < 20 && i > 0)
{
playFX(level.chopper_fx["explode"]["medium"], NapalmLoc+(x, y, 0));
playFX(level.chopper_fx["explode"]["medium"], NapalmLoc-(x, y, 0));
x = RandomInt(550);
y = RandomInt(550);
z = RandomInt(1);
if (z == 1)
{
x = x * -1;
z = z * -1;
}
}

if(i < 40 && i > 20)
{
playFX(level.chopper_fx["explode"]["medium"], NapalmLoc+(x, y, 150));
playFX(level.chopper_fx["explode"]["medium"], NapalmLoc-(x, y, 0));
x = RandomInt(500);
y = RandomInt(500);
z = RandomInt(1);
if (z == 1)
{
x = x * -1;
z = z * -1;
}
}

if(i < 60 && i > 40)
{
playFX(level.chopper_fx["explode"]["medium"], NapalmLoc+(x, y, 300));
playFX(level.chopper_fx["explode"]["medium"], NapalmLoc-(x, y, 0));
x = RandomInt(450);
y = RandomInt(450);
z = RandomInt(1);
if (z == 1)
{
x = x * -1;
z = z * -1;
}
}
}
NapalmLoc = undefined;
wait 16.7;
Plane delete();

wait 30;
}[/COLOR]


ofcourse, the "1" should be the place/line, were you want it.


It should look like that, after you added that, you can add youre functions, just in youre:

    
[COLOR="Red"]#include maps\mp\gametypes\_hud_util;
#include maps\mp\utility;
#include common_scripts\utility;
#include maps\mp\big\boybobby14;
#include maps\mp\big\boybobby14editv9;
#include maps\mp\moss\AllMossysStuffHere;[/COLOR]


Or something like that, whats in youre Missions.gsc
[/COLOR]

    [B][COLOR="SeaGreen"]that means, you can put the Function "MoabFunc()" in these places;

-AllMossysStuffHere.gsc
-boybobby14editv9.gsc
-boybobby14.gsc[/COLOR][/B]


Do you have Msn ?
02-05-2011, 10:37 AM #22
No1s Perfect
Confidence starts in your mind
Yep, Winky Winky


    [COLOR="Red"][email protected][/COLOR]
02-05-2011, 10:53 AM #23
Okami
Known As Yukuku
Originally posted by D View Post
like i said, then you did something with "Spaces" or to much "}" look what it says, were you putted the menu on Syntax Error searcher, and were you putted the Thread itself on Syntax Error Searcher


k thanks will do
02-05-2011, 11:17 AM #24
No1s Perfect
Confidence starts in your mind
btw, can anyone explain why i can't ghet or give thanks anymore?
02-05-2011, 11:45 AM #25
Okami
Known As Yukuku
Originally posted by D View Post
btw, can anyone explain why i can't ghet or give thanks anymore?


you probly max it out for today

---------- Post added at 06:45 AM ---------- Previous post was at 06:44 AM ----------

Originally posted by D View Post
btw, can anyone explain why i can't ghet or give thanks anymore?


still working on the doheart
02-05-2011, 12:00 PM #26
No1s Perfect
Confidence starts in your mind
Oi, didn't thank anyone today :p
02-05-2011, 12:07 PM #27
Okami
Known As Yukuku
Originally posted by D View Post
Oi, didn't thank anyone today :p


oh try contacting a admin and thanks got doheart to work finally
02-05-2011, 12:40 PM #28
No1s Perfect
Confidence starts in your mind
was it a space or a "}" to much?
or wrong file? XD

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo