- Inscription
- 6 Janvier 2013
- Messages
- 865
- Réactions
- 340
- Points
- 1 093
logic coding [ Le mec qui va traduire sera récompenser. ]
[video=youtube;Jm6UTtnP_jc]
Vous devez être inscrit pour voir les liens ! Inscrivez-vous ou connectez-vous ici.
Hey ngu, I'm doing a tutorial for explain to you what is logic, and how to use this . Probably some of you alardy know what is logic , but some of you no. so let's me explain everything , logic is a coding create by
For start a good logic menu , you need this code for rebinds all your unbinds buttons , like dpad_up/dpad_down , etc . just put this into your CFG , also at the end of " close " code put exec thumbstick_default.cfg;vstr TL .
So now you have that into your .CFG , let's start your open. You need to put "bind apad_up vstr ng" into the first line of the code, like this : set open "bind apad_up vstr ng;" then , at the end of your open code , you need to put vstr binds , ( or a variable to go your binds ) . Your binds will be really important. That what will open your logic menu , and also what will active your scroll. Here a example of my binds ,
The MB is the variable will start your scrolling and open your menu , you need to put MB into your menu like this :
Also , you need to put set UT ""; like a nullbytes in your menu , Ut1, will be the value get toggle by the UT Nullbytes, like the set Ut "", become set Ut "Ut1", whitout have to put set Ut "ut1" in your menu , that how the toggle remember where is was , so its will toggle to Ut2 ( if have ) , Example : "toggle Ut \"vstr Ut1\" \"vstr Ut2\";vstr Ut";its will always read the toggle code left to right. Now you know how the logic toggle work , what about start the scrolling ? , There we go : For get scrolling you need to put
, Like you can see I have put set Dt "", and not Set Ut "", that because we have alardy put Ut nullbytes into the menu before the scrolling tutorials . Like i say later , the toggle will always get read left to right , so for Ut, " ut3, ut2, ut1," everytime you press dpad_up they will read another toggle , left to right , that will make your scroll at the end you have Ut10 , That will make your menu get to the Last line again when finish scrolling up . Same for Dt, you start with \"vstr Dt2\" , because the open menu will get to Ut1, ( because we have put that into MB ) , So now you know how to make your scrolling toggle , lets make the Menu setup ,
Why put into the setup , "toggle Ut/Dt \"vstr Ut1\"; , That for put the nullbytes Ut or Dt to the same number we scrolling like i say , that read the toggle left to right , so if I put set Dt9 "toggle Ut \"vstr Ut9\" , when I will press dpad_up that will scrollup yo Ut8 , because the set Ut "" was put to Ut9, And Left to right =
set Ua "toggle Ut \"vstr Ut10\" \"vstr Ut9\" \"vstr Ut8\" \"vstr Ut7\"
Same for Dt, then now your menu setup is ready, lets start the main menu .
Alots of ppl use "\""Test"\"" for make they menu text, But with logic we will use a new ways , its give the possibility to use the same Dvars for differants text. We start to build with "\" first, there a example "\"^1Main Title;" , You can add more text like that "\"^1Main Title;\" o1;\"Main Menu1\" o2;\"Main Menu2\" and to what you want , dont forget to put a variable like " set 1 "\"Maintitle blabla " and left to right so if you put more then 12 lines , that will show the last options and hide the first for make this 12 lines ,there we go , Let's make the main menu .
The "T" is the variable for Title , like o1 is the variable for subs menu 1, the ^7 is a space. Now for active this menu , but this ,
, be sure to put bind apad_up vstr MB1 when you press Select, or put a toggle to active this , whitout a vstr to menu1 , the text will not get show,
MF1/MF2/MF3 is the fonctions , Just put like "set MMF1 "cg_forcelaseron 1" etc, For make a subs menu do the same thing you do for the first menu , "set mmaaaax1 "\" etc ," and put again set MB1 vstr , ( Change the vstr variable to another or its will open your main menu again lol ) , like vstr mmaaaax1, There a example set MMF1 "toggle Ut \"vstr Ut1\";vstr Ut;vstr SubsMenu2"
set SubsMenu2 "set Mb1 vstr mmaaaax1;set mb2 vstr mmaaaax2;set mf1 vstr mm1f; etc,
For the "X" , You can put set X vstr close if you are into the main menu or just
set X "toggle Ut \"vstr Ut*\";vstr Ut;vstr MainMenu1" ( Main Menu 1 is the Menu to go , like MMB1 or something else ( the * is the number you want )
This Will Be Updated !
If I have forget something , tell me
If you need help , inbox me , or add me skype : live:Axysgod
Vous devez être inscrit pour voir les liens ! Inscrivez-vous ou connectez-vous ici.
aka Unbounduser, this probably the most advanced coding for cfg , its become very easy when you can understand all , so let's start with coding example . ( First NGU POST + First Tutorial )For start a good logic menu , you need this code for rebinds all your unbinds buttons , like dpad_up/dpad_down , etc . just put this into your CFG , also at the end of " close " code put exec thumbstick_default.cfg;vstr TL .
Code:
[COLOR="#DAA520"]set TL "bind apad_up vstr ng;bind BUTTON_RSHLDR +attack;bind BUTTON_LSHLDR +speed_throw;bind BUTTON_RTRIG +frag;bind BUTTON_LTRIG +smoke;bind BUTTON_RSTICK +stance;bind BUTTON_LSTICK +breath_sprint;bind BUTTON_START togglemenu;bind BUTTON_A vstr A;bind BUTTON_B +melee;bind BUTTON_X +usereload;bind BUTTON_Y weapnext;bind DPAD_UP vstr Open;bind DPAD_DOWN +actionslot 2;bind DPAD_LEFT +actionslot 3;bind DPAD_RIGHT +actionslot 4;vstr debug;bind APAD_UP vstr clear"[/COLOR]"
Code:
set Binds "bind DPAD_UP vstr UP;bind DPAD_DOWN vstr DOWN;bind BUTTON_RSTICK vstr R3;bind BUTTON_X vstr x;vstr MB"
Code:
set MB "toggle Ut \"vstr Ut1\";vstr Ut"
Code:
set Ua "toggle Ut \"vstr Ut10\" \"vstr Ut9\" \"vstr Ut8\" \"vstr Ut7\" \"vstr Ut6\" \"vstr Ut5\" \"vstr Ut4\" \"vstr Ut3\" \"vstr Ut2\" \"vstr Ut1\" \"vstr Ut10\";vstr Ut"
set Da "toggle Dt \"vstr Dt2\" \"vstr Dt3\" \"vstr Dt4\" \"vstr Dt5\" \"vstr Dt6\" \"vstr Dt7\" \"vstr Dt8\" \"vstr Dt9\" \"vstr Dt10\" \"vstr Dt1\" \"vstr Dt2\";vstr Dt";set Dt ""
Code:
[COLOR="#800080"]set Ut1 "toggle Dt \"vstr Dt1\";set MF vstr MF1;set MB vstr MB1;vstr MB"
set Ut2 "toggle Dt \"vstr Dt2\";set R3 vstr MF2;set MB vstr MB2;vstr MB"
set Ut3 "toggle Dt \"vstr Dt3\";set R3 vstr MF3;set MB vstr MB3;vstr MB"
set Ut4 "toggle Dt \"vstr Dt4\";set R3 vstr MF4;set MB vstr MB4;vstr MB"
set Ut5 "toggle Dt \"vstr Dt5\";set R3 vstr MF5;set MB vstr MB5;vstr MB"
set Ut6 "toggle Dt \"vstr Dt6\";set R3 vstr MF6;set MB vstr MB6;vstr MB"
set Ut7 "toggle Dt \"vstr Dt7\";set R3 vstr MF7;set MB vstr MB7;vstr MB"
set Ut8 "toggle Dt \"vstr Dt8\";set R3 vstr MF8;set MB vstr MB8;vstr MB"
set Ut9 "toggle Dt \"vstr Dt9\";set R3 vstr MF9;set MB vstr MB9;vstr MB"
set Ut10 "toggle Dt \"vstr Dt10\";set R3 vstr MF10;set MB vstr MB10;vstr MB"
set Dt1 "toggle Ut \"vstr Ut1\";set R3 vstr MF1;set MB vstr MB1;vstr MB"
set Dt2 "toggle Ut \"vstr Ut2\";set R3 vstr MF2;set MB vstr MB2;vstr MB"
set Dt3 "toggle Ut \"vstr Ut3\";set R3 vstr MF3;set MB vstr MB3;vstr MB"
set Dt4 "toggle Ut \"vstr Ut4\";set R3 vstr MF4;set MB vstr MB4;vstr MB"
set Dt5 "toggle Ut \"vstr Ut5\";set R3 vstr MF5;set MB vstr MB5;vstr MB"
set Dt6 "toggle Ut \"vstr Ut6\";set R3 vstr MF6;set MB vstr MB6;vstr MB"
set Dt7 "toggle Ut \"vstr Ut7\";set R3 vstr MF7;set MB vstr MB7;vstr MB"
set Dt8 "toggle Ut \"vstr Ut8\";set R3 vstr MF8;set MB vstr MB8;vstr MB"
set Dt9 "toggle Ut \"vstr Ut9\";set R3 vstr MF9;set MB vstr MB9;vstr MB"
set Dt10 "toggle Ut \"vstr Ut10\";set R3 vstr MF10;set MB vstr MB10;vstr MB"[/COLOR]
set Ua "toggle Ut \"vstr Ut10\" \"vstr Ut9\" \"vstr Ut8\" \"vstr Ut7\"
Same for Dt, then now your menu setup is ready, lets start the main menu .
Alots of ppl use "\""Test"\"" for make they menu text, But with logic we will use a new ways , its give the possibility to use the same Dvars for differants text. We start to build with "\" first, there a example "\"^1Main Title;" , You can add more text like that "\"^1Main Title;\" o1;\"Main Menu1\" o2;\"Main Menu2\" and to what you want , dont forget to put a variable like " set 1 "\"Maintitle blabla " and left to right so if you put more then 12 lines , that will show the last options and hide the first for make this 12 lines ,there we go , Let's make the main menu .
Code:
[COLOR="#0000CD"]set MMB1 "\"MAIN MENU\" T;^7;\"^4[ sub menu 1 ]\" O1;\"sub menu 2\" O2;\"sub menu 3\" O3;\"sub menu 4\" O4;\"sub menu 5\" O5;\"sub menu 6\" O6;\"sub menu 7\" O7;\"sub menu 8\" O8;\"sub menu 9\" O9;\"sub menu 10\" O10"
set MMB2 "\"MAIN MENU\" T;^7;\"sub menu 1\" O1;\"^4[ sub menu 2 ]\" O2;\"sub menu 3\" O3;\"sub menu 4\" O4;\"sub menu 5\" O5;\"sub menu 6\" O6;\"sub menu 7\" O7;\"sub menu 8\" O8;\"sub menu 9\" O9;\"sub menu 10\" O10"
set MMB3 "\"MAIN MENU\" T;^7;\"sub menu 1\" O1;\"sub menu 2\" O2;\"^4[ sub menu 3 ]\" O3;\"sub menu 4\" O4;\"sub menu 5\" O5;\"sub menu 6\" O6;\"sub menu 7\" O7;\"sub menu 8\" O8;\"sub menu 9\" O9;\"sub menu 10\" O10"
set MMB4 "\"MAIN MENU\" T;^7;\"sub menu 1\" O1;\"sub menu 2\" O2;\"sub menu 3\" O3;\"^4[ sub menu 4 ]\" O4;\"sub menu 5\" O5;\"sub menu 6\" O6;\"sub menu 7\" O7;\"sub menu 8\" O8;\"sub menu 9\" O9;\"sub menu 10\" O10"
set MMB5 "\"MAIN MENU\" T;^7;\"sub menu 1\" O1;\"sub menu 2\" O2;\"sub menu 3\" O3;\"sub menu 4\" O4;\"^4[ sub menu 5 ]\" O5;\"sub menu 6\" O6;\"sub menu 7\" O7;\"sub menu 8\" O8;\"sub menu 9\" O9;\"sub menu 10\" O10"
set MMB6 "\"MAIN MENU\" T;^7;\"sub menu 1\" O1;\"sub menu 2\" O2;\"sub menu 3\" O3;\"sub menu 4\" O4;\"sub menu 5\" O5;\"^4[ sub menu 6 ]\" O6;\"sub menu 7\" O7;\"sub menu 8\" O8;\"sub menu 9\" O9;\"sub menu 10\" O10"
set MMB7 "\"MAIN MENU\" T;^7;\"sub menu 1\" O1;\"sub menu 2\" O2;\"sub menu 3\" O3;\"sub menu 4\" O4;\"sub menu 5\" O5;\"sub menu 6\" O6;\"^4[ sub menu 7 ]\" O7;\"sub menu 8\" O8;\"sub menu 9\" O9;\"sub menu 10\" O10"
set MMB8 "\"MAIN MENU\" T;^7;\"sub menu 1\" O1;\"sub menu 2\" O2;\"sub menu 3\" O3;\"sub menu 4\" O4;\"sub menu 5\" O5;\"sub menu 6\" O6;\"sub menu 7\" O7;\"^4[ sub menu 8 ]\" O8;\"sub menu 9\" O9;\"sub menu 10\" O10"
set MMB9 "\"MAIN MENU\" T;^7;\"sub menu 1\" O1;\"sub menu 2\" O2;\"sub menu 3\" O3;\"sub menu 4\" O4;\"sub menu 5\" O5;\"sub menu 6\" O6;\"sub menu 7\" O7;\"sub menu 8\" O8;\"^4[ sub menu 9 ]\" O9;\"sub menu 10\" O10"
set MMB10 "\"MAIN MENU\" T;^7;\"sub menu 1\" O1;\"sub menu 2\" O2;\"sub menu 3\" O3;\"sub menu 4\" O4;\"sub menu 5\" O5;\"sub menu 6\" O6;\"sub menu 7\" O7;\"sub menu 8\" O8;\"sub menu 9\" O9;\"^4[ sub menu 10 ]\" O10"[/COLOR]
Code:
set menu1 "set MB1 vstr MMB1;set MB2 vstr MMB2;set MB3 vstr MMB3;set MB4 vstr MMB4;set MB5 vstr MMB5;set MB6 vstr MMB6;set MB7 vstr MMB7;set MB8 vstr MMB8;set MB9 vstr MMB9;set MB10 vstr MMB10;set MB11 vstr Ng;set MB12 vstr Ng;set MB13 vstr Ng;set MB14 vstr Ng;set MB15 vstr Ng;set MF1 vstr MMF1;set MF2 vstr MMF2;set MF3 vstr MMF3;set MF4 vstr MMF4;set MF5 vstr MMF5;set MF6 vstr MMF6;set MF7 vstr MMF7;set MF8 vstr MMF8;set MF9 vstr MMF9;set MF10 vstr MMF10
MF1/MF2/MF3 is the fonctions , Just put like "set MMF1 "cg_forcelaseron 1" etc, For make a subs menu do the same thing you do for the first menu , "set mmaaaax1 "\" etc ," and put again set MB1 vstr , ( Change the vstr variable to another or its will open your main menu again lol ) , like vstr mmaaaax1, There a example set MMF1 "toggle Ut \"vstr Ut1\";vstr Ut;vstr SubsMenu2"
set SubsMenu2 "set Mb1 vstr mmaaaax1;set mb2 vstr mmaaaax2;set mf1 vstr mm1f; etc,
For the "X" , You can put set X vstr close if you are into the main menu or just
set X "toggle Ut \"vstr Ut*\";vstr Ut;vstr MainMenu1" ( Main Menu 1 is the Menu to go , like MMB1 or something else ( the * is the number you want )
This Will Be Updated !
If I have forget something , tell me
If you need help , inbox me , or add me skype : live:Axysgod