i used the attach function to attach the sword to the dwarf. but the particles were done with this code:

//junk n stuff
define hilt,skill1;
define tip,skill2;

var chop_off;
var end_vec[3];
var start_vec[3];
var part_angle[3];
var line_length;



//fades the particle
function fire_update()
{
my.alpha -= 3 * time;
if (my.alpha<=0) {my.lifespan=0;return;}
}

//the controls the actual particle
function fire_burn()
{
my.x += random(3) + -2;
my.y += random(3) + -2;
my.z += random(3) + -1;
my.size = 8;
my.vel_x = (random(0.4) - 0.2) * 3;
my.vel_y = (random(0.4) - 0.2) * 3;
my.vel_z = (random(0.4) - 0.2) * 3;
my.move = on;
my.bmap = fire_part;
my.flare = on;
my.bright = on;
my.alpha = random(10)+5;
my.function = fire_update;
}

//the code that creates the halo
function fire_halo(strength)
{
weapon.bright = on;
weapon.ambient = 100;
weapon.albedo = 100;
vec_for_vertex(end_vec,weapon,weapon.hilt);
vec_for_vertex(start_vec,weapon,weapon.tip);
line_length = vec_dist(end_vec.x,start_vec.x);
vec_diff(part_angle,end_vec.x,start_vec.x);
chop_off = line_length/2;
vec_normalize(part_angle,2);
while(chop_off > 0)
{
effect(fire_burn,strength,start_vec,start_vec);
weapon.lightred = 200;
weapon.lightgreen = 128;
weapon.lightblue = 0;
weapon.lightrange = 100;
vec_add(start_vec.x,part_angle.x);
chop_off -=1;
wait(1);
}
}

//uses hilt,tip
action weapon_av
{
my.tip = 16;
my.hilt = 211;
weapon = me;
while(1)
{
fire_halo(1);
wait(1);
}
}

Ok the weapon_av action is the action I use on the sword. The "my.tip" skill is the vertex of the tip of the sword and the "my.hilt" is the base vertex of the blade. Set it custom to your model. In "fire_halo(1)" the "1" is the strength of the particles, or how many are created every tick or whatever, set it to 100 and blow up your computer!

The trails is just a special action that I made that when the player attacks a transparent model is created every tick (or whatever) and it waits like 4 ticks (or whatever) and remove itself. BTW I've never had any trouble with fps.

I really was planning on sharing this with everyone because of you Star Wars gurus out there. It can be modified to create a cool lightsaber effect.


Making dreams come true... And being erroneously accused of software piracy by Conitec in the process.