You are viewing our Forum Archives. To view or take place in current topics click here.

Was this post useful?

Yes
70.00% (7 votes)
No
30.00% (3 votes)

Total Votes: 10

XeXTwix [CFG Support] - Coding Tools, Tutorials, Links
Posted:

XeXTwix [CFG Support] - Coding Tools, Tutorials, LinksPosted:

Larph
  • TTG Addict
Status: Offline
Joined: Oct 01, 201112Year Member
Posts: 2,921
Reputation Power: 162
Status: Offline
Joined: Oct 01, 201112Year Member
Posts: 2,921
Reputation Power: 162
XeXTwix CFG Support Thread




Ok, so today i saw how much cfg has died and been replaced with all the mw2, mw3, blops etc. stuff. but come on, cfg isn't done yet. i know for a fact that i come up with a new idea for a menu everyday (Each one never done)...

So this topic is more of look around, a museum of cfg XD, take a look around, download some a tool, look at a tutorial. whatever.

but if you are really interested in coding your own for the first time, you can allways hit me up on skype : jameskirkness

However lets start posting links, have fun down there

------------------------------------------------------------------------------------

So you want to make a mod menu in cfg?

what you will need:

.ff viewer - Download
clean patch_mp.ff - [ Register or Signin to view external links. ]
default_mp.xex - Must contact me due to rules

so now you have the tools and the patch where do you begin?

first open your patch_mp.ff in .ff viewer and open up the itscarterlol.gsc.

you should see some code but if you scroll down i have left notes for you to follow to make it easier and save time.

so now the coding, you will need to look at a tutorial. thankfully i have both a text and a video tutorial which will be below.

Video Tutorial: (i recommend following the text tutorial)



Text Tutorial:

Step 1. A Basic Idea

Before you start you need a Basic Idea Of how you are going to Lay out you Menu.

For Example You May have your options Listed so you know what you are going to be adding.

eg.

Main Menu
Main Mods
Messages
Visions
Infection
Stealth Menu Test
Edit Menu
More >>

Step 2. knowing the Basics

Too begin Coding in CFG you will first have to know the Basics.

to start off, you will need a clean Patch and be able to thread the Patch too your menu, you can do this by using "self thread" this links a path to your menu, you would normally put this in the weapons GSC inside the OnplayerSpawned Script ( At the bottem of that Script )

To start off you will need to begin with the command "activeaction" this Command allows you to be infected and starts all of the linking through veriable strings etc.

you will set out this code like this


self setClientDvar("activeaction", "");



next you will need to variable String ( vstr ) to the next line.

like this :


self setClientDvar("activeaction", "vstr _1");



This is where you can Begin Linking all of your Codes together, starting with the Buttons.

like this :


self setClientDvar("_1", "bind DPAD_RIGHT vstr RIGHT;next Button here");



You dont have to do that, it is just the easiest and less confusing way.

Buttons :

BUTTON_A = A Button
BUTTON_B = B Button
BUTTON_Y = Y Button
BUTTON_X = X Button
DPAD_RIGHT = Dpad Right
DPAD_LEFT = Dpad Left
DPAD_UP = Dpad Up
DPAD_DOWN = Dpad Down
APAD_UP = Move Forward
APAD_DOWN = Move Backwards
BPAD_UP = Look Up
BPAD_DOWN = lookDown



You will then have to link from Your Buttons to your first menu, in this case m1_0.

like this :


self setClientDvar("_1", "BUTTONS HERE;vstr m1_0");




Next you have to Create the Menu Its self.

You can do this by adding a line and calling it by the name you linked too, m1_0 is a handy name to have because you will be going m1_0, m1_1 etc.
eg.


self setClientDvar("m1_0", "");




SEEN MENU CREATING TUTORIAL :
For Seen Menu's you will use the Command "say" this is a very usefull command, anyway, lets get to it.

You do this by adding it in as Followed :


self setClientDvar("m1_0", "say ");



Next you will begin to add the menu options.

You start by adding a single Option, for example "Menu 1"

Once you have done this your code will look like this :


self setClientDvar("m1_0", "say Menu 1");



Next we will be adding other options, you do this by, copying the line, then pasting it below.

like this :



self setClientDvar("m1_0", "say Menu 1");
self setClientDvar("m1_0", "say Menu 1");



However, you will need to edit this so they are not the same, and you will need to add that next option.

Like this :



self setClientDvar("m1_0", "say Menu 1;say Menu 2");
self setClientDvar("m1_1", "say Menu 1;say Menu 2");



Now you will need to add a Scroller, you can do this by inserting a colour code before your option.

Like This :



self setClientDvar("m1_0", "say ^1Menu 1;say Menu 2");
self setClientDvar("m1_1", "say Menu 1;say ^1Menu 2");



