Archive for the ‘Game Scripts’ Category

VN:F [1.8.0_1031]
Rating: 0.0/10 (0 votes cast)

So you want to create your own config for your favorite game but you have no idea where to start? Sure downloading a config that is used by someone else is a way to go but the wonderful thing with the config is it’s personal.  Your custom configuration is not the same as anyone elses.  Everyone has their own idea of what or how a game should look and feel when playing it.  For this tut I’m going to use id software based game configuration because they are popular, and easy to understand.  I may revisit this tutorial later and focus on another game developer such as valve.

So what is “Object Oriented”? Well in case your new to the code world there is a common phrase passed with in its realms which is ” Don’t recreate the wheel “.  So if you want to learn more about what “OO” is then I suggest you check out http://en.wikipedia.org/wiki/Object-oriented_programming.

By why Object Oriented? I know what it is, but its not needed at all, the config works just fine the default way (which is top down style scripting). Well, using OO is not changing how the configuration works, its allowing for 2 things. 1: It allows for quick and easy editing, and 2: It allows for a much more robust and complex configuration that is not possible with the limitation and constraints of the default config reader.

So for this example, lets start with our header file or “main.cfg”.

//-------------------------->
// @file main.cfg
// @author onykage
//-------------------------->

//step 1, unbind all previously aliases used by the default or previous config.
unbindall

//step2, call the list of modules use in the config, ex.the auto_trolling script.
exec modules/autotroll.cfg
exec modules/binds.cfg
exec modules/player.cfg
exec modules/gfx.cfg

//step3, announce that we successfully loaded our configuration
say "Ony's Demo Config v.0.1 Loaded Successfully!"
//alternatively you can use "tell_buddy (your player name)"
//to tell yourself instead of publicly announcing your config load.

Now lets build our autotroll.cfg script. But first lets make sure we take a good look at a list of cvars and commands used in the vq3 based games. For this tut I’m using QuakeLive, but the same techniques will work for any vq3 or ioq3 based game. A good detailed list of cvars and commands can be found at http://www.holysh1t.net/quake-live-commands-list/, or if you want to just get the list yourself to check for consistency you can use the following line in your game console.

/clear; listcvars; listcmds; condump cvarcmdlist.txt

The file cvarcmdlist.txt will be created and stored in your baseq folder.
So now that we have a reference for ourselves lets move on. The object to our “autotroll” or “insult” script is to do exactly that, insult or pick a fight with other players automatically.

//-------------------------->
// @file autotroll.cfg
// @author onykage
//-------------------------->

set autotroll "vstr ins1"

set ins1 "tell_attacker Your Momma was a snow blower!; set autotroll vstr ins2"
set ins2 "tell_attacker My gun is bigger then yours; set autotroll vstr ins3"
set ins3 "tell_attacker You couldnt whip a fly with a flyswatter!; set autotroll vstr ins1"

Now lets make our binds.cfg script where all of out aliases and ingame commands are stored. This part is important because the “unbindall” command will whip out our current bindings so its important that you include all of your binds in this file. The following example will only list a few of the possible binds to be used.

//-------------------------->
// @file binds.cfg
// @author onykage
//-------------------------->

bind w "+forward"
bind s "+back"
bind a "+moveleft"
bind d "+moveright"
bind c "+movedown"
bind mouse2 "+moveup"
bind v "+button3"
bind BACKSPACE "+button2"

//custom commands binds
bind \ "vstr autotroll"

Next lets build the player.cfg. This script will house all of our “player specific” settings.

//-------------------------->
// @file player.cfg
// @author onykage
//-------------------------->

seta name "^2O^5nykag^2e"
seta model "keel/default"
seta headmodel "doom/default"
seta cg_forceenemymodel "tankjr/bright"
seta cg_forceredteammodel "mynx/default"

And finally lets build out graphics settings configuration file.

//-------------------------->
// @file gfx.cfg
// @author onykage
//-------------------------->

seta r_vertexlight "1"
seta cg_drawfps "1"
seta cg_draw3dicons "0"
seta cg_noprojectiletrail "0"
seta r_picmip "3"
seta r_fullbright "1"

Post to Twitter Post to Digg Post to Facebook Post to Ping.fm Post to StumbleUpon

Onys VSpy Plugin