<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/1.5.2" -->
<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/"
>

<channel>
	<title>Games Blog</title>
	<link>http://www.jamestadeo.com/blog_games</link>
	<description>Games in Life that People Play by James Tadeo, Web Developer and Designer</description>
	<pubDate>Mon, 11 Sep 2006 07:39:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.2</generator>
	<language>en</language>

		<item>
		<title>Torque Resource - Ken Finney&#8217;s book 3D Game Programming All-in-One</title>
		<link>http://www.jamestadeo.com/blog_games/?p=103</link>
		<comments>http://www.jamestadeo.com/blog_games/?p=103#comments</comments>
		<pubDate>Tue, 05 Sep 2006 12:16:11 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Miscellany</category>
	<category>FPS Games</category>
	<category>Mods to FPS Starter Kit</category>
	<category>Game Tools</category>
		<guid>http://www.jamestadeo.com/blog_games/?p=103</guid>
		<description><![CDATA[	
	The Torque Game Engine is a very complex. I purchased it about a year ago this September and feel I am still swimming in the shallow end of Lake Newbian. GarageGames.com has a forum with a lot of people chiming in and discussing a dizzying array of topics. Most of the time, I rarely make [...]]]></description>
			<content:encoded><![CDATA[	<p><center><img src="http://www.james-tadeo.com/web-design-brampton/downloads/3dGameProgrammingAllinOneKenFinney300x375.jpg" alt="Torque Tutorials and Game Development Book - 3D Game Programming All In One by Kenneth C. Finney " /></center></p>
	<p>The Torque Game Engine is a very complex. I purchased it about a year ago this September and feel I am still swimming in the shallow end of Lake Newbian. <a href="http://www.garagegames.com/">GarageGames.com</a> has a forum with a lot of people chiming in and discussing a dizzying array of topics. Most of the time, I rarely make heads or tails of what they&#8217;re talking about. I just continue to wade in the shallow end. One of the things that obfuscates me mind is a point of reference from which these folks are using. As there are several versions of the Torque Game Engine and with that different versions of the starter files, again, I rarely know what context their examples or code/scripts are referring to.</p>
	<p>I find not having a point of reference contributes to confusion and wasted time, especially with tutorials. I know I&#8217;ve written some tutorials that had no point of reference that six months later I had no clue what I was trying to say. Pfft! Imagine the reader&#8230;doh!</p>
	<p><strong>I Finally Get the Point</strong><br />
I got a hold of <a href="http://www.garagegames.com/index.php?sec=mg&#038;mod=resource&#038;page=view&#038;qid=5638">Ken Finney&#8217;s book 3D Game Programming All-in-One (Torque) </a> and it was excellent. For months, I had been scouring and surfing the Web and basically leeching off other people for info about how to do this or how to do that. This book gives you a point of reference and context to work from and the instructions are detailed to the degree that you can create a game with the information being presented. It was good to finally get my own copy.</p>
	<p><strong>With My New Found Knowledge - I Wrote My First GG Tutorial</strong><br />
<img src="http://www.jamestadeo.com/Games-by-James-Tadeo/torque/Torque-Tutorials/Torque-Player-Selection/tut_playerselectionInto.jpg" alt="Simple Player Selection" /><br />
<em>Above: My first official tutorial for my fellow Torque developers posted at GarageGames.com.</em></p>
	<p>As of today, I am still in the first few chapters as I learn about datablocks and basic functions, but I can see myself really understanding how Torque script works as I leverage my previous programming experience. For example, I was able to figure out how to select a player before going into a game. Using the info from Ken&#8217;s book and a number of GarageGames.com resources to work from, I wrote <a href="http://www.jamestadeo.com/Games-by-James-Tadeo/torque/Torque-Tutorials/Torque-Player-Selection/Torque-Player-Selection.php">Simple Player Selection Torque Tutorial</a>. It&#8217;s gotten some <a href="http://www.garagegames.com/mg/forums/result.thread.php?qt=15408">good reviews</a> from my fellow Torquers. Writing the tutorial itself was a learning experience. It forced me to slow down and really understand what it was I was trying to do. Therein is a good way to learn. Write a tutorial. Writing a tutorial is good as it helps to document a technique that you may need later on. I know for me, I will typically forget what I&#8217;ve made a few months into the year, unless I refer to it frequently. A tutorial helps to remember. Sorta like commenting your code, but much more helpful and informative.</p>
	<p>Well, it&#8217;s 5:00 am and I have to start <a href="http://www.jamestadeo.com/websamples.php">my day job</a> in a few hours. </p>
	<p>Happy Torquing <img src='http://www.jamestadeo.com/blog_games/wp-images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRSS>http://www.jamestadeo.com/blog_games/?feed=rss2&amp;p=103</wfw:commentRSS>
	</item>
		<item>
		<title>Torque Tutorials - Getting Rid of the Orcs</title>
		<link>http://www.jamestadeo.com/blog_games/?p=100</link>
		<comments>http://www.jamestadeo.com/blog_games/?p=100#comments</comments>
		<pubDate>Sat, 12 Aug 2006 08:37:00 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>FPS Games</category>
	<category>Mods to FPS Starter Kit</category>
		<guid>http://www.jamestadeo.com/blog_games/?p=100</guid>
		<description><![CDATA[	Sometimes those Orcs can be really tiresome. So what do you do? Well replace with them with your own character. Maybe a fork (orc -> fork, get it? ha. ha. ha.) or something else. Remember you too can change!
	
	Assuming you already have a character that has been converted to a .dts file, one way of [...]]]></description>
			<content:encoded><![CDATA[	<p>Sometimes those Orcs can be really tiresome. So what do you do? Well replace with them with your own character. Maybe a fork (orc -> fork, get it? ha. ha. ha.) or something else. Remember you too can change!</p>
	<p><img src='http://www.jamestadeo.com/blog_games/wp-content/ORC2HumanBeforeAfter443.jpg' alt='You too can change!' /></p>
	<p>Assuming you already have a character that has been converted to a .dts file, one way of modding the Starter FPS Kit with the GarageGames Torque Game engine is by going to .cs files and also providing your own .dts player file within the scripts.</p>
	<p>The two files you want to concern yourself with are both named player.cs. However while they are same named, they are different and are located in different dirctories. Here are their respective locations. One is in:<br />
starter.fps/server/scripts/player.cs and the other one is located in starter.fps/data/shapes/player/player.cs.</p>
	<p>Let&#8217;s look at  starter.fps/data/shapes/player/player.cs. I use TextPad and it allows me to see the line numbers. So in my case, on or about line 10 is the part of this file that I need to change. What needs to change is the location of the new player.dts file. In this example you see that I&#8217;ve experimented with a few others. One of them was from a book I picked up by Ken Finney (more on that later) and the other one is a sample character from Obsidian Games (we won&#8217;t be using Thom today). Here&#8217;s what it looks like:</p>
	<p><code>//starter.fps\data\shapes\player\player.cs</p>
	<p>//-----------------------------------------------------------------------------<br />
// Torque Game Engine<br />
// Copyright (C) GarageGames.com, Inc.<br />
//-----------------------------------------------------------------------------</p>
	<p>datablock TSShapeConstructor(PlayerDts)<br />
{<br />
<strong>   //baseShape = &#8220;./playerThom/player.dts&#8221;;<br />
   baseShape = &#8220;./playerEmaga/player.dts&#8221;;<br />
   //baseShape = &#8220;./player.dts&#8221;;</strong><br />
   sequence0 = &#8220;./player_root.dsq root&#8221;;<br />
   sequence1 = &#8220;./player_forward.dsq run&#8221;;<br />
   sequence2 = &#8220;./player_back.dsq back&#8221;;<br />
   sequence3 = &#8220;./player_side.dsq side&#8221;;<br />
   sequence4 = &#8220;./player_lookde.dsq look&#8221;;<br />
   sequence5 = &#8220;./player_head.dsq head&#8221;;<br />
   sequence6 = &#8220;./player_fall.dsq fall&#8221;;<br />
   sequence7 = &#8220;./player_land.dsq land&#8221;;<br />
   sequence8 = &#8220;./player_jump.dsq jump&#8221;;<br />
   sequence9  = &#8220;./player_diehead.dsq death1&#8243;;<br />
   sequence10 = &#8220;./player_diechest.dsq death2&#8243;;<br />
   sequence11 = &#8220;./player_dieback.dsq death3&#8243;;<br />
   sequence12 = &#8220;./player_diesidelf.dsq death4&#8243;;<br />
   sequence13 = &#8220;./player_diesidert.dsq death5&#8243;;<br />
   sequence14 = &#8220;./player_dieleglf.dsq death6&#8243;;<br />
   sequence15 = &#8220;./player_dielegrt.dsq death7&#8243;;<br />
   sequence16 = &#8220;./player_dieslump.dsq death8&#8243;;<br />
   sequence17 = &#8220;./player_dieknees.dsq death9&#8243;;<br />
   sequence18 = &#8220;./player_dieforward.dsq death10&#8243;;<br />
   sequence19 = &#8220;./player_diespin.dsq death11&#8243;;<br />
   sequence20 = &#8220;./player_looksn.dsq looksn&#8221;;<br />
   sequence21 = &#8220;./player_lookms.dsq lookms&#8221;;<br />
   sequence22 = &#8220;./player_scoutroot.dsq scoutroot&#8221;;<br />
   sequence23 = &#8220;./player_headside.dsq headside&#8221;;<br />
   sequence24 = &#8220;./player_recoilde.dsq light_recoil&#8221;;<br />
   sequence25 = &#8220;./player_sitting.dsq sitting&#8221;;<br />
   sequence26 = &#8220;./player_celsalute.dsq celsalute&#8221;;<br />
   sequence27 = &#8220;./player_celwave.dsq celwave&#8221;;<br />
   sequence28 = &#8220;./player_standjump.dsq standjump&#8221;;<br />
   sequence29 = &#8220;./player_looknw.dsq looknw&#8221;;<br />
};<br />
</code></p>
	<p>The parts we need to concern ourselves at this time is in bold. That my friends says that use the base shape that is found in the directory named playerEmaga and in it you will find the player.dts file. Ofcourse, make sure you have the player.dts file in the directory. So make sure you make a directory named playerEmaga with the player.dts file and textures accomanying it. Otherwise it will not work. So that&#8217;s  a step there.</p>
	<p>The other player.cs file located at starter.fps/server/scripts/player.cs needs the following adjustment:</p>
	<p><code>....</p>
	<p>datablock PlayerData(PlayerBody)<br />
{<br />
   renderFirstPerson = false;<br />
   emap = true;</p>
	<p>   className = Armor;<br />
   //shapeFile = "~/data/shapes/player/player.dts";<br />
   //shapeFile = "~/data/shapes/player/playerThom.dts";<br />
   <strong>shapeFile = &#8220;~/data/shapes/player/playerEmaga/player.dts&#8221;;</strong><br />
   cameraMaxDist = 3;<br />
   computeCRC = true;</p>
	<p>   canObserve = true;<br />
   cmdCategory = &#8220;Clients&#8221;;</p>
	<p>   cameraDefaultFov = 90.0;<br />
   cameraMinFov = 5.0;<br />
   cameraMaxFov = 120.0;</p>
	<p>   debrisShapeName = &#8220;~/data/shapes/player/debris_player.dts&#8221;;<br />
   debris = playerDebris;</p>
	<p>   aiAvoidThis = true;</p>
	<p>   minLookAngle = -1.4;<br />
   maxLookAngle = 1.4;<br />
   maxFreelookAngle = 3.0;</p>
	<p>&#8230;.<br />
</code></p>
	<p>I&#8217;ve just snipped a part of the player.cs file because it is a very very long file. In this case we&#8217;ve snipped the PlayerData datablock. In bold is what you need to make sure you change. You will also notice I did some other test just above it. They&#8217;ve been commented out so those statements will be ignored.</p>
	<p>So once you&#8217;ve done those changes in both player.cs files and have also created the playerEmaga directory containing the new player.dts, you should see your new player appear.</p>
	<p>See, no more Orcs!</p>
	<p>The next thing I want to do is be able to add different players and player types. That&#8217;s gonna be a pain because I really don&#8217;t know where to start with that one. Help?</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.jamestadeo.com/blog_games/?feed=rss2&amp;p=100</wfw:commentRSS>
	</item>
		<item>
		<title>FPS Game Tourney at the Meetup</title>
		<link>http://www.jamestadeo.com/blog_games/?p=98</link>
		<comments>http://www.jamestadeo.com/blog_games/?p=98#comments</comments>
		<pubDate>Fri, 04 Aug 2006 18:53:19 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Miscellany</category>
	<category>FPS Games</category>
	<category>Torque Game Engine</category>
		<guid>http://www.jamestadeo.com/blog_games/?p=98</guid>
		<description><![CDATA[	
	I am a Web designer and programmer and in my near zilch spare time lately, I like to try out some amateur gaming and game development.  Just a few days ago a few of my Meetup friends decided to try out a little FPS.
	More About Meetup
I operate my business in Brampton and currently do [...]]]></description>
			<content:encoded><![CDATA[	<p><img src='http://www.jamestadeo.com/blog_games/wp-content/meetuptorquegamefps.jpg' alt='The Brampton Web Design Meetup FPS Tourney' /></p>
	<p>I am a Web designer and programmer and in my near zilch spare time lately, I like to try out some amateur gaming and game development.  Just a few days ago a few of my <a href="http://webdesign.meetup.com/387/about/">Meetup </a>friends decided to try out a little FPS.</p>
	<p><strong>More About Meetup</strong><br />
I operate my business in Brampton and currently do work with companies in and around the GTA. A few months ago <a href="http://webdesign.meetup.com/387/about/">the Brampton Web Design Meetup</a> was started up. It&#8217;s a very simple board that can help people with similar interests to sign up on-line then eventually meetup in person. It&#8217;s actually a great concept. I know <a href="http://graphicdesign.meetup.com/2/about/">the Toronto Graphic Design Meetup</a> was one of the first ones I joined and it would have anywhere from 20 to 30 graphic designers meeting up on a monthly basis. It is great for inspiration and commisertion <img src='http://www.jamestadeo.com/blog_games/wp-images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
	<p>Anyway, I decided to post my little FPS test game that I put together using the startup files from the <a href="http://www.garagegames.com/">GarageGames.com</a>. I know the game was a pretty big hit last year with some of my friends from the How Design Forum and ones I met via the GarageGames.com forums. My initial post didn&#8217;t garner as much interest as I had thought it would. Mind you, I didn&#8217;t have a lot of members. Last week changed. I got a few people playing and boy was it fun <img src='http://www.jamestadeo.com/blog_games/wp-images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  A few of the Web designers and mixed bagged technologist from my M<br />
eetup signed up and we played a few rounds of FPS.</p>
	<p>So for those possible interested, please check out the download and tourney info from <a href="http://webdesign.meetup.com/387/boards/view/viewthread?thread=1695828">The Brampton Web Design Meetup page.</a></p>
	<p>I hope to see you there sometime!</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.jamestadeo.com/blog_games/?feed=rss2&amp;p=98</wfw:commentRSS>
	</item>
		<item>
		<title>AI Pack from Bullpen Studios</title>
		<link>http://www.jamestadeo.com/blog_games/?p=89</link>
		<comments>http://www.jamestadeo.com/blog_games/?p=89#comments</comments>
		<pubDate>Fri, 28 Jul 2006 12:55:54 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Miscellany</category>
	<category>Torque Game Engine</category>
		<guid>http://www.jamestadeo.com/blog_games/?p=89</guid>
		<description><![CDATA[	
	At some point in my game development endeavours, I am sure I will need some kind of AI or Artificial Intelligence. For the uninitiated, these can include things like monsters or bad guys running to after &#8220;you&#8221; as you traverse the game. It is controlled by a set of random computations meant to seem like [...]]]></description>
			<content:encoded><![CDATA[	<p><img src='http://www.jamestadeo.com/blog_games/wp-content/AIPACKBULLPENSTUDIOS.jpg' alt='AI pack from Bullpen Studios' /></p>
	<p>At some point in my game development endeavours, I am sure I will need some kind of AI or Artificial Intelligence. For the uninitiated, these can include things like monsters or bad guys running to after &#8220;you&#8221; as you traverse the game. It is controlled by a set of random computations meant to seem like a live player. Ofcourse, nothing beats the randomness of a real player and how unpredictable one can be. Enter the the AI pack from BullPen Studios. Aside from the very cool name, I like the idea behind the AI packs. I haven&#8217;t really tried it just yet, but will most likely get to it in time as the fuddle through the basics of the Torque game engine.</p>
	<p>Here&#8217;s their Web site at: <a href="http://www.bullpendesignstudios.com/">Bull Pen Studios</a><br />
There is also an entry at: <a href="http://www.garagegames.com/blogs/14448/9133">GarageGames blog entry<br />
</a></p>
	<p>I e-mailed these guys a few months ago to see I could get the skinny about their product but they declined to answer. Oh well <img src='http://www.jamestadeo.com/blog_games/wp-images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  So if anyone from Bullpen is reading this, please contact me. Thanks!</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.jamestadeo.com/blog_games/?feed=rss2&amp;p=89</wfw:commentRSS>
	</item>
		<item>
		<title>Torque Tutorials - How to Customize Weapons</title>
		<link>http://www.jamestadeo.com/blog_games/?p=61</link>
		<comments>http://www.jamestadeo.com/blog_games/?p=61#comments</comments>
		<pubDate>Wed, 05 Jul 2006 02:40:01 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>FPS Games</category>
	<category>Mods to FPS Starter Kit</category>
		<guid>http://www.jamestadeo.com/blog_games/?p=61</guid>
		<description><![CDATA[	What we want to do is to change the weapon in the game to say, a snowball thrower, water gun or a paintball gun. Something less violent and accessible for young gamers. I guess at some point we need to change the orcs as well. Cause they&#8217;re pretty scary looking. At least that&#8217;s what my [...]]]></description>
			<content:encoded><![CDATA[	<p>What we want to do is to change the weapon in the game to say, a snowball thrower, water gun or a paintball gun. Something less violent and accessible for young gamers. I guess at some point we need to change the orcs as well. Cause they&#8217;re pretty scary looking. At least that&#8217;s what my daughter says.</p>
	<p>GarageGames has a fabulous tool called the Torque ShowTool Pro. This is a program that allows you to see the different animations contained in a .dts file inluding the textures and how it would look in the Toruque game engine. Here&#8217;s a view of the activate sequence. This shows the ready mode of the activate sequence. It is actually a little animation.</p>
	<p><img src='http://www.jamestadeo.com/blog_games/wp-content/showtoolactivate3_01.jpg' alt='Torque ShowTool by David Wyand' /><br />
<strong><br />
I had a look at the weapon.dts file. And it contains the following sequences:</strong><br />
1. activate - from the closed to the open and ready mode.<br />
2. fire - this is the fire animation, then I guess you already knew that.<br />
3. reload - this pops in more ammo in the barrel of the crossbow.<br />
4. deactivate - from the ready mode to the close mode.<br />
5. noammo - this looks like the open ready mode, but with no ammo in place. In other words, you&#8217;re in trouble. Better get more ammo.</p>
	<p>The above seqences correspond to different states of the crossbow during game play. Along with the different animation sequences in .dts format, the crossbow also has an explosion animation that is used when the arrows hits a target. As well as ammo box that gets loaded into the weapon and the arrows that actually get shot.</p>
	<p>As you get to tinker with the weapons files you will notice that is very complex. This makes sense since it is a major part of the game.</p>
	<p><strong>The above sequences are called from the following files and also correlate to other parts of the game files. By the way the number in brackets is the line number and are approximations. Your could be different by now as there have been a number of updates:</strong><br />
starter.fps\client\config.cs(34): moveMap.bind(mouse0, &#8220;button0&#8243;, mouseFire);<br />
starter.fps\client\scripts\default.bind.cs(141): moveMap.bind( mouse, button0, mouseFire );<br />
starter.fps\server\scripts\crossbow.cs(914): function CrossbowImage::onFire(%this, %obj,<br />
%slot)<br />
<strong><br />
Here&#8217;s the files that relate to the word weapon:</strong><br />
starter.fps\server\scripts\crossbow.cs(7): // Crossbow weapon. This file contains all the items related to this weapon<br />
starter.fps\server\scripts\item.cs(18)<br />
starter.fps\server\scripts\player.cs(718): %obj.mountImage(%obj.lastWeapon, $WeaponSlot);<br />
starter.fps\server\scripts\weapon.cs(6): // This file contains Weapon and Ammo Class/&#8221;namespace&#8221; helper methods</p>
	<p><img src='http://www.jamestadeo.com/blog_games/wp-content/weaponFlatShade.jpg' alt='Simplified model of the crossbow as I learn' /><br />
Above: The simple model with joints intact.</p>
	<p><img src='http://www.jamestadeo.com/blog_games/wp-content/weaponTest1.jpg' alt='The test weapon mounted and ready to go.' /><br />
Above: Ahhh, our lovely orcs with shiny new additions, namely, the weapon loaded in the game and being in use by the orc. Mind you, at this point I haven&#8217;t even touched the code. All this just happens automatically. I provide the model and just make sure it&#8217;s named weapon.dts. Ofcourse, just make sure it is a .dts file that you export from MilkShape3d.</p>
	<p><img src='http://www.jamestadeo.com/blog_games/wp-content/weaponAnimSequences.jpg' alt='Sequence named in MilkShape3d' /><br />
The Torque Engine as defined by the script calls the different animation sequences. In this case, the activate, fire, reload, deactivate, and noammo. If you squint a bit, notice the &#8220;opt:scale=0.02&#8243; materials definition. If you do not define the scale, everything is super huge and it will not fit properly.</p>
	<p><img src='http://www.jamestadeo.com/blog_games/wp-content/weaponMountPoints1.jpg' alt='Mountpoints in the 3d model.' /><br />
The mountpoints define how the model (in this case the weapon model) will mount or get added to the orc. There is an associated script(s) that defines how this gets added.</p>
	<p><strong>The Explosions and Debris When Something Gets Hit</strong><br />
Here&#8217;s the file(s) that has something to do with explosions and the like. By experimenting and trying out different settings, you can enable different effects to take place. It really is a issue of trying it out. After a while, you become so pro or you stick to what you know that you just plug in the numbers like no one&#8217;s business:<br />
starter.fps\server\scripts\crossbow.cs</p>
	<p>Below, the crossbow.cs file with notations regarding the smoke.</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Torque Game Engine<br />
// Copyright (C) GarageGames.com, Inc.<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Crossbow weapon. This file contains all the items related to this weapon<br />
// including explosions, ammo, the item and the weapon item image.<br />
// These objects rely on the item &#038; inventory support system defined<br />
// in item.cs and inventory.cs<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Sounds profiles</p>
	<p>datablock AudioProfile(CrossbowReloadSound)<br />
{<br />
filename = &#8220;~/data/sound/crossbow_reload.ogg&#8221;;<br />
description = AudioClose3d;<br />
preload = true;<br />
};</p>
	<p>datablock AudioProfile(CrossbowFireSound)<br />
{<br />
filename = &#8220;~/data/sound/crossbow_firing.ogg&#8221;;<br />
description = AudioClose3d;<br />
preload = true;<br />
};</p>
	<p>datablock AudioProfile(CrossbowFireEmptySound)<br />
{<br />
filename = &#8220;~/data/sound/crossbow_firing_empty.ogg&#8221;;<br />
description = AudioClose3d;<br />
preload = true;<br />
};</p>
	<p>datablock AudioProfile(CrossbowExplosionSound)<br />
{<br />
filename = &#8220;~/data/sound/crossbow_explosion.ogg&#8221;;<br />
description = AudioDefault3d;<br />
preload = true;<br />
};</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Crossbow bolt projectile splash</p>
	<p>datablock ParticleData(CrossbowSplashMist)<br />
{<br />
   dragCoefficient      = 2.0;<br />
   gravityCoefficient   = -0.05;<br />
   inheritedVelFactor   = 0.0;<br />
   constantAcceleration = 0.0;<br />
   lifetimeMS           = 400;<br />
   lifetimeVarianceMS   = 100;<br />
   useInvAlpha          = false;<br />
   spinRandomMin        = -90.0;<br />
   spinRandomMax        = 500.0;<br />
   textureName          = &#8220;~/data/shapes/crossbow/splash&#8221;;</p>
	<p>   colors[0]     = &#8220;0.7 0.8 1.0 1.0&#8243;;<br />
   colors[1]     = &#8220;0.7 0.8 1.0 0.5&#8243;;<br />
   colors[2]     = &#8220;0.7 0.8 1.0 0.0&#8243;;</p>
	<p>   sizes[0]      = 0.5;<br />
   sizes[1]      = 0.5;<br />
   sizes[2]      = 0.8;<br />
   times[0]      = 0.0;<br />
   times[1]      = 0.5;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowSplashMistEmitter)<br />
{<br />
   ejectionPeriodMS = 5;<br />
   periodVarianceMS = 0;<br />
   ejectionVelocity = 3.0;<br />
   velocityVariance = 2.0;<br />
   ejectionOffset   = 0.0;<br />
   thetaMin         = 85;<br />
   thetaMax         = 85;<br />
   phiReferenceVel  = 0;<br />
   phiVariance      = 360;<br />
   overrideAdvance = false;<br />
   lifetimeMS       = 250;<br />
   particles = &#8220;CrossbowSplashMist&#8221;;<br />
};</p>
	<p>datablock ParticleData( CrossbowSplashParticle )<br />
{<br />
   dragCoefficient      = 1;<br />
   gravityCoefficient   = 0.2;<br />
   inheritedVelFactor   = 0.2;<br />
   constantAcceleration = -0.0;<br />
   lifetimeMS           = 600;<br />
   lifetimeVarianceMS   = 0;</p>
	<p>   colors[0]     = &#8220;0.7 0.8 1.0 1.0&#8243;;<br />
   colors[1]     = &#8220;0.7 0.8 1.0 0.5&#8243;;<br />
   colors[2]     = &#8220;0.7 0.8 1.0 0.0&#8243;;</p>
	<p>   sizes[0]      = 0.5;<br />
   sizes[1]      = 0.5;<br />
   sizes[2]      = 0.5;<br />
   times[0]      = 0.0;<br />
   times[1]      = 0.5;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleEmitterData( CrossbowSplashEmitter )<br />
{<br />
   ejectionPeriodMS = 1;<br />
   periodVarianceMS = 0;<br />
   ejectionVelocity = 3;<br />
   velocityVariance = 1.0;<br />
   ejectionOffset   = 0.0;<br />
   thetaMin         = 60;<br />
   thetaMax         = 80;<br />
   phiReferenceVel  = 0;<br />
   phiVariance      = 360;<br />
   overrideAdvance = false;<br />
   orientParticles  = true;<br />
   lifetimeMS       = 100;<br />
   particles = &#8220;CrossbowSplashParticle&#8221;;<br />
};</p>
	<p>datablock SplashData(CrossbowSplash)<br />
{<br />
   numSegments = 15;<br />
   ejectionFreq = 15;<br />
   ejectionAngle = 40;<br />
   ringLifetime = 0.5;<br />
   lifetimeMS = 300;<br />
   velocity = 4.0;<br />
   startRadius = 0.0;<br />
   acceleration = -3.0;<br />
   texWrap = 5.0;</p>
	<p>   texture = &#8220;~/data/shapes/crossbow/splash&#8221;;</p>
	<p>   emitter[0] = CrossbowSplashEmitter;<br />
   emitter[1] = CrossbowSplashMistEmitter;</p>
	<p>   colors[0] = &#8220;0.7 0.8 1.0 0.0&#8243;;<br />
   colors[1] = &#8220;0.7 0.8 1.0 0.3&#8243;;<br />
   colors[2] = &#8220;0.7 0.8 1.0 0.7&#8243;;<br />
   colors[3] = &#8220;0.7 0.8 1.0 0.0&#8243;;<br />
   times[0] = 0.0;<br />
   times[1] = 0.4;<br />
   times[2] = 0.8;<br />
   times[3] = 1.0;<br />
};</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Crossbow bolt projectile particles</p>
	<p>datablock ParticleData(CrossbowBoltParticle)<br />
{<br />
   textureName          = &#8220;~/data/shapes/particles/smoke&#8221;;<br />
   dragCoefficient     = 0.0;<br />
   gravityCoefficient   = -0.1;   // rises slowly<br />
   inheritedVelFactor   = 0.0;<br />
   lifetimeMS           = 150;<br />
   lifetimeVarianceMS   = 10;   // &#8230;more or less<br />
   useInvAlpha = false;<br />
   spinRandomMin = -30.0;<br />
   spinRandomMax = 30.0;</p>
	<p>//jt trailing color on crossbow bolt<br />
//the thing that gets shot from the crossbos<br />
   colors[0]     = &#8220;0.1 0.1 0.1 1.0&#8243;;<br />
   colors[1]     = &#8220;0.1 0.1 0.1 1.0&#8243;;<br />
   colors[2]     = &#8220;0.1 0.1 0.1 0&#8243;;</p>
	<p>  //jt yellow<br />
   //colors[0] = &#8220;0.7 0.7 0.0 0.7&#8243;;<br />
   //colors[1] = &#8220;0.9 0.8 0.0 0.3&#8243;;<br />
   //colors[2] = &#8220;0.8 0.8 0.0 0.2&#8243;;</p>
	<p>   sizes[0]      = 0.15;<br />
   sizes[1]      = 0.20;<br />
   sizes[2]      = 0.25;</p>
	<p>   times[0]      = 0.0;<br />
   times[1]      = 0.3;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleData(CrossbowBubbleParticle)<br />
{<br />
   textureName          = &#8220;~/data/shapes/particles/bubble&#8221;;<br />
   dragCoefficient      = 0.0;<br />
   gravityCoefficient   = -0.25;   // rises slowly<br />
   inheritedVelFactor   = 0.0;<br />
   constantAcceleration = 0.0;<br />
   lifetimeMS           = 1500;<br />
   lifetimeVarianceMS   = 600;    // &#8230;more or less<br />
   useInvAlpha          = false;<br />
   spinRandomMin        = -100.0;<br />
   spinRandomMax        = 100.0;</p>
	<p>   colors[0]     = &#8220;0.7 0.8 1.0 0.4&#8243;;<br />
   colors[1]     = &#8220;0.7 0.8 1.0 1.0&#8243;;<br />
   colors[2]     = &#8220;0.7 0.8 1.0 0.0&#8243;;</p>
	<p>   sizes[0]      = 0.2;<br />
   sizes[1]      = 0.2;<br />
   sizes[2]      = 0.2;</p>
	<p>   times[0]      = 0.0;<br />
   times[1]      = 0.5;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowBoltEmitter)<br />
{<br />
   ejectionPeriodMS = 2;<br />
   periodVarianceMS = 0;</p>
	<p>   ejectionVelocity = 0.0;<br />
   velocityVariance = 0.10;</p>
	<p>   thetaMin         = 0.0;<br />
   thetaMax         = 90.0;  </p>
	<p>   particles = CrossbowBoltParticle;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowBoltBubbleEmitter)<br />
{<br />
   ejectionPeriodMS = 9;<br />
   periodVarianceMS = 0;</p>
	<p>   ejectionVelocity = 1.0;<br />
   ejectionOffset   = 0.1;<br />
   velocityVariance = 0.5;</p>
	<p>   thetaMin         = 0.0;<br />
   thetaMax         = 80.0;</p>
	<p>   phiReferenceVel  = 0;<br />
   phiVariance      = 360;<br />
   overrideAdvances = false;  </p>
	<p>   particles = CrossbowBubbleParticle;<br />
};</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Explosion Debris</p>
	<p>// Debris &#8220;spark&#8221; explosion<br />
datablock ParticleData(CrossbowDebrisSpark)<br />
{<br />
   textureName          = &#8220;~/data/shapes/particles/fire&#8221;;<br />
   dragCoefficient      = 0;<br />
   gravityCoefficient   = 0.0;<br />
   windCoefficient      = 0;<br />
   inheritedVelFactor   = 0.5;<br />
   constantAcceleration = 0.0;<br />
   lifetimeMS           = 500;<br />
   lifetimeVarianceMS   = 50;<br />
   spinRandomMin = -90.0;<br />
   spinRandomMax =  90.0;<br />
   useInvAlpha   = false;</p>
	<p>   colors[0]     = &#8220;0.8 0.2 0 1.0&#8243;;<br />
   colors[1]     = &#8220;0.8 0.2 0 1.0&#8243;;<br />
   colors[2]     = &#8220;0 0 0 0.0&#8243;;</p>
	<p>   sizes[0]      = 0.2;<br />
   sizes[1]      = 0.3;<br />
   sizes[2]      = 0.1;</p>
	<p>   times[0]      = 0.0;<br />
   times[1]      = 0.5;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowDebrisSparkEmitter)<br />
{<br />
   ejectionPeriodMS = 20;<br />
   periodVarianceMS = 0;<br />
   ejectionVelocity = 0.5;<br />
   velocityVariance = 0.25;<br />
   ejectionOffset   = 0.0;<br />
   thetaMin         = 0;<br />
   thetaMax         = 90;<br />
   phiReferenceVel  = 0;<br />
   phiVariance      = 360;<br />
   overrideAdvances = false;<br />
   orientParticles  = false;<br />
   lifetimeMS       = 300;<br />
   particles = &#8220;CrossbowDebrisSpark&#8221;;<br />
};</p>
	<p>datablock ExplosionData(CrossbowDebrisExplosion)<br />
{<br />
   emitter[0] = CrossbowDebrisSparkEmitter;</p>
	<p>   // Turned off..<br />
   shakeCamera = false;<br />
   impulseRadius = 0;<br />
   lightStartRadius = 0;<br />
   lightEndRadius = 0;<br />
};</p>
	<p>// Debris smoke trail<br />
datablock ParticleData(CrossbowDebrisTrail)<br />
{<br />
   textureName          = &#8220;~/data/shapes/particles/fire&#8221;;<br />
   dragCoefficient      = 1;<br />
   gravityCoefficient   = 0;<br />
   inheritedVelFactor   = 0;<br />
   windCoefficient      = 0;<br />
   constantAcceleration = 0;<br />
   lifetimeMS           = 800;<br />
   lifetimeVarianceMS   = 100;<br />
   spinSpeed     = 0;<br />
   spinRandomMin = -90.0;<br />
   spinRandomMax =  90.0;<br />
   useInvAlpha   = true;</p>
	<p>   //jt makes a black trail of smoke trailing the debris<br />
   colors[0]     = &#8220;0.8 0.3 0.0 1.0&#8243;;<br />
   colors[1]     = &#8220;0.1 0.1 0.1 0.7&#8243;;<br />
   colors[2]     = &#8220;0.1 0.1 0.1 0.0&#8243;;</p>
	<p>  //jt makes a yello trail in the debris<br />
  //colors[0] = &#8220;0.7 0.7 0.0 0.7&#8243;;<br />
  //colors[1] = &#8220;0.9 0.8 0.0 0.3&#8243;;<br />
  //colors[2] = &#8220;0.8 0.8 0.0 0.2&#8243;;</p>
	<p>   sizes[0]      = 0.2;<br />
   sizes[1]      = 0.3;<br />
   sizes[2]      = 0.4;</p>
	<p>   times[0]      = 0.1;<br />
   times[1]      = 0.2;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowDebrisTrailEmitter)<br />
{<br />
   ejectionPeriodMS = 30;<br />
   periodVarianceMS = 0;<br />
   ejectionVelocity = 0.0;<br />
   velocityVariance = 0.0;<br />
   ejectionOffset   = 0.0;<br />
   thetaMin         = 170;<br />
   thetaMax         = 180;<br />
   phiReferenceVel  = 0;<br />
   phiVariance      = 360;<br />
   //overrideAdvances = false;<br />
   //orientParticles  = true;<br />
   lifetimeMS       = 5000;<br />
   particles = &#8220;CrossbowDebrisTrail&#8221;;<br />
};</p>
	<p>// Debris object<br />
datablock DebrisData(CrossbowExplosionDebris)<br />
{<br />
   shapeFile = &#8220;~/data/shapes/crossbow/debris.dts&#8221;;<br />
   emitters = &#8220;CrossbowDebrisTrailEmitter&#8221;;<br />
   explosion = CrossbowDebrisExplosion;</p>
	<p>   elasticity = 0.6;<br />
   friction = 0.5;<br />
   numBounces = 1;<br />
   bounceVariance = 1;<br />
   explodeOnMaxBounce = true;<br />
   staticOnMaxBounce = false;<br />
   snapOnMaxBounce = false;<br />
   minSpinSpeed = 0;<br />
   maxSpinSpeed = 700;<br />
   render2D = false;<br />
   lifetime = 4;<br />
   lifetimeVariance = 0.4;<br />
   velocity = 5;<br />
   velocityVariance = 0.5;<br />
   fade = false;<br />
   useRadiusMass = true;<br />
   baseRadius = 0.3;<br />
   gravModifier = 0.5;<br />
   terminalVelocity = 6;<br />
   ignoreWater = true;<br />
};</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Bolt Explosion</p>
	<p>datablock ParticleData(CrossbowExplosionSmoke)<br />
{<br />
   textureName          = &#8220;~/data/shapes/particles/smoke&#8221;;<br />
   dragCoeffiecient     = 100.0;<br />
   gravityCoefficient   = 0;<br />
   inheritedVelFactor   = 0.25;<br />
   constantAcceleration = -0.30;<br />
   lifetimeMS           = 1200;<br />
   lifetimeVarianceMS   = 300;<br />
   useInvAlpha =  true;<br />
   spinRandomMin = -80.0;<br />
   spinRandomMax =  80.0;</p>
	<p>   //jt color of the explosions smoke<br />
   //after the middle explosion smoke<br />
   //colors[0]     = &#8220;0.56 0.36 0.26 1.0&#8243;;<br />
   //colors[1]     = &#8220;0.2 0.2 0.2 1.0&#8243;;<br />
   //colors[2]     = &#8220;0.0 0.0 0.0 0.0&#8243;;</p>
	<p>   //51 102 0 rgb green<br />
      //colors[0] = &#8220;0.1 0.5 0.0 0.1&#8243;;</p>
	<p>   //yellow<br />
      //colors[1] = &#8220;0.9 0.9 0.0 0.3&#8243;;</p>
	<p>    //lighter intensity of yellow<br />
      //colors[2] = &#8220;0.9 0.9 0.0 0.2&#8243;;</p>
	<p>   sizes[0]      = 4.0;<br />
   sizes[1]      = 2.5;<br />
   sizes[2]      = 1.0;</p>
	<p>   times[0]      = 0.0;<br />
   times[1]      = 0.5;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleData(CrossbowExplosionBubble)<br />
{<br />
   textureName          = &#8220;~/data/shapes/particles/bubble&#8221;;<br />
   dragCoeffiecient     = 0.0;<br />
   gravityCoefficient   = -0.25;<br />
   inheritedVelFactor   = 0.0;<br />
   constantAcceleration = 0.0;<br />
   lifetimeMS           = 1500;<br />
   lifetimeVarianceMS   = 600;<br />
   useInvAlpha          = false;<br />
   spinRandomMin        = -100.0;<br />
   spinRandomMax        =  100.0;</p>
	<p>   colors[0]     = &#8220;0.7 0.8 1.0 0.4&#8243;;<br />
   colors[1]     = &#8220;0.7 0.8 1.0 0.4&#8243;;<br />
   colors[2]     = &#8220;0.7 0.8 1.0 0.0&#8243;;</p>
	<p>   sizes[0]      = 0.3;<br />
   sizes[1]      = 0.3;<br />
   sizes[2]      = 0.3;</p>
	<p>   times[0]      = 0.0;<br />
   times[1]      = 0.5;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowExplosionSmokeEmitter)<br />
{<br />
   ejectionPeriodMS = 10;<br />
   periodVarianceMS = 0;<br />
   ejectionVelocity = 4;<br />
   velocityVariance = 0.5;<br />
   thetaMin         = 0.0;<br />
   thetaMax         = 180.0;<br />
   lifetimeMS       = 250;<br />
   particles = &#8220;CrossbowExplosionSmoke&#8221;;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowExplosionBubbleEmitter)<br />
{<br />
   ejectionPeriodMS = 9;<br />
   periodVarianceMS = 0;<br />
   ejectionVelocity = 1;<br />
   ejectionOffset   = 0.1;<br />
   velocityVariance = 0.5;<br />
   thetaMin         = 0.0;<br />
   thetaMax         = 80.0;<br />
   phiReferenceVel  = 0;<br />
   phiVariance      = 360;<br />
   overrideAdvances = false;<br />
   particles = &#8220;CrossbowExplosionBubble&#8221;;<br />
};</p>
	<p>datablock ParticleData(CrossbowExplosionFire)<br />
{<br />
   textureName          = &#8220;~/data/shapes/particles/fire&#8221;;<br />
   dragCoeffiecient     = 100.0;<br />
   gravityCoefficient   = 0;<br />
   inheritedVelFactor   = 0.25;<br />
   constantAcceleration = 0.1;<br />
   lifetimeMS           = 1200;<br />
   lifetimeVarianceMS   = 300;<br />
   useInvAlpha =  false;<br />
   spinRandomMin = -80.0;<br />
   spinRandomMax =  80.0;</p>
	<p>//jt the middle part of the explosion<br />
   //colors[0]     = &#8220;0.8 0.4 0 0.8&#8243;;<br />
   //colors[1]     = &#8220;0.2 0.0 0 0.8&#8243;;<br />
   //colors[2]     = &#8220;0.0 0.0 0.0 0.0&#8243;;</p>
	<p>   //jt green<br />
      colors[0]     = &#8220;0.1 0.5 0.0 0.1&#8243;;<br />
      colors[1]     = &#8220;0.1 0.5 0.0 0.1&#8243;;<br />
      colors[2]     = &#8220;0.1 0.5 0.0 0.1&#8243;;</p>
	<p>   sizes[0]      = 1.5;<br />
   sizes[1]      = 0.9;<br />
   sizes[2]      = 0.5;</p>
	<p>   times[0]      = 0.0;<br />
   times[1]      = 0.5;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowExplosionFireEmitter)<br />
{<br />
   ejectionPeriodMS = 10;<br />
   periodVarianceMS = 0;<br />
   ejectionVelocity = 0.8;<br />
   velocityVariance = 0.5;<br />
   thetaMin         = 0.0;<br />
   thetaMax         = 180.0;<br />
   lifetimeMS       = 250;<br />
   particles = &#8220;CrossbowExplosionFire&#8221;;<br />
};</p>
	<p>datablock ParticleData(CrossbowExplosionSparks)<br />
{<br />
   textureName          = &#8220;~/data/shapes/particles/spark&#8221;;<br />
   dragCoefficient      = 1;<br />
   gravityCoefficient   = 0.0;<br />
   inheritedVelFactor   = 0.2;<br />
   constantAcceleration = 0.0;<br />
   lifetimeMS           = 500;<br />
   lifetimeVarianceMS   = 350;</p>
	<p>   colors[0]     = &#8220;0.60 0.40 0.30 1.0&#8243;;<br />
   colors[1]     = &#8220;0.60 0.40 0.30 1.0&#8243;;<br />
   colors[2]     = &#8220;1.0 0.40 0.30 0.0&#8243;;</p>
	<p>   sizes[0]      = 0.25;<br />
   sizes[1]      = 0.15;<br />
   sizes[2]      = 0.15;</p>
	<p>   times[0]      = 0.0;<br />
   times[1]      = 0.5;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleData(CrossbowExplosionWaterSparks)<br />
{<br />
   textureName          = &#8220;~/data/shapes/particles/bubble&#8221;;<br />
   dragCoefficient      = 0;<br />
   gravityCoefficient   = 0.0;<br />
   inheritedVelFactor   = 0.2;<br />
   constantAcceleration = 0.0;<br />
   lifetimeMS           = 500;<br />
   lifetimeVarianceMS   = 350;</p>
	<p>   colors[0]     = &#8220;0.4 0.4 1.0 1.0&#8243;;<br />
   colors[1]     = &#8220;0.4 0.4 1.0 1.0&#8243;;<br />
   colors[2]     = &#8220;0.4 0.4 1.0 0.0&#8243;;</p>
	<p>   sizes[0]      = 0.5;<br />
   sizes[1]      = 0.5;<br />
   sizes[2]      = 0.5;</p>
	<p>   times[0]      = 0.0;<br />
   times[1]      = 0.5;<br />
   times[2]      = 1.0;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowExplosionSparkEmitter)<br />
{<br />
   ejectionPeriodMS = 3;<br />
   periodVarianceMS = 0;<br />
   ejectionVelocity = 5;<br />
   velocityVariance = 1;<br />
   ejectionOffset   = 0.0;<br />
   thetaMin         = 0;<br />
   thetaMax         = 180;<br />
   phiReferenceVel  = 0;<br />
   phiVariance      = 360;<br />
   overrideAdvances = false;<br />
   orientParticles  = true;<br />
   lifetimeMS       = 100;<br />
   particles = &#8220;CrossbowExplosionSparks&#8221;;<br />
};</p>
	<p>datablock ParticleEmitterData(CrossbowExplosionWaterSparkEmitter)<br />
{<br />
   ejectionPeriodMS = 3;<br />
   periodVarianceMS = 0;<br />
   ejectionVelocity = 4;<br />
   velocityVariance = 4;<br />
   ejectionOffset   = 0.0;<br />
   thetaMin         = 0;<br />
   thetaMax         = 60;<br />
   phiReferenceVel  = 0;<br />
   phiVariance      = 360;<br />
   overrideAdvances = false;<br />
   orientParticles  = true;<br />
   lifetimeMS       = 200;<br />
   particles = &#8220;CrossbowExplosionWaterSparks&#8221;;<br />
};</p>
	<p>datablock ExplosionData(CrossbowSubExplosion1)<br />
{<br />
   offset = 0;<br />
   emitter[0] = CrossbowExplosionSmokeEmitter;<br />
   emitter[1] = CrossbowExplosionSparkEmitter;<br />
};</p>
	<p>datablock ExplosionData(CrossbowSubExplosion2)<br />
{<br />
   offset = 1.0;<br />
   emitter[0] = CrossbowExplosionSmokeEmitter;<br />
   emitter[1] = CrossbowExplosionSparkEmitter;<br />
};</p>
	<p>datablock ExplosionData(CrossbowSubWaterExplosion1)<br />
{<br />
   delayMS   = 100;<br />
   offset    = 1.2;<br />
   playSpeed = 1.5;</p>
	<p>   emitter[0] = CrossbowExplosionBubbleEmitter;<br />
   emitter[1] = CrossbowExplosionWaterSparkEmitter;</p>
	<p>   sizes[0] = &#8220;0.75 0.75 0.75&#8243;;<br />
   sizes[1] = &#8220;1.0 1.0 1.0&#8243;;<br />
   sizes[2] = &#8220;0.5 0.5 0.5&#8243;;<br />
   times[0] = 0.0;<br />
   times[1] = 0.5;<br />
   times[2] = 1.0;<br />
};</p>
	<p>datablock ExplosionData(CrossbowSubWaterExplosion2)<br />
{<br />
   delayMS   = 50;<br />
   offset    = 1.2;<br />
   playSpeed = 0.75;</p>
	<p>   emitter[0] = CrossbowExplosionBubbleEmitter;<br />
   emitter[1] = CrossbowExplosionWaterSparkEmitter;</p>
	<p>   sizes[0] = &#8220;1.5 1.5 1.5&#8243;;<br />
   sizes[1] = &#8220;1.5 1.5 1.5&#8243;;<br />
   sizes[2] = &#8220;1.0 1.0 1.0&#8243;;<br />
   times[0] = 0.0;<br />
   times[1] = 0.5;<br />
   times[2] = 1.0;<br />
};</p>
	<p>datablock ExplosionData(CrossbowExplosion)<br />
{<br />
   soundProfile = CrossbowExplosionSound;<br />
   lifeTimeMS = 1200;</p>
	<p>   // Volume particles<br />
   particleEmitter = CrossbowExplosionFireEmitter;<br />
   particleDensity = 75;<br />
   particleRadius = 2;</p>
	<p>   // Point emission<br />
   emitter[0] = CrossbowExplosionSmokeEmitter;<br />
   emitter[1] = CrossbowExplosionSparkEmitter;</p>
	<p>   // Sub explosion objects<br />
   subExplosion[0] = CrossbowSubExplosion1;<br />
   subExplosion[1] = CrossbowSubExplosion2;</p>
	<p>   // Camera Shaking<br />
   shakeCamera = true;<br />
   camShakeFreq = &#8220;10.0 11.0 10.0&#8243;;<br />
   camShakeAmp = &#8220;1.0 1.0 1.0&#8243;;<br />
   camShakeDuration = 0.5;<br />
   camShakeRadius = 10.0;</p>
	<p>   // Exploding debris<br />
   debris = CrossbowExplosionDebris;<br />
   debrisThetaMin = 0;<br />
   debrisThetaMax = 60;<br />
   debrisPhiMin = 0;<br />
   debrisPhiMax = 360;<br />
   debrisNum = 6;<br />
   debrisNumVariance = 2;<br />
   debrisVelocity = 1;<br />
   debrisVelocityVariance = 0.5;</p>
	<p>   // Impulse<br />
   impulseRadius = 10;<br />
   impulseForce = 15;</p>
	<p>   // Dynamic light<br />
   lightStartRadius = 6;<br />
   lightEndRadius = 3;<br />
   lightStartColor = &#8220;0.5 0.5 0&#8243;;<br />
   lightEndColor = &#8220;0 0 0&#8243;;<br />
};</p>
	<p>datablock ExplosionData(CrossbowWaterExplosion)<br />
{<br />
   soundProfile = CrossbowExplosionSound;</p>
	<p>   // Volume particles<br />
   particleEmitter = CrossbowExplosionBubbleEmitter;<br />
   particleDensity = 375;<br />
   particleRadius = 2;</p>
	<p>   // Point emission<br />
   emitter[0] = CrossbowExplosionBubbleEmitter;<br />
   emitter[1] = CrossbowExplosionWaterSparkEmitter;</p>
	<p>   // Sub explosion objects<br />
   subExplosion[0] = CrossbowSubWaterExplosion1;<br />
   subExplosion[1] = CrossbowSubWaterExplosion2;</p>
	<p>   // Camera Shaking<br />
   shakeCamera = true;<br />
   camShakeFreq = &#8220;8.0 9.0 7.0&#8243;;<br />
   camShakeAmp = &#8220;3.0 3.0 3.0&#8243;;<br />
   camShakeDuration = 1.3;<br />
   camShakeRadius = 20.0;</p>
	<p>   // Exploding debris<br />
   debris = CrossbowExplosionDebris;<br />
   debrisThetaMin = 0;<br />
   debrisThetaMax = 60;<br />
   debrisPhiMin = 0;<br />
   debrisPhiMax = 360;<br />
   debrisNum = 6;<br />
   debrisNumVariance = 2;<br />
   debrisVelocity = 0.5;<br />
   debrisVelocityVariance = 0.2;</p>
	<p>   // Impulse<br />
   impulseRadius = 10;<br />
   impulseForce = 15;</p>
	<p>   // Dynamic light<br />
   lightStartRadius = 6;<br />
   lightEndRadius = 3;<br />
   lightStartColor = &#8220;0 0.5 0.5&#8243;;<br />
   lightEndColor = &#8220;0 0 0&#8243;;<br />
};</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Projectile Object</p>
	<p>datablock ProjectileData(CrossbowProjectile)<br />
{<br />
   projectileShapeName = &#8220;~/data/shapes/crossbow/projectile.dts&#8221;;<br />
   directDamage        = 20;<br />
   radiusDamage        = 20;<br />
   damageRadius        = 1.5;<br />
   explosion           = CrossbowExplosion;<br />
   waterExplosion      = CrossbowWaterExplosion;</p>
	<p>   particleEmitter     = CrossbowBoltEmitter;<br />
   particleWaterEmitter= CrossbowBoltBubbleEmitter;</p>
	<p>   splash              = CrossbowSplash;</p>
	<p>   muzzleVelocity      = 100;<br />
   velInheritFactor    = 0.3;</p>
	<p>   armingDelay         = 0;<br />
   lifetime            = 5000;<br />
   fadeDelay           = 5000;<br />
   bounceElasticity    = 0;<br />
   bounceFriction      = 0;<br />
   isBallistic         = false;<br />
   gravityMod = 0.80;</p>
	<p>   hasLight    = true;<br />
   lightRadius = 4;<br />
   lightColor  = &#8220;0.5 0.5 0.25&#8243;;</p>
	<p>   hasWaterLight     = true;<br />
   waterLightColor   = &#8220;0 0.5 0.5&#8243;;<br />
};</p>
	<p>function CrossbowProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)<br />
{<br />
   // Apply damage to the object all shape base objects<br />
   if (%col.getType() &#038; $TypeMasks::ShapeBaseObjectType)<br />
      %col.damage(%obj,%pos,%this.directDamage,&#8221;CrossbowBolt&#8221;);</p>
	<p>   // Radius damage is a support scripts defined in radiusDamage.cs<br />
   // Push the contact point away from the contact surface slightly<br />
   // along the contact normal to derive the explosion center. -dbs<br />
   radiusDamage<br />
     (%obj, VectorAdd(%pos, VectorScale(%normal, 0.01)),<br />
      %this.damageRadius,%this.radiusDamage,&#8221;Radius&#8221;,40);<br />
}</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Ammo Item</p>
	<p>datablock ItemData(CrossbowAmmo)<br />
{<br />
   // Mission editor category<br />
   category = &#8220;Ammo&#8221;;</p>
	<p>   // Add the Ammo namespace as a parent.  The ammo namespace provides<br />
   // common ammo related functions and hooks into the inventory system.<br />
   className = &#8220;Ammo&#8221;;</p>
	<p>   // Basic Item properties<br />
   shapeFile = &#8220;~/data/shapes/crossbow/ammo.dts&#8221;;<br />
   mass = 1;<br />
   elasticity = 0.2;<br />
   friction = 0.6;</p>
	<p>	// Dynamic properties defined by the scripts<br />
	pickUpName = &#8220;crossbow bolts&#8221;;<br />
   maxInventory = 20;<br />
};</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Weapon Item.  This is the item that exists in the world, i.e. when it&#8217;s<br />
// been dropped, thrown or is acting as re-spawnable item.  When the weapon<br />
// is mounted onto a shape, the CrossbowImage is used.</p>
	<p>datablock ItemData(Crossbow)<br />
{<br />
   // Mission editor category<br />
   category = &#8220;Weapon&#8221;;</p>
	<p>   // Hook into Item Weapon class hierarchy. The weapon namespace<br />
   // provides common weapon handling functions in addition to hooks<br />
   // into the inventory system.<br />
   className = &#8220;Weapon&#8221;;</p>
	<p>   // Basic Item properties<br />
   shapeFile = &#8220;~/data/shapes/crossbow/weapon.dts&#8221;;<br />
   mass = 1;<br />
   elasticity = 0.2;<br />
   friction = 0.6;<br />
   emap = true;</p>
	<p>	// Dynamic properties defined by the scripts<br />
	pickUpName = &#8220;a crossbow&#8221;;<br />
	image = CrossbowImage;<br />
};</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// Crossbow image which does all the work.  Images do not normally exist in<br />
// the world, they can only be mounted on ShapeBase objects.</p>
	<p>datablock ShapeBaseImageData(CrossbowImage)<br />
{<br />
   // Basic Item properties<br />
   shapeFile = &#8220;~/data/shapes/crossbow/weapon.dts&#8221;;<br />
   emap = true;</p>
	<p>   // Specify mount point &#038; offset for 3rd person, and eye offset<br />
   // for first person rendering.<br />
   mountPoint = 0;<br />
   eyeOffset = &#8220;0.1 0.4 -0.6&#8243;;</p>
	<p>   // When firing from a point offset from the eye, muzzle correction<br />
   // will adjust the muzzle vector to point to the eye LOS point.<br />
   // Since this weapon doesn&#8217;t actually fire from the muzzle point,<br />
   // we need to turn this off.<br />
   correctMuzzleVector = false;</p>
	<p>   // Add the WeaponImage namespace as a parent, WeaponImage namespace<br />
   // provides some hooks into the inventory system.<br />
   className = &#8220;WeaponImage&#8221;;</p>
	<p>   // Projectile &#038;&#038; Ammo.<br />
   item = Crossbow;<br />
   ammo = CrossbowAmmo;<br />
   projectile = CrossbowProjectile;<br />
   projectileType = Projectile;</p>
	<p>   // Images have a state system which controls how the animations<br />
   // are run, which sounds are played, script callbacks, etc. This<br />
   // state system is downloaded to the client so that clients can<br />
   // predict state changes and animate accordingly.  The following<br />
   // system supports basic ready->fire->reload transitions as<br />
   // well as a no-ammo->dryfire idle state.</p>
	<p>   // Initial start up state<br />
   stateName[0]                     = &#8220;Preactivate&#8221;;<br />
   stateTransitionOnLoaded[0]       = &#8220;Activate&#8221;;<br />
   stateTransitionOnNoAmmo[0]       = &#8220;NoAmmo&#8221;;</p>
	<p>   // Activating the gun.  Called when the weapon is first<br />
   // mounted and there is ammo.<br />
   stateName[1]                     = &#8220;Activate&#8221;;<br />
   stateTransitionOnTimeout[1]      = &#8220;Ready&#8221;;<br />
   stateTimeoutValue[1]             = 0.6;<br />
   stateSequence[1]                 = &#8220;Activate&#8221;;</p>
	<p>   // Ready to fire, just waiting for the trigger<br />
   stateName[2]                     = &#8220;Ready&#8221;;<br />
   stateTransitionOnNoAmmo[2]       = &#8220;NoAmmo&#8221;;<br />
   stateTransitionOnTriggerDown[2]  = &#8220;Fire&#8221;;</p>
	<p>   // Fire the weapon. Calls the fire script which does<br />
   // the actual work.<br />
   stateName[3]                     = &#8220;Fire&#8221;;<br />
   stateTransitionOnTimeout[3]      = &#8220;Reload&#8221;;<br />
   stateTimeoutValue[3]             = 0.2;<br />
   stateFire[3]                     = true;<br />
   stateRecoil[3]                   = LightRecoil;<br />
   stateAllowImageChange[3]         = false;<br />
   stateSequence[3]                 = &#8220;Fire&#8221;;<br />
   stateScript[3]                   = &#8220;onFire&#8221;;<br />
   stateSound[3]                    = CrossbowFireSound;</p>
	<p>   // Play the relead animation, and transition into<br />
   stateName[4]                     = &#8220;Reload&#8221;;<br />
   stateTransitionOnNoAmmo[4]       = &#8220;NoAmmo&#8221;;<br />
   stateTransitionOnTimeout[4]      = &#8220;Ready&#8221;;<br />
   stateTimeoutValue[4]             = 0.8;<br />
   stateAllowImageChange[4]         = false;<br />
   stateSequence[4]                 = &#8220;Reload&#8221;;<br />
   stateEjectShell[4]               = true;<br />
   stateSound[4]                    = CrossbowReloadSound;</p>
	<p>   // No ammo in the weapon, just idle until something<br />
   // shows up. Play the dry fire sound if the trigger is<br />
   // pulled.<br />
   stateName[5]                     = &#8220;NoAmmo&#8221;;<br />
   stateTransitionOnAmmo[5]         = &#8220;Reload&#8221;;<br />
   stateSequence[5]                 = &#8220;NoAmmo&#8221;;<br />
   stateTransitionOnTriggerDown[5]  = &#8220;DryFire&#8221;;</p>
	<p>   // No ammo dry fire<br />
   stateName[6]                     = &#8220;DryFire&#8221;;<br />
   stateTimeoutValue[6]             = 1.0;<br />
   stateTransitionOnTimeout[6]      = &#8220;NoAmmo&#8221;;<br />
   stateSound[6]                    = CrossbowFireEmptySound;<br />
};</p>
	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
	<p>function CrossbowImage::onFire(%this, %obj, %slot)<br />
{<br />
   %projectile = %this.projectile;</p>
	<p>   // Decrement inventory ammo. The image&#8217;s ammo state is update<br />
   // automatically by the ammo inventory hooks.<br />
   %obj.decInventory(%this.ammo,1);</p>
	<p>   // Determin initial projectile velocity based on the<br />
   // gun&#8217;s muzzle point and the object&#8217;s current velocity<br />
   %muzzleVector = %obj.getMuzzleVector(%slot);<br />
   %objectVelocity = %obj.getVelocity();<br />
   %muzzleVelocity = VectorAdd(<br />
      VectorScale(%muzzleVector, %projectile.muzzleVelocity),<br />
      VectorScale(%objectVelocity, %projectile.velInheritFactor));</p>
	<p>   // Create the projectile object<br />
   %p = new (%this.projectileType)() {<br />
      dataBlock        = %projectile;<br />
      initialVelocity  = %muzzleVelocity;<br />
      initialPosition  = %obj.getMuzzlePoint(%slot);<br />
      sourceObject     = %obj;<br />
      sourceSlot       = %slot;<br />
      client           = %obj.client;<br />
   };<br />
   MissionCleanup.add(%p);<br />
   return %p;<br />
}</p>
	<p>&#8230;smokes, was that long or what (pun intended)? Ok, my next tutorial will be how to make a simple character that will run, walk, jump, and even pee (naw, just kidding) in Torque! However it is July and I am ready for a much needed break from all and many things digital. Please chime in and add your comments. Let me know that these tutorials are not falling on deaf ears, so to speak.</p>
	<p>&#8230;sip&#8230;</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.jamestadeo.com/blog_games/?feed=rss2&amp;p=61</wfw:commentRSS>
	</item>
	</channel>
</rss>
