Developer Store
Support
Member Forums

Screenshots
FAQ
Documentation
License
Known Issues
Downloads

MMOWorkshop.com Store Opened!
Torque MMO Kit - Open Sourced!
Torque MMO Kit - 1.5.2 Port Alpha Test
Torque MMO Kit - OSX Status

GarageGames.com irc.prairiegames.com
#mmoworkshop

PyTorque
TGB Web Browser


Larson

hallsofvalhalla - After a long epiphany
Leathel - FoHO pre-Alpha 2.42
OldRod - More Musings on the MMO Industry
xapken - nice
J.C. Smith - 0.0.4.1 Build Notes
Wolf Dreamer - Pointless blog of pointless things
AthlonJedi2 - Server Nuked !!!!!
gamer_goof - New character model GIRL1 available only $4
... MORE BLOGS!

Lets talk skills.
Mob chase range?
Auction House + Internal Mail Sy...
Crafting Wiki
Every Day a new question... :)
Web Host
Seeking experienced programmer
Integrating Green-Ear SDK (paid)
where character information is s...
Spells Problem...

What is AFX

AFX Combo Kit

AFX is a product that is sold via Garagegames the makers of the Torque Engine. It allows for some really cool special effects with spells such as fire spinning around the caster, halo like objects on the ground that can be staionary or spin. It also allows for explosions and sounds to be added. For some examples check out this Youtube video for Foundations of Hope of an example of just some basic effects capable from these tools.

Foundations of Hope AFX Example 1

Hopefully I (Xerves) can find time to post up some videos in the future of examples of effects provided via this download since they will be slightly different that what is shown above and what is available in the demo provided with AFX (another great example if you have already downloaded it).

Requirements

You will need 2 things to get AFX up and running in your game.

1. The download I will provide. It has the Torque Script files you will need to use them in the game.
2. The media files provided in the AFX Combo package. You will need to have purchased AFX and Torque to get access to this. I am hoping this will satisfy the license requirement since I am releasing a bit of the script files to be integrated into the Kit. If not please contact Xerves about other options.

Script Download

Please get the following zip file to get started

AFXScripts.zip

Install

1. Unzip the contents of the zip file into starter.mmo/datablocks/spells. ***NOTE*** Please use whatever production folder you are using for your game instead of starter.mmo. It will be referenced for the rest of this document.

2. Open up init.c in the same folder and add the following for each cs file extracted from the zip file. You do not have to use all of the files if you do not want to. For completing the basic documentation provided please make sure flame_broil is included.

exec("./filename.cs");

3. Download the AFX combo package (as of this writing version 1.0.2) and install it to your hard drive. You will need to find the following directory inside the base directory where it installs.

example/arcane.fx/data/effects

4. Double click on Coretech and copy the contents to this following location in your kit. Once you do this you should half roughly 10 folders in the spells folder.

starter.mmo/data/spells

5. Go back to step 3 and copy the Spellpack1 folder's contents to the same location as step 4. This should be all of the effects and particles needed for any spell in the package.

6. That is all. We will move on next to using AFX in spells!

Usage

The zip file you downloaded will contain more detailed information about all of the spells converted and the available options. We are going to look at only flame_broil for the time being. If you have checked out the AFX demo it creates a ring of fire around the caster, shoots a fire ball, and explodes when it hits the target. Our spell will do the same thing once we add it to a simple spell. Follow these easy steps to add the affect to Arcane Blast as provided by an earlier tutorial.

1. Open up the wizard.py file at the following location (you can use any spell file you want, but this is following the earlier Tutorial)

starter.mmo/genesis/spell/wizard.py

2. Find the Arcane Blast Spell and add the following to the object.

spell.afxSpellEffectCasting ="FlameBroilCasting"  # Casting effect around the caster (the fire ring)
spell.projectile = "AFX_FlameBroilProj" # The fireball that chases the enemy
spell.afxSpellEffectBegin = "FlameBroilImpact" # The impact effect when the fireball hits the enemy!

3. There are 3 parts as mentioned above that can be possibly used. You do not need to use all 3 and you can use any of the 3 in any combination if you want. You could have a spell that you don't want a missle or impact effects and you just want the casting effect. You could want a spell without a missle. Etc.

4. That is it. Compile and test the game out. If everything is working out you should see a flame_broil.cs.dso file in the datablocks/spell directory and once the spell is cast all 3 effects happen. Please note that the enemy can resist the spell and if the projectile collides with a building or anything else that has a collision box (not other NPCs) that it will stop the spell from hitting the enemy. Our Flamebroil projectile is heat seaking, but it could hit an object and never reach our targer. Keep this in mind.

5. If all is well read the effects.txt file included with the torque script files (in your datablocks/spells folder) for all effects provided so far. More will be added to the zip file over time so it will be easier to update it there when it happens.

6. As a final note, you can use the impact parts of the effect on skills with spells (such as the lay on hands skill in the tutorial). This allows for some cool effects for skills too!

Getting the data into the online game

Everything works fairly well if you are testing offline and you aren't updating to your SVN yet. In order to get everything properly working I had to make a change to a packaging file.

Find the following file:

starter.mmo\packaging\content.py

Near the bottom you will see a Folders array. At the end of the array add the following

,"./starter.mmo/data/spells"

This should be within the ] ending the array. Once this is done I could successfully update and publish all the AFX files to the clients.

Moving Forward in the Future

I tried not to butcher these files too much so once the 1.5 port is out we will be able to make use of the advance lighting features. View the AFX demo to see the difference in the lighting with and without it (night and day in my opinion). It still looks great, but this will be a nice bonus. Currently the value is set to this in all of the AFX script files.

$AdvancedLighting = 0;

Once the new Lighting changes become available this can be toggled to 1 to turn on the feature *Hopefully*.

Modifications

If you wish to persue doing this yourself here is what is required so far to get this to run correctly.

1. Following value needs to be changed to what is shown below. This value needs to be changed to reflect the location of the spell path where the data files are at for AFX.

%mySpellDataPath = "~/data/spells".  

2. Some extra variables there that weren't specified that resulted in a compiler issue.

$AdvancedLighting = 0;

3. Everything including this datablock and below needed to be deleted. Contained extra code specified for the demo and not our game.

datablock afxRPGMagicSpellData

4. afxMagicSpellData datablock needed to be split into 3 parts. One for the casting effects, one for the projectile, one for the impact. All 3 should still be a afxMagicSpellData block, but they should be named differently.

5. The datablock used for projectiles needed a target = "enemy"; value specified.

6. Some of the casting effect blocks needed a castingTime specified or they would not run correctly.

7. launchNode needs to be updated to the most common nodes on your models (using standard fair listed in the docs for the kit).

8. constraint = "impacted"; specified for constraint = "impacted"; In some cases I had to replace impactedobject also.