PDA

View Full Version : weapons and emitters ?



legacy-The Fugative
07-05-2003, 03:35 AM
Hey all ! ... I've been working on a model of an M16A2 Assault Rifle and i'd like to try to get it working in-game.
I've followed the tutorial on Mr Evils website but i'm completely lost about how to go about making the weapon fire effects (like the muzzle flash). I was told that it had to be done with either an emitter or an XEmitter .. but .. how do i go about creating them ?

I take it i have to make a new emitter class for my weapon (i think) but can anyone point me in the right direction cos this is getting waaaaay confusing :weird:

Thanks

legacy-kentyman
02-05-2004, 11:09 AM
I know nothing of weapons, but I recon you have to create your own extension of the 'Emitter' class or the 'xEmitter' class. Simply do this with this code:

class CoolNewEmitterEffect extends Emitter;

defaultproperties
{
texture = thisandthattexture
these are the settings for your cool new effect
more settings
etc
}


The next time you spawn a new object of the class 'CoolNewEmitterEffect' it will have all your settings you defined in the defaultproperties.
I'm not sure but I think you can copy/paste all the emitter variable values out of unrealED straight into a text file...

legacy-Morphias
02-05-2004, 02:58 PM
Just another quick tip, make sure your weapon has bones, as you will need to attatch the emitters to these bones. makes it far easier then using vector offests, and the emitter follows the guns movement, without any extra coding.

I know all weapon meshes have a bone call 'tip' which is the end of the barrel. this is the code out of the ShockAttatcment:



simulated event ThirdPersonEffects()
{
local rotator r;

if ( Level.NetMode != NM_DedicatedServer && FlashCount > 0 )
{
if ( FiringMode == 0 )
WeaponLight();
else
{
if (MuzFlash == None)
{
MuzFlash = Spawn(MuzFlashClass);
AttachToBone(MuzFlash, 'tip');
}
if (MuzFlash != None)
{
MuzFlash.mStartParticles++;
r.Roll = Rand(65536);
SetBoneRotation('Bone_Flash', r, 0, 1.f);
}
}
}

Super.ThirdPersonEffects();
}


See how this code attaches the emitter to the bone called 'tip'.

Looks like you will need a lot of work done, but it should be fun.