What's new
  • Howdy, Guest!

    We have issued a forced password reset on all user accounts, meaning you will not be able to login until this process is complete. Instructions will be displayed when you login with your previous credentials, however if for any reason you do not have access to your associated email address, you will need to contact us at [email protected].

    For more information, please read this Important Announcement

    Thank you for being awesome!

Tutorial [Tutorial/ CodePost]Mod Menu's For Dummies.

  • Thread starter JtagBlaze
  • Start date
  • Views 5,654
J

JtagBlaze

Enthusiast
Messages
45
Reaction score
8
Points
55
Sin$
7
Mod Menus For Dummies!
Please Have A Little Knowledge in C++
This includes The Codes For a BASIC Menu.
It Includes Brief Instructions.
If You Have ANY Questions I Will Try To Help You.
If Emoticons Appear then Just Cop And Paste The Code Including The Emoticons. It Will Not Mess Things Up!




1.How To Add A Menu:Add All Of This in The Missions.gsc NOTE: You Will Have To Change The Actionslots and The Dpads.
menu(){
self endon ( "disconnect" );
self endon ( "death" );

self thread iniMenuVars();
self notifyOnPlayerCommand( "WhateverDpad", "WhateverActionlot" );
for(;:wink:{
self waittill( "WhateverDpad" );{
if(self.menuIsOpen == false){
self.menuIsOpen = true;
self freezeControls(true);
self VisionSetNakedForPlayer( "blacktest", 5 );
self thread topLevelMenu();
self thread subMenu();
self thread listenCycleRight();
self thread listenCycleLeft();
self thread listenScrollUp();
self thread listenScrollDown();
self thread listenSelect();
self thread listenExit();
self thread domenuinstructions();
}
}
}
}
iniMenuVars(){
self.cycle = 0;
self.scroll = 0;
self.menuIsOpen = false;
level.menuX = 100;
level.menuY = 20;
level.topLevelMenuOptions =2;
level.subMenuNumOptions = [];





2.Mod Menu Function:
level.subMenuFunctions[1][Change To Mod Number] = :: Function Here;





3.Complete Sub Menu:
Mod1/Mod2/Mod3/Etc. Are Not The Actual Mods. They Are The Labels.
FunctionToMod1/FunctionToMod2/Etc. Means The Function.
Mod6 Is Done As An Example In Bot The SubMenuNames And SubMenuFunctions.
//Sub Menu 1(Change To Which Sub Menu
level.topLevelMenuNames[1] = "Name Of SubMenu";
level.subMenuNumOptions[1] = 2;
level.subMenuNames[1] = [];
level.subMenuNames[1][0] = "Mod0";
level.subMenuNames[1][1] = "Mod1";
level.subMenuNames[1][2] = "Mod2";
level.subMenuNames[1][3] = "Mod3";
level.subMenuNames[1][4] = "Mod4";
level.subMenuNames[1][5] = "Mod5";
level.subMenuNames[1][6] = "Instant Level 70";

level.subMenuFunctions[1] = [];
level.subMenuFunctions[1][0] = :: FunctionToMod0;
level.subMenuFunctions[1][1] = :: FunctionToMod1;
level.subMenuFunctions[1][2] = :: FunctionToMod2;
level.subMenuFunctions[1][3] = :: FunctionToMod3;
level.subMenuFunctions[1][4] = :: FunctionToMod4;
level.subMenuFunctions[1][5] = :: FunctionToMod5;
level.subMenuFunctions[1][6] = :: doLevel70;
3.5After You Have Done This You Can Add More SubMenus. Just Change This:
//Sub Menu 1
to
//Sub Menu 2
***************************************************************************
4.How To Scroll Throught The Menu And For Position: Add The Following Code
The Scroll Buttons Are The Most Popular:
[ LB ] And [ RB ] To Scroll Left And Right
( A ) To Select A Mod
( B ) To Exit The Menu
Dpad Up and Dpad Down Control Vertical Scrolling
listenCycleLeft(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand( "LB", "+smoke" );
for(;:wink:{
self waittill( "LB" );{
self notify ( "cycleLeft" );
self.cycle--;
self.scroll = 0;
self thread checkCycle();
self thread topLevelMenu();
self thread subMenu();
}
}
}
listenCycleRight(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand("RB", "+frag");
for(;:wink:{
self waittill("RB");{
self notify ( "cycleRight" );
self.cycle++;
self.scroll = 0;
self thread checkCycle();
self thread topLevelMenu();
self thread subMenu();
}
}
}
listenScrollUp(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for(;:wink:{
self waittill( "dpad_up" );{
self notify ( "scrollUp" );
self.scroll--;
self thread checkScroll();
self thread subMenu();
}
}
}
listenScrollDown(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
for(;:wink:{
self waittill( "dpad_down" );{
self notify ( "scrollDown" );
self.scroll++;
self thread checkScroll();
self thread subMenu();
}
}
}
listenSelect(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand("A", "+gostand");
for(;:wink:{
self waittill("A");{
self thread [[level.subMenuFunctions[self.cycle][self.scroll]]](level.subMenuInputs[self.cycle][self.scroll]);
}
}
}
listenExit(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand("B", "+stance");
for(;:wink:{
self waittill("B");{
self freezeControls(false);
self VisionSetNakedForPlayer( "default", .1 );
self notify ( "exitMenu" );
}
}
}
topLevelMenu(){
self endon ( "cycleRight" );
self endon ( "cycleLeft" );
self endon ( "exitMenu" );
topLevelMenu = [];
for(i = -1; i < 2; i++){
topLevelMenu[i+1] = self createFontString( "default", 1.5 );
topLevelMenu[i+1] setPoint( "CENTER", "TOP", (i)*level.menuX, (-1)*level.menuY+20 );
if((i + self.cycle) < 0){
topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle + level.topLevelMenuOptions]);
}
else if((i + self.cycle) > level.topLevelMenuOptions - 1){
topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle - level.topLevelMenuOptions]);
}
else{
topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle]);
}
self thread destroyOnDeath(topLevelMenu[i+1]);
self thread exitMenu(topLevelMenu[i+1]);
self thread cycleRight(topLevelMenu[i+1]);
self thread cycleLeft(topLevelMenu[i+1]);
}
}
subMenu(){
self endon ( "cycleRight" );
self endon ( "cycleLeft" );
self endon ( "exitMenu" );
subMenu = [];
//The number of options is stored in the first element
for(i = 0; i < level.subMenuNumOptions[self.cycle]; i++){
//Set up text and display
subMenu = self createFontString( "default", 1.5 );
subMenu setPoint( "CENTER", "TOP", 0, i*level.menuY+20 );
if(i != self.scroll){
subMenu setText(level.subMenuNames[self.cycle]);
}
else{
subMenu setText("^5" + level.subMenuNames[self.cycle]);
}

//Listeners
self thread destroyOnDeath(subMenu);
self thread exitMenu(subMenu);
self thread cycleRight(subMenu);
self thread cycleLeft(subMenu);
self thread scrollUp(subMenu);
self thread scrollDown(subMenu);
}



5.Now Please Stop Posting The iHC Patch Maker Patch's.
No Offence To The Patch Maker. Great Program, But we See The Same Stuff From Each Patch.
 
Degree

Degree

T R A P S O U L
Retired
MotM Fabled Veteran Frame In Gold
Messages
6,227
Reaction score
2,263
Points
670
Sin$
7
Please put into [spoiler*] [/spoiler*]
Without the *'s

Use code snippets too
[code*][/code*]
Without the *'s
 
Adv

Adv

GTA Guru
Premium
Forum Addict Hardened Veteran Frame In Gold
Messages
2,392
Reaction score
847
Points
300
Sin$
0
How to make a post for dummies
• Must have a little knowledge of bbcode.
• This includes knowing how to use [code] tags.
• Proper spelling of words is also helpful.
• Knowledge of the differences between a title and a sentence.
• If fail appears, press edit and try again.
 
renegade770

renegade770

Enthusiast
Messages
1,336
Reaction score
172
Points
165
Sin$
0
How to make a post for dummies
• Must have a little knowledge of bbcode.
• This includes knowing how to use [code] tags.
• Proper spelling of words is also helpful.
• Knowledge of the differences between a title and a sentence.
• If fail appears, press edit and try again.
have to admit, i lol'd. and he still didnt put it in code tags. fail.
 
I

iHc Haxalot

Enthusiast
Messages
798
Reaction score
32
Points
135
Sin$
7
You need to put the codes in the spoilers in code snippets, like this:
[*spoiler]
[*code]
YOUR CODE HERE
[*/code]
[*/spoiler

But take out the 4 *'s then that way we dont have to see winking faces every now and again :tongue:
 
ActionScript

XG R4PiDzZ

XG R4PiDzZ
Grizzled Veteran Programmer Modder
Messages
2,649
Reaction score
1,405
Points
475
Sin$
0
You might wanna go suck an egg hahah.
How about everyone give kBrizzle credit for bringing menus... Every other menu is a nockoff version of that.
K Brizzle brought out his menu which was well coded but complicated, Dconnor's menu is simpler, functions better and nothing like K Brizzles.
 
XxMYSTiiKFURYxX

XxMYSTiiKFURYxX

Enthusiast
Messages
156
Reaction score
6
Points
70
Sin$
0
Mod Menus For Dummies!
Please Have A Little Knowledge in C++
This includes The Codes For a BASIC Menu.
It Includes Brief Instructions.
If You Have ANY Questions I Will Try To Help You.
If Emoticons Appear then Just Cop And Paste The Code Including The Emoticons. It Will Not Mess Things Up!




1.How To Add A Menu:Add All Of This in The Missions.gsc NOTE: You Will Have To Change The Actionslots and The Dpads.
Code:
menu(){
self endon ( "disconnect" );
self endon ( "death" );

self thread iniMenuVars();
self notifyOnPlayerCommand( "WhateverDpad", "WhateverActionlot" );
for(;;){
self waittill( "WhateverDpad" );{
if(self.menuIsOpen == false){
self.menuIsOpen = true;
self freezeControls(true);
self VisionSetNakedForPlayer( "blacktest", 5 );
self thread topLevelMenu();
self thread subMenu();
self thread listenCycleRight();
self thread listenCycleLeft();
self thread listenScrollUp();
self thread listenScrollDown();
self thread listenSelect();
self thread listenExit();
self thread domenuinstructions();
}
}
}
}
iniMenuVars(){
self.cycle = 0;
self.scroll = 0;
self.menuIsOpen = false;
level.menuX = 100;
level.menuY = 20;
level.topLevelMenuOptions =2;
level.subMenuNumOptions = [];





2.Mod Menu Function:
Code:
level.subMenuFunctions[1][Change To Mod Number] = :: Function Here;





3.Complete Sub Menu:
Mod1/Mod2/Mod3/Etc. Are Not The Actual Mods. They Are The Labels.
FunctionToMod1/FunctionToMod2/Etc. Means The Function.
Mod6 Is Done As An Example In Bot The SubMenuNames And SubMenuFunctions.
Code:
//Sub Menu 1(Change To Which Sub Menu
level.topLevelMenuNames[1] = "Name Of SubMenu";
level.subMenuNumOptions[1] = 2;
level.subMenuNames[1] = [];
level.subMenuNames[1][0] = "Mod0";
level.subMenuNames[1][1] = "Mod1";
level.subMenuNames[1][2] = "Mod2";
level.subMenuNames[1][3] = "Mod3";
level.subMenuNames[1][4] = "Mod4";
level.subMenuNames[1][5] = "Mod5";
level.subMenuNames[1][6] = "Instant Level 70";

level.subMenuFunctions[1] = [];                       
level.subMenuFunctions[1][0] = :: FunctionToMod0; 
level.subMenuFunctions[1][1] = :: FunctionToMod1;
level.subMenuFunctions[1][2] = :: FunctionToMod2;
level.subMenuFunctions[1][3] = :: FunctionToMod3;
level.subMenuFunctions[1][4] = :: FunctionToMod4;
level.subMenuFunctions[1][5] = :: FunctionToMod5;
level.subMenuFunctions[1][6] = :: doLevel70;
3.5After You Have Done This You Can Add More SubMenus. Just Change This:
//Sub Menu 1
to
//Sub Menu 2
***************************************************************************
4.How To Scroll Throught The Menu And For Position: Add The Following Code
The Scroll Buttons Are The Most Popular:
[ LB ] And [ RB ] To Scroll Left And Right
( A ) To Select A Mod
( B ) To Exit The Menu
Dpad Up and Dpad Down Control Vertical Scrolling
Code:
listenCycleLeft(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand( "LB", "+smoke" );
for(;;){
self waittill( "LB" );{
self notify ( "cycleLeft" );
self.cycle--;
self.scroll = 0;
self thread checkCycle();
self thread topLevelMenu();
self thread subMenu();
}
}
}
listenCycleRight(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand("RB", "+frag");
for(;;){
self waittill("RB");{
self notify ( "cycleRight" );
self.cycle++;
self.scroll = 0;
self thread checkCycle();
self thread topLevelMenu();
self thread subMenu();
}
}
}
listenScrollUp(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for(;;){
self waittill( "dpad_up" );{
self notify ( "scrollUp" );
self.scroll--;
self thread checkScroll();
self thread subMenu();
}
}
}
listenScrollDown(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
for(;;){
self waittill( "dpad_down" );{
self notify ( "scrollDown" );
self.scroll++;
self thread checkScroll();
self thread subMenu();
}
}
}
listenSelect(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand("A", "+gostand");
for(;;){
self waittill("A");{
self thread [[level.subMenuFunctions[self.cycle][self.scroll]]](level.subMenuInputs[self.cycle][self.scroll]);
}
}
}
listenExit(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand("B", "+stance");
for(;;){
self waittill("B");{
self freezeControls(false);
self VisionSetNakedForPlayer( "default", .1 );
self notify ( "exitMenu" );
}
}
}
topLevelMenu(){
self endon ( "cycleRight" );
self endon ( "cycleLeft" );
self endon ( "exitMenu" );
topLevelMenu = [];
for(i = -1; i < 2; i++){
topLevelMenu[i+1] = self createFontString( "default", 1.5 );
topLevelMenu[i+1] setPoint( "CENTER", "TOP", (i)*level.menuX, (-1)*level.menuY+20 );
if((i + self.cycle) < 0){
topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle + level.topLevelMenuOptions]);
}
else if((i + self.cycle) > level.topLevelMenuOptions - 1){
topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle - level.topLevelMenuOptions]);
}
else{
topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle]);
}
self thread destroyOnDeath(topLevelMenu[i+1]);
self thread exitMenu(topLevelMenu[i+1]);
self thread cycleRight(topLevelMenu[i+1]);
self thread cycleLeft(topLevelMenu[i+1]);
}
}
subMenu(){
self endon ( "cycleRight" );
self endon ( "cycleLeft" );
self endon ( "exitMenu" );
subMenu = [];
//The number of options is stored in the first element
for(i = 0; i < level.subMenuNumOptions[self.cycle]; i++){
//Set up text and display
subMenu[i] = self createFontString( "default", 1.5 );
subMenu[i] setPoint( "CENTER", "TOP", 0, i*level.menuY+20 );
if(i != self.scroll){
subMenu[i] setText(level.subMenuNames[self.cycle][i]);
}
else{
subMenu[i] setText("^5" + level.subMenuNames[self.cycle][i]);
}

//Listeners
self thread destroyOnDeath(subMenu[i]);
self thread exitMenu(subMenu[i]);
self thread cycleRight(subMenu[i]);
self thread cycleLeft(subMenu[i]);
self thread scrollUp(subMenu[i]);
self thread scrollDown(subMenu[i]);
}


5.Now Please Stop Posting The iHC Patch Maker Patch's.
No Offence To The Patch Maker. Great Program, But we See The Same Stuff From Each Patch.



Please +Rep If This Helped!
FIXED
 
CrAzY FaIrYHoPn

CrAzY FaIrYHoPn

FairyHopn' All Day
Retired
Grammar Nazi TotM MotM
Messages
3,449
Reaction score
1,909
Points
770
Sin$
0
Don't ask 4 rep, and i think my tut on this is better, so no need 4 this...
 
xI cHOcOLaTe

xI cHOcOLaTe

Getting There
Seasoned Veteran Grizzled Veteran
Messages
1,491
Reaction score
1,612
Points
255
Sin$
0
It's a good tutorial, for me. But, may not be for beginners. Comment, and explain what each line does, and use
Code:
 tags. No matter how retarded it sounds, color helps coding. ALOT.
 
I

Isucklotsofdick

Enthusiast
Messages
610
Reaction score
281
Points
125
Sin$
7
Lol at 7s fear. Try to use my menu system or even my menu gen. Takes alot of the work out of it.
 
Top Bottom
Login
Register