You are viewing our Forum Archives. To view or take place in current topics click here.
ZZ9's bind menu tutorial :: everything you need to know!
Posted:

ZZ9's bind menu tutorial :: everything you need to know!Posted:

ZZ9
  • TTG Contender
Status: Offline
Joined: Apr 19, 201113Year Member
Posts: 3,394
Reputation Power: 214
Status: Offline
Joined: Apr 19, 201113Year Member
Posts: 3,394
Reputation Power: 214
Hello and welcome to my topic!
This topic is supposed to help you understand all the stuff you need to make a good bind menu.
I wrote all of this from the top of my head. Excuse mistakes.


Take the time and read this. I hope after you've read this you'll know more and be able to create some nice menus






ITT:
[1] - Getting started, ways to start a bind menu.
[2] - Menu styles.. What's good, what's bad?
[3] - Multiple ways of toggling.
[4] - How to put map infections to your menu.
[5] - All buttons + What buttons stick.
[6] - setfromdvar in general.





[1] - Getting started, ways to start a bind menu.

There are 2 popular ways you can use.
- using activeaction
- using ui_mapname

activeaction works like onPlayerConnect. Whatever you've added to it will be set when you connect to your next game.

So if we add:
    self setClientDvar("activeaction", "r_znear 50;cg_gun_x 5");


We'll have Wallhack and ProMod when we connect to our next game.

To use it for your bind menu we'll make activeaction be in a loop so you won't lose your menu after 1 match.

    self setClientDvar("activeaction", "setfromdvar LOOP activeaction;setfromdvar activeaction LOOP;exec buttons_default.cfg;bind dpad_down vstr openMENU");


In the example above we use setfromdvar to create and set a dvar called LOOP to the value of activeaction. Then we use setfromdvar again to set activeaction to the value of LOOP.
This will make your activeaction loop nonstop. More to setfromdvar later.

We also have exec buttons_default.cfg in there. exec is used for executing .cfg files.
buttons_default.cfg will set your button layout to default which means all your bindings will be gone.
Useful in use for when you close your menu.

And as you can see we're binding dpad_down right after to vstr openMENU.
vstr will make the value of a dvar happen.
Ex.

    self setClientDvar("activeaction", "bind dpad_left vstr ABC");
    self setClientDvar("ABC", "cg_gun_x 5;cg_fov 75");


This ^ will give you promod when you've pressed the left dpad.

You can change dpad_down / dpad_left to any button you like.
A list of all buttons in [5]!




ui_mapname is still very popular because you can use it to infect others and yourself with mods.

    self setClientDvar("ui_mapname", "mp_bloc;.....");

I used and am going to continue with a CoD4 map in ui_mapname. Use mp_dome if you want to do it for CoD5.

You'll have a checkerboard map you need to start in splitscreen.
When it's half done loading the map the stuff you've added to it will go in action.

If you want to use it for your menu do something like this:

    self setClientDvar("ui_mapname", "mp_bloc;vstr LOOP");
    self setClientDvar("LOOP", "setfromdvar activeaction LOOP;exec buttons_default.cfg;bind dpad_down vstr openMENU");


This will look familiar to you because we've done something similar with activeaction.
This time we only use setfromdvar once because we don't need to create the dvar LOOP first. We've created it on our own with setClientDvar because we don't want ui_mapname to loop itself all the time. Wouldn't work that well if you looped it.

Using setfromdvar we set activeaction to the value of LOOP. Means every time we connect to a game it will set itself to LOOP and go on with the other stuff you've added.

There's also a way to use ui_mapname alone. No activeaction. But it's really pointless if you can use activeaction.


[2] - Menu styles.. What's good, what's bad?

You've probably asked yourself already what style you want to use for your bind menu.

- using say with chatheight and hudchatposition
- using say with minicon and miniconlines
- using unknown cmd


say with chatheight and hudchatposition
Positives:

- Position is easily changeable with cg_hudchatposition x y (replace x y with your own coordinates. Centered would be 250 250. cg_hudchatposition 250 250)
- The line count can be changed anytime using cg_chatheight. (cg_chatheight 8, cg_chatheight 4... It can be set from 0 to 8)

Negatives:

- Overused
- Only 8 lines
- The others can see it
- The length of your gamertag can change the menu position a bit




say with minicon and miniconlines
Positives:

- Can have over 100 lines (Sure not enough space for that on your screen)
- The line count can be changed anytime using con_miniconlines. (con_miniconlines 30, con_miniconlines 2... It can be set from 0 to ?)

Negatives:

- Position can't be changed
- Small font
- The others can see it
- The length of your gamertag can change the menu position a bit




unknown cmd
Positives:

- The others can't see it
- Can be up to 12 lines
- No gamertag changing your position. Always unknown cmd. (Only difference is between the different languages of the game. Unknown cmd in german would be Unbekannter Befehl which makes it longer = more to the right.)

Negatives:

- No spaces unless you use a .cfg file and backslash escaping. (Use XeXWill's and my method we used in ZZ9 WaW v7: Blue Steel if you want)
- The height can't be changed anytime. You would have to end the game and start a new one. That's why we empty it out with dots or whatever you want.)


[3] - Multiple ways of toggling.

There are a lot of ways to toggle your options.
Some are space taking, some are short, some can be used for more, some for less.

The probably most known way is using the cmd: toggle
    toggle dvar value1 value2 value3...

    ...;bind button_back toggle jump_height 999 500 0 39;


This would toggle jump_height to the highest value, to 500, to no jumping and then to default when pressing back.

You can use as many values as you want but it would be a pain to press a button 999 times to go through all 999 values. So just use the necessary ones.




The other way would be using set and vstr.
    ...;vstr JUMP;

    self setClientDvar("JUMP", "vstr HIGHJUMP");
    self setClientDvar("HIGHJUMP", "set JUMP vstr DEFAULTJUMP;jump_height 999");
    self setClientDvar("DEFAULTJUMP", "set JUMP vstr HIGHJUMP;jump_height 39");


This would be the longer way of toggling.
In your menu or wherever you vstr JUMP.
JUMP vstr HIGHJUMP.
HIGHJUMP sets the jump height to 999 and JUMP to DEFAULTJUMP so the next time you vstr JUMP it will vstr DEFAULTJUMP and not HIGHJUMP.
DEFAULTJUMP will set JUMP to HIGHJUMP again and set the jump height to 39 (default).

You can add as many levels as you want.




The in my view buggiest way is using the toggle cmd together with text (ex. unknown cmd)

    ...;vstr JUMP;
    self setClientDvar("JUMPNOTIFY", "");
    self setClientDvar("JUMP", "toggle jump_height 999 0 39;toggle JUMPNOTIFY ^5High_Jump ^5No_Jump ^5Default_Jump;vstr JUMPNOTIFY");


This will toggle the jump height and toggle your own dvar called JUMPNOTIFY which is used for the unknown cmd text telling you what you've toggled to. Then we vstr JUMPNOTIFY to make the text appear.

You may now ask... Why are you calling this buggy? It looks flawless!
Well as soon as you set the dvar you toggle somewhere else.. so outside your toggle..

Like
jump_height 250

It will mess it up.
While your NOTIFY saved let's say No_Jump as the last level the jump_height will restart at 999.
Means it will say Default_Jump but it's actually no jump height.. or High_Jump but it's set to default.

To fix this you just have to reset the dvar you toggle (ex. jump_height) and the toggling will be working perfectly again.




