Jump to content

Recommended Posts

Posted (edited)

i had this posted in the old forums thought i would share:

 

first of all this is written for me, and i have my keyboard and cfg structure "goofy-footed" ... there are 2 main differences from the way 95% of ppl are setup:

 

(1) i use arrows for movement instead of wasd, and have numpad normally bound to things like weaponbanks and playerstats toggle etc. -- so i use the right half of keyboard, not the left.

(2) i have an autoexec.cfg that does nothing but exec 12 other cfgs. i have separate cfgs for diff. type of code, i.e. "binds.cfg, settings.cfg, toggle.cfg, names.cfg, vsays.cfg ... etc"

 

in order for you to use this code as it is, you would need to have a "bindexec.cfg" in your etmain folder, along with a line in your autoexec that reads

exec bindexec.cfg

(so your binds are set when you exec your autoexec ) -- of course you can change the name as you like, but change it in both places.

 

if you can see how this works though, you can use the concept to do the same thing in your own cfg in a way that suits the way yours is structured.

feel free to use the code; i just hope you will be nice enough not to claim that you came up with it all yourself. i used other codes to learn how class selection worked, but this is all my own code.

 

so anyway, i wrote a spawn/class sector that works like this:

 

press F9 once:

rebinds my numpad with class selector and spawnpoint selector stuff.

 

 

press F9 again:

execs my "binds.cfg", which sets all my normal binds. most keys are still the same, and all the numpad keys are overwritten with their normal binds.

 

each class selection includes a /kill and forcetapout, so with 2 keys i can be ready to respawn as any of 10 classes.

 

it consists of 4 cfgs in my etmain folder ( apart from bindexec.cfg and the autoexec.cfg ) and one line of code in my autoexec.cfg. so, 5 parts:

 

(0)

in autoexec.cfg, this line:

exec "spawnchange_01.cfg"; echo "^2Spawnchange Files ^7have been ^3loaded!"

 

(1)

all this is saved as "spawnchange_01.cfg"

this part of the code defines 15 possible classes, and chooses 10 of them to be used as numpad 0-9. i don't use medic, and skipped some of the heavy weapons. to use this, pick and order the 10 "classXX" vstr binds from the classes.

by default this script gives you dual pistols and smg for lvl 4 heavy weapons if you have the xp for it.

///////////////////////////////////////////////////////////////////////////
// Spawnchange_01
//	-for ETPUB
//	-bind numpad to spawn selction functions with bound key
//	-10 of 15 possible classes bound to keys	
//	-select class, /kill and tapout with a single keypress
//	-restore default numpad binds on second keypress
//	
//
//
// binds		F9	
///////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////
// set all class functions
///////////////////////////////////////////////////////////////////////////

set goEng_smg "class e 1 2; echo ^wRespawn ^f-> ^w Engineer smg; kill; wait; forcetapout"
set goEng_k43 "class e 2 2; echo ^wRespawn ^f-> ^w Engineer k43; kill; wait; forcetapout"
set goEng_sho "class e 3 2; echo ^wRespawn ^f-> ^w Engineer shotgun; kill; wait; forcetapout"
set goFop_smg "class f 1 2; echo ^wRespawn ^f-> ^w Field ops smg; kill; wait; forcetapout"
set goFop_sho "class f 2 2; echo ^wRespawn ^f-> ^w Field ops shotgun; kill; wait; forcetapout"
set goCov_stn "class c 1 2; echo ^wRespawn ^f-> ^w Covop sten; kill; wait; forcetapout"
set goCov_fg "class c 2 2; echo ^wRespawn ^f->^w Covop fg42; kill; wait; forcetapout"
set goCov_snp "class c 3 2; echo ^wRespawn ^f-> ^w Covop rifle; kill; wait; forcetapout"
set goSol_smg "class s 1 3; echo ^wRespawn ^f-> ^w Soldier smg; kill; wait; forcetapout"
set goSol_mg "class s 2 3; echo ^wRespawn ^f-> ^w Soldier mg42; kill; wait; forcetapout"
set goSol_fla "class s 3 3; echo ^wRespawn ^f-> ^w Soldier flame; kill; wait; forcetapout"
set goSol_pzf "class s 4 3; echo ^wRespawn ^f-> ^w Soldier panzer; kill; wait; forcetapout"
set goSol_mor "class s 5 3; echo ^wRespawn ^f-> ^w Soldier mortar; kill; wait; forcetapout"
set goSol_ven "class s 6 3; echo ^wRespawn ^f-> ^w Soldier venom; kill; wait; forcetapout"
set goMed_smg "class m 1 2; echo ^wRespawn ^f-> ^w Medic; kill; wait; forcetapout"