Colour Codes :

^0 Black
^1 Red
^2 Green
^3 Yellow
^4 Blue
^5 Cyan
^6 Purple Pinky
^7 White / grey
^8 Team 1
^9 Team 2



next you will have to add the chatheight, this depends on how many lines of code you have, i have two, so the chatheight is "cg_chatheight 2".

the Codes will look like this :



self setClientDvar("m1_0", "say ^1Menu 1;say Menu 2;cg_chatheight 2");
self setClientDvar("m1_1", "say Menu 1;say ^1Menu 2;cg_chatheight 2");



you would useually have cg_chatheight... on only one line, but its easier if you put it on both.

Skip Past The Next part if You are just wanting to code seen.

STEALTH MENU CREATING TUTORIAL :

Stealth Menu's are quite easy to make, because unlike seen, you dont have all the excess Options that you have to add and you dont need the "say" command.

Here is an example of a stealth menu option :


self setClientDvar("m1_0", "Menu 1");



Next we will be adding the next menu option for stealth, you do this by adding another line and Changing the names of the option and line name.

for Example :



self setClientDvar("m1_0", "Menu 1");
self setClientDvar("m1_1", "Menu 2");



You dont need to add colours for the scrolling but you can if you want.


Step 3. Making The menu scroll

In A Seen menu you will need to vstr to each line correctly so that is scrolls up and down, but you will use your buttons that you set up earlier to do this correctly.

if we use the code that i built up, then it would look like this :



self setClientDvar("m1_0", "say ^1Menu 1;say Menu 2;cg_chatheight 2;set DOWN vstr m1_1");
self setClientDvar("m1_1", "say Menu 1;say ^1Menu 2;cg_chatheight 2;set DOWN vstr m1_0");



obviously you need a scroll up aswell, so we will add a code like this :


set UP vstr m1_1
set UP vstr m1_0



it will look this ;



self setClientDvar("m1_0", "say ^1Menu 1;say Menu 2;cg_chatheight 2;set DOWN vstr m1_1;set UP vstr m1_1");
self setClientDvar("m1_1", "say Menu 1;say ^1Menu 2;cg_chatheight 2;set DOWN vstr m1_0;set UP vstr m1_0");



The codes for Down and up are the same because there is only two options, if there were more then for DOWN the number for Line m1_0 is m1_1 and the Line for UP is allways the last number.

i cant create an example because it wont fit inside the code as a easy to look at example.

In stealth menu's it is really easy, because all you have to add is the simple buttons ( the same as "Seen" )

You will do that like this :


self setClientDvar("m1_0", "Menu 1;set DOWN vstr m1_1;set UP vstr m1_1");
self setClientDvar("m1_1", "Menu 2;set DOWN vstr m1_0;set UP vstr m1_0");



and again it depends on how many lines that menu has, the code for m1_0 being m1_1 and too scroll up allways being the last one.

Step 4. Adding sub Menu's


its really Quite Simple too do this, all you have to do is add the Select button you have chosen, vstr then the line you want it to go to, for example :


set EXEC vstr m2_0



in a Seen menu it will look like this :


self setClientDvar("m1_0", "say ^1Menu 1;say Menu 2;cg_chatheight 2;set DOWN vstr m1_1;set UP vstr m1_1;set EXEC vstr m2_0");
self setClientDvar("m1_1", "say Menu 1;say ^1Menu 2;cg_chatheight 2;set DOWN vstr m1_0;set UP vstr m1_0;set EXEC vstr m2_0");



In a Stealth menu it will look like this :



self setClientDvar("m1_0", "Menu 1;set DOWN vstr m1_1;set UP vstr m1_1;set EXEC vstr m2_0");
self setClientDvar("m1_1", "Menu 2;set DOWN vstr m1_0;set UP vstr m1_0;set EXEC vstr m2_0");





Then to create Sub menus you just repeat the steps, or copy the menu you have created and edit it.

For example ( Seen ) :


self setClientDvar("m2_0", "say ^1Option 1;say Option 2;cg_chatheight 2;set DOWN vstr m2_1;set UP vstr m2_1;set EXEC vstr Dvar 1");
self setClientDvar("m2_1", "say Option 1;say ^1Option 2;cg_chatheight 2;set DOWN vstr m2_0;set UP vstr m2_0;set EXEC vstr Dvar 2");



For example ( Stealth ) :



self setClientDvar("m2_0", "Option 1;set DOWN vstr m2_1;set UP vstr m2_1;set EXEC vstr Dvar 1");
self setClientDvar("m2_1", "Option 2;set DOWN vstr m2_0;set UP vstr m2_0;set EXEC vstr Dvar 1");



I Think this way is quicker and easier to do, because you dont get confused as quickly.