Toggling using toggle and backslash escaping. (Only if you're using a .cfg file)
For dvars with spaced values like dvars with rgba values.

Ex.
g_teamcolor_axis

You can't just use toggle.
It would only read the first of the 4 values.

You normally use g_teamcolor_axis like this: g_teamcolor_axis 1 0 0 1
This would be red.

If you do: toggle g_teamcolor_axis 1 0 0 1 1 1 0 1
it wouldn't work.

That's where backslash escaping becomes useful.

    toggle g_teamcolor_axis \"1 0 0 1\" \"1 1 0 1\"


This would work but as I said it won't work without a .cfg file.


[4] - How to put map infections to your menu.

Ever wanted to add checkerboard infections to your menu to infect your friends and randoms? It's really simple!

For this we'll need setfromdvar.
    ...;bind button_a setfromdvar ui_mapname INFECTION;

    self setClientDvar("INFECTION", "mp_bloc;cg_gun_x 5;bind apad_up say ZZ9's tutorial");


Pressing the A button will make setfromdvar set ui_mapname to the value of the dvar INFECTION.
In INFECTION you put the map name + the stuff you want to be infected.
Then you end the game and let them start the checkerboard map in splitscreen.

Simple isn't it?


[5] - All buttons + What buttons stick.

Here a list of all buttons with their native functions and what buttons stick.

A - Stick: bind button_a +gostand
B - Stick: bind button_b +stance
X - Stick: bind button_x +usereload
Y - Stick: bind button_y weapnext
LB - Stick: bind button_lshldr +smoke
RB - Stick: bind button_rshldr +frag
LT - Stick: bind button_ltrig +speed_throw
RT - Stick: bind button_rtrig +attack
LS - Stick: bind button_lstick +breath_sprint
RS - Stick: bind button_rstick +melee
Back - Stick: bind button_back togglescores
Start - Stick: bind button_start togglemenu
Dpad Up - Stick: bind dpad_up +actionslot 1
Dpad Down - Stick: bind dpad_down +actionslot 2
Dpad Left - Stick: bind dpad_left +actionslot 3
Dpad Right - Stick: bind dpad_left +actionslot 4
LS Up - Stick: bind apad_up +forward
LS Down - Stick: bind apad_up +back
LS Left - Stick: bind apad_left +moveleft
LS Right - Stick: bind apad_right +moveright


[6] - setfromdvar in general.

setfromdvar is one of the most useful commands in my view.
It lets you create and/or set a dvar to the value of another dvar.

    ...;setfromdvar dvar1 dvar2;
    self setClientDvar("dvar2", "say Thanks to ZZ9 for this tutorial");


dvar1 will be created and have the same value as dvar2

    ...;setfromdvar dvar1 dvar2;
    self setClientDvar("dvar1", "say hello");
    self setClientDvar("dvar2", "say this is ZZ9");


dvar1 will just have the same value as dvar2 because dvar1 already exists.






Example menu with 1 sub menu - explained.
If you've read everything above you now should know more. (If you didn't know everything already obviously)

Here's an example menu with 1 sub menu using say together with chatheight and chatposition.

    self setClientDvar("activeaction" "setfromdvar LOOP activeaction;setfromdvar activeaction LOOP;cg_chatheight 0;cg_chattime 60000;cg_hudchatposition 250 250;exec buttons_default.cfg;bind dpad_down vstr openMENU");


This is our activeaction loop which sets our button layout to default to remove all your bindings + setting the chat height to 0 so you won't have the menu visible all the time for you + setting the time on screen to 60000 so it won't disappear so fast while opened but being idle + setting the position to center, center + binding dpad down to vstr your openMENU dvar.

    self setClientDvar("openMENU", "bind dpad_up vstr UP;bind dpad_down vstr DOWN;bind button_a vstr SELECT;bind button_b vstr BACK;vstr OPTION1");


Our openMENU will bind buttons to their new function we'll use for the menu.
It then vstr the first option of your menu.

    self setClientDvar("OPTION1", "cg_chatheight 4;say ^1Sub 1;say ^7Sub 2;say ^7Sub 3;say ^7Sub 4;set UP vstr OPTION4;set DOWN vstr OPTION2;set BACK vstr activeaction;set SELECT vstr SUBOPTION1");


This is the first option of your menu.
It sets the line count to 4 using cg_chatheight and then shows 4 lines of text using the say cmd.
After that we set UP to vstr OPTION4.
This means when we're on the first option and press dpad up it will jump on the 4th option.

