Game Development Community

dev|Pro Game Development Curriculum

afxWeapon

by Michael Perry · 06/20/2007 (8:42 am) · 62 comments

First, I must thank the following and give credit where credit is due:


Big thanks to Jeff for all his help. Without his guidance and instruction on using Arcane FX, particularly effectrons, this would have taken a lot longer.

Big thanks to Ed Johnson for helping me brush up on Maya and exporting.

Credit for the broadsword model goes to Tridinaut's Medieval Weapons Pack, which is worth so much more than what I payed =). Everyone should also thank Tridinaut for allowing me to supply the modified broadsword dts file for this resource.

Assets and general design for fire sword effect are derived from the Great Ball of Fire Spell, provided in the Arcane FX demo.


The following tech is recommended for this resource:
  • TGE 1.5 - I'm working with 1.5.2[li]Arcane.FX - 1.5.2[li]3D Modeling Suite - I used Maya[li]Exporter - maya2Dts 7.0 used[li]Compiler - I used Visual Studio 2K5[li]Script Editor - Torsion ftw
The following topics ARE NOT covered in this resource:
  • Combat resolution[li]Dual Wielding[li]Comprehensive AFX Design[li]AFX Creator Details[li]Weapon Crafter Details
On that note, I present the afxWeapon system!

While developing Weapon Crafter and AFX Creator (in house Zombie Shortbus tools for creating AFX effects and melee weapons, that requires no scripting), I found I had put the cart before the horse. A weapon creation tool is worthless if no weapon system is in place. Since our project is built on TGE/AFX 1.5.2, I decided that our melee system should also be tied into the AFX classes.

Based on Jeff's advice and the AFX documentation, I built a custom class off of effectrons containing typical RPG data for stats, weapons, and damage. Let's get started:

Step 1: Download the files: afxWeaponResource.rar

Step 2: Back up original files:
  • enginegameplayer.h[li]enginegameplayer.cc
Step 3: Copy new files:
  • Replace enginegameplayer.h and player.cc with the ones in the .rar archive[li]Copy afxWeapon.h and afxWeapon.cc into the engineafx directory[li]Copy afxWeapons.cs into examplearcane.fxserverscripts[li]Create a folder named "weapons" in the examplearcane.fxdatashapes[li]Copy the broadsword_maya.dts and broadsword.jpg into the new weapons directory
Step 4: Building:
  • Add afxWeapon.h and afxWeapon.cc to your project/solution[li]Recompile your debug and release builds
Step 5: Script Implementations:
  • In examplearcane.fxserverscriptsgame.cs, place the following code:
  • [b]// In function onServerCreated(), below exec("./aiPlayer.cs")[/b]
    exec("./afxWeapons.cs");
  • Launch a mission, open the World Editor (F11), and drop in the new broadSword item. Make sure you enable collision and make the object non-static.[li]Take control of your OrcMagePlayer and run into your new Fire Sword
If you followed the steps properly (and if I didn't make any errors (= ), you should see a quick set of effects I set up for a Fire Sword.

To keep this resource clean, I will be happy to answer detailed steps and questions in the comments section, and you can see the evolution of this resource in this thread: AFX Weapon?

Click here to see a larger screenshot

A word on expanding on this resource:

Earlier, I mentioned what is not covered in this resource, but that doesn't mean those features are not possible with this system. If you want a classic RPG or WoW combat system, you now have everything you need, and can do so from script. Coooool! How do I know? Because I've already created said systems in my scripts =).

Good luck, have fun, and submit bug reports when you find them!

*Note - Restored links to files.
#41
04/11/2009 (2:53 am)
Hey Michael,

I have been searching for a melee system for ages and one that would work with AFX.

So I saw this and implemented it...but to my dissapointment I got it working and and said to myself...

"oh...i don't hink this is a melee combat system"

So i am just wondering, you said at the end of this that you have used this to then further make a melee system for TGE in AFX Demo...is there any chance of you releasing code for it :D coz i can't find any half-decent melee resources ANYWHERE

From Max
#42
06/13/2009 (9:48 am)
Unfortunately all my resources have gone down since the site hosting the files has a dead subscription. I'm still trying to find local copies of everything.

@ALL - PLEASE! If you have a copy of this resource, can you host it for me or e-mail me the files so I can get these back online. I would be very appreciative!
#43
07/09/2009 (6:09 am)
Still nothing on the resource files? Man, that's a bummer!
#44
07/09/2009 (6:20 am)
I sent me him the original resource files a while back.
#45
10/20/2009 (3:12 pm)
I hate to revive an old thread but curious if anyone has this resource around for me to download. I am looking for something like this and would love to look over this code.
#46
01/06/2010 (12:47 pm)
any chance on getting the .rar link updated for this?
#47
02/27/2010 (6:28 pm)
Anyone have a copy of this file still laying about? I would like a look over the final code.
#48
05/11/2010 (12:32 am)
I have this which I downloaded 21 July 2008.
I hope its the one in question, after all the pack name is similar.
#49
08/24/2010 (2:46 pm)
Hi Micheal, I can't seem to download the afxWeaponResource.rar file is it available elsewhere?

Thanks
#51
08/24/2010 (4:31 pm)
Much Thanks Sean! This'll really help


#52
04/09/2014 (5:58 am)
Ohh man are all those links are dead... I would have loved to look this resource through... Damn... :O(
#53
04/09/2014 (6:17 am)
Links are dead, but the devs are not :) give me a bit and I will get these to a new location for you.
#54
04/09/2014 (6:19 am)
Here is the resource abighole.hngamers.com/1lt21
#55
04/09/2014 (6:45 am)
Awesome! Thanks! :O)

#56
04/09/2014 (6:57 am)
How to tell if you wrote a good resource.
#57
06/21/2015 (7:02 pm)
Update to our file site caused the previous links to fail. Here is the link to the updated file.
files.hngamers.com/abighole/code/afxWeaponResource.rar
#58
06/23/2015 (9:06 am)
Whoa....are people still using this?
#59
06/23/2015 (9:36 am)
Oddly enough...yes!
#60
06/23/2015 (9:40 am)
Lol, yeah I actually just converted it to the latest version of AFX for Torque 3.6.3. I am down to a few errors related to a circular reference I cannot seem to find.