<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SuperScriptz &#187; Game Scripts</title>
	<atom:link href="http://superscriptz.net/projects/gameing/feed/" rel="self" type="application/rss+xml" />
	<link>http://superscriptz.net</link>
	<description>Scripting with Attitude</description>
	<lastBuildDate>Sat, 27 Mar 2010 23:55:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Object Oriented Configurations??</title>
		<link>http://superscriptz.net/onykage/gameing/object-oriented-configurations/</link>
		<comments>http://superscriptz.net/onykage/gameing/object-oriented-configurations/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 17:32:12 +0000</pubDate>
		<dc:creator>onykage</dc:creator>
				<category><![CDATA[Game Scripts]]></category>
		<category><![CDATA[Object Oriented Programming]]></category>
		<category><![CDATA[Quake]]></category>

		<guid isPermaLink="false">http://superscriptz.net/?p=15</guid>
		<description><![CDATA[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&#8217;s personal.  Your custom configuration is not the same as anyone [...]<br /><div><img src="http://superscriptz.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>10</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://superscriptz.net/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p>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&#8217;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&#8217;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.</p>
<p>So what is &#8220;Object Oriented&#8221;?  Well in case your new to the code world there is a common phrase passed with in its realms which is &#8221; <em>Don&#8217;t recreate the wheel</em> &#8220;.  So if you want to learn more about what &#8220;OO&#8221; is then I suggest you check out <a href="http://en.wikipedia.org/wiki/Object-oriented_programming" target="_blank" title="(26 downloads)" onclick="window.location='http://superscriptz.net/go.php?http://en.wikipedia.org/wiki/Object-oriented_programming'; return false">http://en.wikipedia.org/wiki/Object-oriented_programming</a>.</p>
<p>By why Object Oriented?  I know what it is, but its not needed at all, the config works just fine the default way (<em>which is top down style scripting</em>).  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.</p>
<p>So for this example, lets start with our header file or &#8220;main.cfg&#8221;.</p>
<pre name="code" class="vq3">
//-------------------------->
// @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.
</pre>
<p>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&#8217;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 <a href="http://www.holysh1t.net/quake-live-commands-list/" target="_blank" title="(70 downloads)" onclick="window.location='http://superscriptz.net/go.php?http://www.holysh1t.net/quake-live-commands-list/'; return false">http://www.holysh1t.net/quake-live-commands-list/</a>, or if you want to just get the list yourself to check for consistency you can use the following line in your game console.</p>
<pre name="code" class="vq3">
/clear; listcvars; listcmds; condump cvarcmdlist.txt
</pre>
<p>The file cvarcmdlist.txt will be created and stored in your baseq folder.<br />
So now that we have a reference for ourselves lets move on.  The object to our &#8220;autotroll&#8221; or &#8220;insult&#8221; script is to do exactly that, insult or pick a fight with other players automatically.</p>
<pre name="code" class="vq3">
//-------------------------->
// @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"
</pre>
<p>Now lets make our binds.cfg script where all of out aliases and ingame commands are stored.  This part is important because the &#8220;unbindall&#8221; 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.</p>
<pre name="code" class="vq3">
//-------------------------->
// @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"
</pre>
<p>Next lets build the player.cfg.  This script will house all of our &#8220;player specific&#8221; settings.</p>
<pre name="code" class="vq3">
//-------------------------->
// @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"
</pre>
<p>And finally lets build out graphics settings configuration file.</p>
<pre name="code" class="vq3">
//-------------------------->
// @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"
</pre>
<br /><div><img src="http://superscriptz.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>10</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/" title="(10 downloads)" onclick="window.location='http://superscriptz.net/go.php?http://www.gdstarrating.com/'; return false"><img src="http://superscriptz.net/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p align="left"><a class="tt" href="http://twitter.com/home/?status=Object+Oriented+Configurations%3F%3F+http://n7x62.th8.us" title="Post to Twitter"><img class="nothumb" src="http://superscriptz.net/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://superscriptz.net/onykage/gameing/object-oriented-configurations/&amp;title=Object+Oriented+Configurations%3F%3F" title="Post to Digg"><img class="nothumb" src="http://superscriptz.net/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://superscriptz.net/onykage/gameing/object-oriented-configurations/&amp;t=Object+Oriented+Configurations%3F%3F" title="Post to Facebook"><img class="nothumb" src="http://superscriptz.net/wp-content/plugins/tweet-this/icons/tt-facebook-big4.png" alt="Post to Facebook" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Object+Oriented+Configurations%3F%3F&amp;link=http://superscriptz.net/onykage/gameing/object-oriented-configurations/" title="Post to Ping.fm"><img class="nothumb" src="http://superscriptz.net/wp-content/plugins/tweet-this/icons/tt-ping-big4.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://superscriptz.net/onykage/gameing/object-oriented-configurations/&amp;title=Object+Oriented+Configurations%3F%3F" title="Post to StumbleUpon"><img class="nothumb" src="http://superscriptz.net/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://superscriptz.net/onykage/gameing/object-oriented-configurations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