///////////////////////////////////////////////////////////////////////////
// assign class functions to standardized variables
//		(choose 10 of 15 available classes)
///////////////////////////////////////////////////////////////////////////

set class00 "vstr goEng_smg" 
set class01 "vstr goEng_k43"
set class02 "vstr goFop_smg"
set class03 "vstr goCov_stn"
set class04 "vstr goCov_fg"
set class05 "vstr goCov_snp"
set class06 "vstr goSol_pzf"
set class07 "vstr goSol_mor"
set class08 "vstr goSol_mg"
set class09 "vstr goSol_fla"


///////////////////////////////////////////////////////////////////////////
// set vstr to display bound classes
///////////////////////////////////////////////////////////////////////////

set classList "exec spawnchange_list.cfg"


///////////////////////////////////////////////////////////////////////////
// set first F9 to activate script
///////////////////////////////////////////////////////////////////////////

unbind F9
bind F9 "exec Spawnchange_on.cfg"


///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

 

(2)

all this is saved as "spawnchange_on.cfg"

this cfg includes all the re-bound functions on the numpad, so here is where you would change what the numpad will be ( or move them to other buttons if you don't like the numpad ).

notice i have commented out a function to put you spectator. that turns out to be a really bad button to accidentally press if you forget to shut the spawnchanger down lol. i decided it was wiser to take the time to type out "/team s" if i want to go spectator.. and just never took the line of code out. use at own risk =p

 

note too the spawnpoint selectors in this cfg --

/ is default,

* is spawnpt 1 ( often a command post spawn ),

and - cycles through a few more.

 

spawnpts are different on every map; there is no real standard and its up to how the person who made the map decided to assign spawn points. trial and error will tell you what spawnpt is what, but i can tell you that command post spawnpoints are usually either 1 or 4 on popular maps, and the higher you go up in spawnpt #, generally the further away from the objective, but still often this is not the case, so you need to trial-and-error every map to see what points are what. next version of this script will hopefully include a "command post spawn" button.. but not for now.

 

///////////////////////////////////////////////////////////////////////////
// Spawnchange_on
//	-switches numpad to spawn selection binds
//	-classes defined in Spawnchange_01.cfg
//
// binds		numpad
///////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////
// notify me of status
///////////////////////////////////////////////////////////////////////////

echo "^3Spawnchange Script Active!"

///////////////////////////////////////////////////////////////////////////
// reassign numpad keys
///////////////////////////////////////////////////////////////////////////

// classes
bind KP_INS "vstr class00"
bind KP_END "vstr class01"
bind KP_DOWNARROW "vstr class02"
bind KP_PGDN "vstr class03"
bind KP_LEFTARROW "vstr class04"
bind KP_5 "vstr class05"
bind KP_RIGHTARROW "vstr class06"
bind KP_HOME "vstr class07"
bind KP_UPARROW "vstr class08"
bind KP_PGUP "vstr class09"

// spawnpoints
bind KP_SLASH "setspawnpt 0; echo ^f ->^2 Default Spawn"
bind *	"setspawnpt 1; echo ^f ->^2 Spawnpoint 1"

set togSpawnpt vstr "togSpawnpt_2"
bind KP_MINUS vstr "togSpawnpt"
set togSpawnpt_2 "setspawnpt 2; echo ^f ->^2 Spawnpoint 2; set togSpawnpt vstr togSpawnpt_3"
set togSpawnpt_3 "setspawnpt 3; echo ^f ->^2 Spawnpoint 3; set togSpawnpt vstr togSpawnpt_4"
set togSpawnpt_4 "setspawnpt 4; echo ^f ->^2 Spawnpoint 4; set togSpawnpt vstr togSpawnpt_5"
set togSpawnpt_5 "setspawnpt 5; echo ^f ->^2 Spawnpoint 5; set togSpawnpt vstr togSpawnpt_2"


// spectator
//bind KP_PLUS "team s; echo ^f -> ^3 SPECTATOR"

// show classes
bind KP_ENTER "vstr classList"

///////////////////////////////////////////////////////////////////////////
// set next F9
///////////////////////////////////////////////////////////////////////////

bind F9 "exec spawnchange_off.cfg"

///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

 

(3)

all this is saved as "spawnchange_list.cfg"

this is just a called function to display what each number on the numpad is bound to, in case i forget. of course i don't need this anymore, having memorized all the settings after using it for a couple years =p

//////////////////////////////////////////////////////////////////////////////
// Spawnchange_list
// echo current spawnchange binds
//
//
// binds none
///////////////////////////////////////////////////////////////////////////


echo "^w0 ^f-> ^wengineer smg"
echo "^w1 ^f-> ^wengineer k43"
echo "^w2 ^f-> ^wfield ops"
echo "^w3 ^f-> ^wcovop sten"
echo "^w4 ^f-> ^wcovop fg42"
echo "^w5 ^f-> ^wcovop sniper"
echo "^w6 ^f-> ^wsoldier panzer"
echo "^w7 ^f-> ^wsoldier mortar"
echo "^w8 ^f-> ^wsoldier mg42"
echo "^w9 ^f-> ^wsoldier flamethrower"

///////////////////////////////////////////////////////////////////////////

 

(4)

and all this is saved as "spawnchange_off.cfg"

this script calls "bindexec.cfg" as i talked about earlier - "bindexec.cfg" is a file that contains all my default keyboard and mouse binds, so it will overwrite the binds that the spawnchange script changed.

//////////////////////////////////////////////////////////////////////////////
// Spawnchange_off
//	returns numpad binds to default
//
//
// binds		none	
///////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////
// notify me of status
///////////////////////////////////////////////////////////////////////////

echo "^3Spawnchange Script Deactivated!"

///////////////////////////////////////////////////////////////////////////
// restore default controls
///////////////////////////////////////////////////////////////////////////

exec bindexec.cfg

///////////////////////////////////////////////////////////////////////////
// set next F9 to activate Spawnchange Script
///////////////////////////////////////////////////////////////////////////

bind F9 "exec spawnchange_on.cfg"


///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

 

 

i hope it is self-explanatory enough to at least inspire some of y'all. :rolleyes:

i didn't include team-specific scripts because i figure if i am going to change teams, it's worth a trip to the limbo menu or at least the console. who really needs to change teams with one button, anyway?

 

future version to include:

jaymod version ( class selection variables are way different in jaymod )

team selection / team-specific binds

command post / rear spawn / special spawnpt buttons. this will require team-specific separate cfgs for every map, and collecting spawnpts is an ongoing process..

echo spawnpoint locations i.e. "spawn at old city" etc.

 

i appreciate any criticism/suggestions/questions/comments/help listing spawnpts for maps

=)