Then we set DOWN to vstr OPTION2.
We'll jump on the 2nd option if we press dpad down.

Then we set BACK to vstr activeaction.
This means when we press B in that menu we're exiting it. In activeaction we've set the line count to 0 and reset the button layout and all that.

And at last we set SELECT to whatever you want to happen.
You could do:
    set SELECT jump_height 999
    set SELECT toggle cg_gun_x 5 4 3 2 1
    set SELECT vstr SUBOPTION1


or whatever you like.

Here your example Main Menu.
    self setClientDvar("OPTION1", "cg_chatheight 4;say ^1Sub 1;say ^7Sub 2;say ^7Sub 3;say ^7Sub 4;set UP vstr OPTION4;set DOWN vstr OPTION2;set BACK vstr activeaction;set SELECT vstr SUBOPTION1");
    self setClientDvar("OPTION2", "cg_chatheight 4;say ^7Sub 1;say ^1Sub 2;say ^7Sub 3;say ^7Sub 4;set UP vstr OPTION1;set DOWN vstr OPTION3;set BACK vstr activeaction;set SELECT vstr X");
    self setClientDvar("OPTION3", "cg_chatheight 4;say ^7Sub 1;say ^7Sub 2;say ^1Sub 3;say ^7Sub 4;set UP vstr OPTION2;set DOWN vstr OPTION4;set BACK vstr activeaction;set SELECT vstr X");
    self setClientDvar("OPTION4", "cg_chatheight 4;say ^7Sub 1;say ^7Sub 2;say ^7Sub 3;say ^1Sub 4;set UP vstr OPTION3;set DOWN vstr OPTION1;set BACK vstr activeaction;set SELECT vstr X");


If you look through it you'll see how it's connected to each option.
Important is that you change the text color the way I did.. otherwise you won't be able to see what option you are on.
We vstr X (or whatever you want to call the empty dvar) if we have nothing for the option when selecting.
In the example above we vstr SUBOPTION1 which means we'll go into the sub menu when we press A on the first option of the Main Menu.

    ^0 = black
    ^1 = red
    ^2 = green
    ^3 = yellow
    ^4 = blue
    ^5 = cyan
    ^6 = pink
    ^7 = white


Now the sub menu:

    self setClientDvar("SUBOPTION1", "cg_chatheight 4;say ^1Option 1;say ^7Option 2;say ^7Option 3;say ^7Option 4;set UP vstr SUBOPTION4;set DOWN vstr SUBOPTION2;set BACK vstr OPTION1;set SELECT vstr X");
    self setClientDvar("SUBOPTION2", "cg_chatheight 4;say ^7Option 1;say ^1Option 2;say ^7Option 3;say ^7Option 4;set UP vstr SUBOPTION1;set DOWN vstr SUBOPTION3;set BACK vstr OPTION1;set SELECT vstr X");
    self setClientDvar("SUBOPTION3", "cg_chatheight 4;say ^7Option 1;say ^7Option 2;say ^1Option 3;say ^7Option 4;set UP vstr SUBOPTION2;set DOWN vstr SUBOPTION4;set BACK vstr OPTION1;set SELECT vstr X");
    self setClientDvar("SUBOPTION4", "cg_chatheight 4;say ^7Option 1;say ^7Option 2;say ^7Option 3;say ^1Option 4;set UP vstr SUBOPTION3;set DOWN vstr SUBOPTION1;set BACK vstr OPTION1;set SELECT vstr X");


Notice how set BACK has changed.
This time we make it go back to the Main Menu instead of exiting the menu.






Well that's it for now.
I wrote all of this from the top of my head so excuse mistakes.
Feel free to ask whatever you want to ask.

If you found mistakes or would like more to a topic let me know and I'll work on it.

I hope this helped you
-ZZ9

The following 12 users thanked ZZ9 for this useful post:

Adamu (06-12-2013), Appze (06-12-2013), KAQ (06-10-2013), Larph (06-09-2013), Lich (06-09-2013), Lewis_Mods (06-09-2013), SimbaXe (06-09-2013), Grampa (06-08-2013), Greg (06-08-2013), Tyleerrx (06-08-2013), Zandermods (06-08-2013), michelle1489 (06-08-2013)
#2. Posted:
michelle1489
  • Prospect
Status: Offline
Joined: Oct 22, 201212Year Member
Posts: 655
Reputation Power: 30
Status: Offline
Joined: Oct 22, 201212Year Member
Posts: 655
Reputation Power: 30
this is interesting but would this be any good for the likes of gowj as cod games are untouchable now or is it just for specific games
#3. Posted:
Zandermods
  • TTG Senior
Status: Offline
Joined: Mar 30, 201113Year Member
Posts: 1,219
Reputation Power: 63
Status: Offline
Joined: Mar 30, 201113Year Member
Posts: 1,219
Reputation Power: 63
Nice tut this should help lots of people.
#4. Posted:
ZZ9
  • TTG Contender
Status: Offline
Joined: Apr 19, 201113Year Member
Posts: 3,394
Reputation Power: 214
Status: Offline
Joined: Apr 19, 201113Year Member
Posts: 3,394
Reputation Power: 214
michelle1489 wrote this is interesting but would this be any good for the likes of gowj as cod games are untouchable now or is it just for specific games


Well mainly for cod4 and cod5.
Some of this stuff can still be useful for the new call of duties.

I'm not sure if there's any use for this for other games too.
#5. Posted:
michelle1489
  • Prospect
Status: Offline
Joined: Oct 22, 201212Year Member
Posts: 655
Reputation Power: 30
Status: Offline
Joined: Oct 22, 201212Year Member
Posts: 655
Reputation Power: 30
this is probably a dumb question but ill ask it any way whats the differance between mw2 and bo2 i.e theres a ton of mods for one but practiclly none for the other
#6. Posted:
Tyleerrx
  • New Member
Status: Offline
Joined: Jun 08, 201311Year Member
Posts: 42
Reputation Power: 1
Status: Offline
Joined: Jun 08, 201311Year Member
Posts: 42
Reputation Power: 1
This is very helpful nice post as always ZZ9, will help out a lot
#7. Posted:
Adamu
  • Christmas!
Status: Offline
Joined: Feb 02, 201311Year Member
Posts: 5,477
Reputation Power: 335
Status: Offline
Joined: Feb 02, 201311Year Member
Posts: 5,477
Reputation Power: 335
This is very helpful thanks ZZ9
#8. Posted:
Botch
  • TTG Senior
Status: Offline
Joined: Aug 31, 201212Year Member
Posts: 1,553
Reputation Power: 65
Status: Offline
Joined: Aug 31, 201212Year Member
Posts: 1,553
Reputation Power: 65
Nice little tutorial. This will certainly help people who don't know where to start!
#9. Posted:
SimbaXe
  • Gold Gifter
Status: Offline
Joined: Dec 22, 201113Year Member
Posts: 2,821
Reputation Power: 143
Status: Offline
Joined: Dec 22, 201113Year Member
Posts: 2,821
Reputation Power: 143
This is a very nice tutorial, it should be helpful for a lot of beginners. Thanks ZZ9!
#10. Posted:
ZZ9
  • TTG Contender
Status: Offline
Joined: Apr 19, 201113Year Member
Posts: 3,394
Reputation Power: 214
Status: Offline
Joined: Apr 19, 201113Year Member
Posts: 3,394
Reputation Power: 214
Glad you like it

Took me like 2 to 3 hours to make.
If you wanna know more about something related to bind menus let me know and I'll try to add that on here ;)

EDIT:
L3Rr0Y_FTW wrote Danke haste mal wieder geil gemacht ich freu mich schon auf die ganzen neuen noob meuns und edits die kommen werden =D


Are you saying my tutorial is bad or good?
Looks like sarcasm.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.