also as you can see i added the line names Dvar 1 and Dvar 2, this is because this is where you put your Dvars, fpr example Super jump, which is jump_height 999.

Example of Menu and Dvar Line ( seen ) :


self setClientDvar("m2_0", "say ^1Super Jump;say Option 2;cg_chatheight 2;set DOWN vstr m2_1;set UP vstr m2_1;set EXEC vstr Dvar 1");
self setClientDvar("m2_1", "say Super Jump;say ^1Option 2;cg_chatheight 2;set DOWN vstr m2_0;set UP vstr m2_0;set EXEC vstr Dvar 2");

self setClientDvar("Dvar1", "jump_height 999");



Example of Menu and Dvar Line ( Stealth ) :



self setClientDvar("m2_0", "Super_Jump;set DOWN vstr m2_1;set UP vstr m2_1;set EXEC vstr Dvar 1");
self setClientDvar("m2_1", "Option 2;set DOWN vstr m2_0;set UP vstr m2_0;set EXEC vstr Dvar 1");

self setClientDvar("Dvar1", "jump_height 999");



So that's the tutorials finished, i hope this post has helped you as much as it could.

if you have any questions contact me on skype @ jameskirkness or PM me here.

The following 6 users thanked Larph for this useful post:

brendan64shark (03-21-2014), Hoen (03-20-2014), Activez- (03-20-2014), Sikie (03-02-2014), Wilez (03-02-2014), Nissan (03-02-2014)
#2. Posted:
KaoticFX
  • Powerhouse
Status: Offline
Joined: Jul 01, 201211Year Member
Posts: 484
Reputation Power: 20
Status: Offline
Joined: Jul 01, 201211Year Member
Posts: 484
Reputation Power: 20
Great Post, Should Be Sticky!
;)
#3. Posted:
Larph
  • TTG Addict
Status: Offline
Joined: Oct 01, 201112Year Member
Posts: 2,921
Reputation Power: 162
Status: Offline
Joined: Oct 01, 201112Year Member
Posts: 2,921
Reputation Power: 162
KaoticFX wrote Great Post, Should Be Sticky!
;)


Thanks

when i have more time i will add more things like, converting to an infinite r2r menu. which will be easier to explain than usual since the clean patch is ready to be used as an infinite infectable loop.
#4. Posted:
XeXZemv1
  • Challenger
Status: Offline
Joined: Jan 19, 201410Year Member
Posts: 171
Reputation Power: 6
Status: Offline
Joined: Jan 19, 201410Year Member
Posts: 171
Reputation Power: 6
nice post really useful hope it gets stickied
#5. Posted:
-Excite-
  • TTG Senior
Status: Offline
Joined: Dec 21, 201112Year Member
Posts: 1,349
Reputation Power: 45
Status: Offline
Joined: Dec 21, 201112Year Member
Posts: 1,349
Reputation Power: 45
Nice post mate sticky material but I can't see it getting stickies as things like this have been done before you should add a tut about how to use c# then it has a better chance of being stickies as it hasn't been done. Nice post none the less.
#6. Posted:
Adamu
  • Winter 2016
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
Nice post bro should help a lot of people who want too learn cfg twix nice tut.
#7. Posted:
Larph
  • TTG Addict
Status: Offline
Joined: Oct 01, 201112Year Member
Posts: 2,921
Reputation Power: 162
Status: Offline
Joined: Oct 01, 201112Year Member
Posts: 2,921
Reputation Power: 162
Ice-Coolz wrote Nice post mate sticky material but I can't see it getting stickies as things like this have been done before you should add a tut about how to use c# then it has a better chance of being stickies as it hasn't been done. Nice post none the less.


well i don't really have much time at the moment to go out and learn c#. this post was never meant for sticky, just something to help anyone who needs it
#8. Posted:
Excllusive
  • Resident Elite
Status: Offline
Joined: Dec 25, 201211Year Member
Posts: 284
Reputation Power: 12
Status: Offline
Joined: Dec 25, 201211Year Member
Posts: 284
Reputation Power: 12
this should be a sticky great work!!!!
#9. Posted:
Bitwise
  • Resident Elite
Status: Offline
Joined: Feb 09, 201410Year Member
Posts: 267
Reputation Power: 14
Status: Offline
Joined: Feb 09, 201410Year Member
Posts: 267
Reputation Power: 14
People still mod these stupidly old games? Wow...but I didn't read it since it wouldn't help me in any form, but it was a long scroll down so I can tell you know a-lot on this subject, so good job?
#10. Posted:
-Lew
  • TTG Natural
Status: Offline
Joined: Jul 17, 201211Year Member
Posts: 923
Reputation Power: 177
Status: Offline
Joined: Jul 17, 201211Year Member
Posts: 923
Reputation Power: 177
ah twix i see your back kinda lol
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.