Edited by Connection
Posted

For my cfg, I have map cfgs, for example autoexec_sp_delivery.cfg, autoexec_goldrush.cfg that have the spawns named properly so its not just spawn point 1.

 

here is the autoexec_supply code

 

//SPAWNTIMER
timerset 0
wait 200
set echotime "echo ^0>^7Supply Depot spawntimes^0:; echo ^0>^7Axis^0: ^730 ^0& ^7Allies^0: ^720"
vstr echotime

set axisTime "timerset 30"
set alliesTime "timerset 20"

//SPAWNSELECTOR
//allied spawnpoints
set blue1 "setspawnpt 1; echo ^0> ^7Spawn^0: ^7Barn; set spawn_blue vstr blue2"
set blue2 "setspawnpt 3; echo ^0> ^7Spawn^0: ^7Forward Bunker (Flag); set spawn_blue vstr blue3" 
set blue3 "setspawnpt 4; echo ^0> ^7Spawn^0: ^7Command Post; set spawn_blue vstr blue1" 
set spawn_blue vstr blue1
//axis spawnpoints
set red1 "setspawnpt 1; echo ^0> ^7Spawn^0: ^7Forward Bunker (Flag); set spawn_red vstr red2"
set red2 "setspawnpt 2; echo ^0> ^7Spawn^0: ^7Depot; set spawn_red vstr red1"
set spawn_red vstr red1

echo "^0> ^7Supply Depot Spawns loaded^0!"

In my team autoexec it binds vstr red or blue to a key

I know it works in EtPro and EtPub.

  • Administrators
Posted

I have posted Jaymod class script before somewhere. It has all code for weapons in it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.