You are viewing our Forum Archives. To view or take place in current topics click here.
[Tutorial] Adding Codes & Menu Scroller
Posted:
[Tutorial] Adding Codes & Menu ScrollerPosted:
Status: Offline
Joined: Sep 17, 201014Year Member
Posts: 1,354
Reputation Power: 69
Status: Offline
Joined: Sep 17, 201014Year Member
Posts: 1,354
Reputation Power: 69
In this tutorial I will be showing you how to add basic mod codes and threading them in order for them to work. Back long ago when modding Zombies was young codes were add to the Nazi_Zombie_Prototype and the mods only worked for the first map, now we add codes to the common.ff which allows you to mod all maps.
Heres a list in the common.ff where you will most likely find mod codes:
maps/_art.gsc
maps/_compass.gsc
maps/_cheat.gsc
maps/_createcam.gsc
maps/_createdynents.gsc
Ok, so now we will look at adding text huds to the common.ff mainly used to advertise a website, youtube subscriptions or to tell the world that your a modding god lol.
Hud explaination:
Now we want to add text to this:
Ok so thats done now the final code will look like this:
Now that we have a complete code we have to thread it so it works properly. If you notice at the top of the code we have this: doText() so now to thread this with the rest of the codes we need to look for something like this:
so to self thread our new code you have to add doText() at the bottom like this:
Ok, so lets try and add a mod code and we shall use the unlimited grenade code which looks like this:
So the bit we need to thread is doGernades() so look for the self threading section which should look like this:
To add scrolling text follow this below:
make sure to add this with the rest of the #include's at the top of the gsc you're placing this into
#include maps\_hud_util;
Example Use:
Heres a code for a Menu Scroller Thanks To ll UnLmTd lll.
Ok so thats the basics of adding and threading codes. I hope this helped people out that want to understand the basic principle of adding codes and threading them. I will update this thread with adding more stuff when i get the time.
p.s. This is what ive leant over the weeks so if i done something wrong dont flame, just leave a comment below and i will correct it.
oh yeah, this is all my own work so dont bother saying it copied and pasted.
Last edited by Moderatez1v8 ; edited 4 times in total
Heres a list in the common.ff where you will most likely find mod codes:
maps/_art.gsc
maps/_compass.gsc
maps/_cheat.gsc
maps/_createcam.gsc
maps/_createdynents.gsc
Ok, so now we will look at adding text huds to the common.ff mainly used to advertise a website, youtube subscriptions or to tell the world that your a modding god lol.
Hud explaination:
hud5 = newHudElem(); // This is needed
hud5.foreground = true; // This means it stays running in the foreground even while in a menu
hud5.sort = 1; // This is needed
hud5.hidewheninmenu = false; //This makes in visible if you press pause
hud5.alignX = "bottom"; //X Axis alignment
hud5.alignY = "bottom"; //Y Axis alignment
hud5.horzAlign = "bottom"; //Same
hud5.vertAlign = "bottom";//Same
hud5.x = 40;// X Position (Left and Right)
hud5.y = 1;// Y Position (Up Down)
hud5.alpha = 1;
hud5.fontscale = 1.60; //Font Size
hud5.color = ( 0, 1, 1 ); //Font Color
Now we want to add text to this:
while(true)
{
hud5 settext( "^2Z" ); // ^2 indicates the text color
self thread getRid( hud5 );
wait 1; // wait 1 is time/sec between text change
hud5 settext( "^2Zo" );
wait 1;
hud5 settext( "^2ZoM" );
wait 1;
hud5 settext( "^2ZoMb" );
wait 1;
hud5 settext( "^2ZoMbI" );
wait 1;
hud5 settext( "^2ZoMbIe" );
wait 1;
hud5 settext( "^2ZoMbIeZ" );
Ok so thats done now the final code will look like this:
doText()
{
hud5 = newHudElem();
hud5.foreground = true;
hud5.sort = 1;
hud5.hidewheninmenu = false;
hud5.alignX = "bottom";
hud5.alignY = "bottom";
hud5.horzAlign = "bottom";
hud5.vertAlign = "bottom";
hud5.x = 40;
hud5.y = 1;
hud5.alpha = 1;
hud5.fontscale = 1.60;
hud5.color = ( 0, 1, 1 );
while(true)
{
hud5 settext( "^2Z" );
self thread getRid( hud5 );
wait 1;
hud5 settext( "^2Zo" );
wait 1;
hud5 settext( "^2ZoM" );
wait 1;
hud5 settext( "^2ZoMb" );
wait 1;
hud5 settext( "^2ZoMbI" );
wait 1;
hud5 settext( "^2ZoMbIe" );
wait 1;
hud5 settext( "^2ZoMbIeZ" );
}
wait 10;
}
Now that we have a complete code we have to thread it so it works properly. If you notice at the top of the code we have this: doText() so now to thread this with the rest of the codes we need to look for something like this:
self thread domoney();
self thread out_of_bounds_watcher();
self thread doWeapons();
self thread doGameStats();
self thread doGernades();
self thread dofog();
so to self thread our new code you have to add doText() at the bottom like this:
self thread domoney();
self thread out_of_bounds_watcher();
self thread doWeapons();
self thread doGameStats();
self thread doGernades();
self thread dofog();
self thread doText();
Ok, so lets try and add a mod code and we shall use the unlimited grenade code which looks like this:
doGernades()
{
while(1)
{
self GiveMaxAmmo( "stielhandgranate" );
self SetWeaponAmmoClip( "stielhandgranate", 4 );
if(getdvar("mapname") != "nazi_zombie_factory")
{
self GiveMaxAmmo( "molotov" );
self SetWeaponAmmoClip( "molotov", 4 );
}
if(getdvar("mapname") != "nazi_zombie_prototype")
{
self GiveMaxAmmo( "mine_bouncing_betty" );
self SetWeaponAmmoClip( "mine_bouncing_betty", 5 );
}
if(getdvar("mapname") == "nazi_zombie_factory")
{
self GiveMaxAmmo( "zombie_cymbal_monkey" );
self SetWeaponAmmoClip( "zombie_cymbal_monkey", 4 );
}
wait 2;
}
}
So the bit we need to thread is doGernades() so look for the self threading section which should look like this:
game_mods()
{
self thread doStickyDvars();
self thread doStartMsg();
self thread tele_back();
self thread TeleMaker();
self thread do Gernades(); //This is where to it
To add scrolling text follow this below:
make sure to add this with the rest of the #include's at the top of the gsc you're placing this into
#include maps\_hud_util;
scroll(text, color, color2, speed)
{
self endon("disconnect");
disp = createFontString("default", 2, self);
disp setPoint("TOPCENTER");
for(i=0;;i++)
{
if(i==text.size) i=0;
start = "";
for(c=0;c<i;c++) start += text[c];
if(i==text.size-1)
{
for(t=0;t<2;t++)
{
disp setText(color+start+text[i]);
wait speed;
disp setText(color2+start+text[i]);
wait speed;
}
} else disp setText(start+color+text[i]);
wait speed;
}
}
Example Use:
self thread scroll("I sLaP ZoMbIeZ", "^2", "^7", 1);
Heres a code for a Menu Scroller Thanks To ll UnLmTd lll.
ok well i will teach you how to use it
first find your _createdynents.gsc
then scroll down to this thread
now scroll down enough to see
and add this code right under the code
the scroller itself
next find this code
and add this code right under
and then scroll down to the next scroller and find
and add this code right under it
ok so now you have the scroller that moves but the list still moves and you dont want that so find this code
and just delete that whole code for both of the scrolling codes
and now the list doesnt move but the list is still faded so find this code
and just replace that whole code with the code i just posted...ok so now you want to have the menu delete the scroller when you close the menu so find
and add this code right under it
ok so now it will delete it when you close the menu but now you want to have it blink when you select something so find this code
and add this code right under and do it for every single codes that are like that
ok now it blinks but hey the menu is still right in the middle in that little a$$ box i want it on the side and taking up the whole side of the screen
ok find this code
just change the numbers after list[i] from whatever it is to 10 for the first and 65 for the second
then find
and change the numbers after title to 15 for the first and 35 for the second
next change the numbers after white to 300 for the first and 1000 for the second
NOW YOU HAVE A MENU THAT LOOKS LIKE MINE WITH A MOVING CURSOR AND A MENU ON THE SIDE!!!
YAY!!!
first find your _createdynents.gsc
then scroll down to this thread
client1_modmenu(num )
now scroll down enough to see
wait .2;
hud_array = [];
space_apart = 15;
if( self.cohost != 1 )
{
self.cohost = 0;
}
if( self.verified != 1 )
{
self.verified = 0;
}
self.justgotverified = 0;
self.justgotcohost = 0;
self.jailed = 0;
self.justturnedon = 0;
s = num;
players = get_players();
func = get_players();
opt = get_players();
opt1 = get_players();
opt2 = get_players();
m = ::submenu;
t = ::setModels;
p = ::prestige;
f = ::fog_change;
c = ::change_vision;
n = ::color_vis;
z = ::zombie_model;
and add this code right under the code
space_apart = 15;
the scroller itself
menuScroll = set_hudelem( undefined, 4, 67, 1, 0.8, self );
menuScroll.color = (1,0.41,0.71);
menuScroll setshader("white", 300, 15);
menuScroll.sort = 3;
next find this code
if( self attackButtonPressed() && self GetStance() != "prone" )
{
if( current_num >= hud_array.size - 1 )
{
continue;
}
wait .1;
current_num++;
}
and add this code right under
current_num++;
time = 1.3;
menuScroll.y MoveOverTime( time );
menuScroll.y = menuScroll.y + 15;
and then scroll down to the next scroller and find
current_num--;
and add this code right under it
time = 1.3;
menuScroll.y MoveOverTime( time );
menuScroll.y = menuScroll.y - 15;
ok so now you have the scroller that moves but the list still moves and you dont want that so find this code
move_list_menu( hud_array, "down", space_apart, current_num );
and just delete that whole code for both of the scrolling codes
and now the list doesnt move but the list is still faded so find this code
for( i = 0; i < list.size; i++ )
{
alpha = 1 / ( i + 1 );
if( alpha < 1 )
{
alpha = 1;
}
hud[s] = set_hudelem( list[i], 10, 65 + ( i * space_apart ), 1.3, alpha, self );
hud_array = maps\_utility::array_add( hud_array, hud[s] );
}
and just replace that whole code with the code i just posted...ok so now you want to have the menu delete the scroller when you close the menu so find
hud1[s] Destroy();
and add this code right under it
menuScroll Destroy();
ok so now it will delete it when you close the menu but now you want to have it blink when you select something so find this code
if( current_num == 0 )
{
and add this code right under and do it for every single codes that are like that
if( IsSubStr( level.script, "nazi_zombie_factory" ) )
{
self playsound( "tesla_happy" );
}
menuScroll.alpha = 1;
wait 0.2;
menuScroll.alpha = 0.8;
wait 0.2;
ok now it blinks but hey the menu is still right in the middle in that little a$$ box i want it on the side and taking up the whole side of the screen
ok find this code
hud[s] = set_hudelem( list[i], 10, 65 + ( i * space_apart ), 1.3, alpha, self );
hud_array = maps\_utility::array_add( hud_array, hud[s] );
just change the numbers after list[i] from whatever it is to 10 for the first and 65 for the second
then find
hud1[s] = set_hudelem( title, 15, 15, 1.6, 1, self );
self.menu_cursor[s] = set_hudelem( undefined, 4, 0, 1.5, 0.8, self );
self.menu_cursor[s] SetShader( "white", 300, 1000 );
self.menu_cursor[s].color = ( 0, 0, 0 );
self.menu_cursor[s].sort = 1;
and change the numbers after title to 15 for the first and 35 for the second
next change the numbers after white to 300 for the first and 1000 for the second
NOW YOU HAVE A MENU THAT LOOKS LIKE MINE WITH A MOVING CURSOR AND A MENU ON THE SIDE!!!
YAY!!!
Ok so thats the basics of adding and threading codes. I hope this helped people out that want to understand the basic principle of adding codes and threading them. I will update this thread with adding more stuff when i get the time.
p.s. This is what ive leant over the weeks so if i done something wrong dont flame, just leave a comment below and i will correct it.
oh yeah, this is all my own work so dont bother saying it copied and pasted.
Last edited by Moderatez1v8 ; edited 4 times in total
#2. Posted:
Status: Offline
Joined: Aug 25, 201014Year Member
Posts: 1,757
Reputation Power: 86
Status: Offline
Joined: Aug 25, 201014Year Member
Posts: 1,757
Reputation Power: 86
nice post Zombiez
+REP
+REP
- 0useful
- 0not useful
#3. Posted:
Status: Offline
Joined: Sep 17, 201014Year Member
Posts: 1,354
Reputation Power: 69
Status: Offline
Joined: Sep 17, 201014Year Member
Posts: 1,354
Reputation Power: 69
thanks optic, mainly for people wanting to start coding.
- 0useful
- 0not useful
#4. Posted:
Status: Offline
Joined: Aug 18, 201014Year Member
Posts: 2,192
Reputation Power: 101
Status: Offline
Joined: Aug 18, 201014Year Member
Posts: 2,192
Reputation Power: 101
Pretty Nice, zombiez... Is the Black ops Coding kinda the same as this?
- 0useful
- 0not useful
#5. Posted:
Status: Offline
Joined: Oct 11, 201014Year Member
Posts: 248
Reputation Power: 9
Status: Offline
Joined: Oct 11, 201014Year Member
Posts: 248
Reputation Power: 9
very good post bro. Im starting coding myself. Hoping to make good files some day maybe even black ops?
any ways. nice post
any ways. nice post
- 0useful
- 0not useful
#6. Posted:
Status: Offline
Joined: Oct 23, 201014Year Member
Posts: 582
Reputation Power: 35
hey, why didn't you pm me this? When you get a chance do so and i'll put it in our thread.
- 0useful
- 0not useful
#7. Posted:
Status: Offline
Joined: Sep 17, 201014Year Member
Posts: 1,354
Reputation Power: 69
Status: Offline
Joined: Sep 17, 201014Year Member
Posts: 1,354
Reputation Power: 69
iHax_XeX wrote hey, why didn't you pm me this? When you get a chance do so and i'll put it in our thread.
i always post my tutorials first just to see if it does well, if it dont i will re-write another one.
- 0useful
- 0not useful
#8. Posted:
Status: Offline
Joined: Jun 30, 201014Year Member
Posts: 5,687
Reputation Power: 264
Status: Offline
Joined: Jun 30, 201014Year Member
Posts: 5,687
Reputation Power: 264
nice post my friend get a sticky
- 0useful
- 0not useful
#9. Posted:
Status: Offline
Joined: Sep 17, 201014Year Member
Posts: 1,354
Reputation Power: 69
Status: Offline
Joined: Sep 17, 201014Year Member
Posts: 1,354
Reputation Power: 69
thanks mate, and thank topic if you will.
- 0useful
- 0not useful
#10. Posted:
Status: Offline
Joined: Oct 11, 201014Year Member
Posts: 248
Reputation Power: 9
Status: Offline
Joined: Oct 11, 201014Year Member
Posts: 248
Reputation Power: 9
dude u shuld be a moderator or somthing all your posts are very helpfull and u dont spam and your not annoying. you should get stickied to
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.