attach particle effect to weapon animation

Modelling, Textures, Animating and other general engine asset topics.

attach particle effect to weapon animation

Postby casf01 on Mon Nov 29, 2010 8:59 pm

Hi,
This is my first post here so... Hi everyone!

I've been working on some particle system that are triggered when when firing

My particle is done and work correctly in-game however, i've been unable to make it appear at the right place when they play. The particle seems to start at the center of the player (I can see them if I move back)

i'm using this command in my .QC file to trigger the particle
{ event AE_CL_CREATE_PARTICLE_EFFECT 5 "xxx follow_attachment muzzle" }

the particle should start and at the muzzle attachment ( i've declared the attachment )but in fact it start in the player.

Do I need to turn on some option or add some operator in the particle editor?
casf01
Dumpling
Dumpling
 
Joined: Mon Nov 29, 2010 8:52 pm

Re: attach particle effect to weapon animation

Postby casf01 on Mon Nov 29, 2010 9:12 pm

ok i've managed to make the particle follow the player but they wont follow the head rotation ( if I move the mouse)
casf01
Dumpling
Dumpling
 
Joined: Mon Nov 29, 2010 8:52 pm

Re: attach particle effect to weapon animation

Postby Jangalomph on Mon Nov 29, 2010 11:08 pm

Here is basically what a guy told me on how to do a muzzle flash a while back.


GuNsHiP_MK_II
GuNsHiP_MK_II Nov 3 2010, 12:50pm says:

Sure i will help :D

Yeah i have a lot of problems with this muzzles too, when i start modding OB Engine.

Ok, you have 2 ways :

First one, Edit you .QC file of you model.

EXAMPLE USING AR2 WEAPON MODEL :
Code: Select all
/*
==============================================================================

IRifle

==============================================================================
*/

$modelname weapons/v_IRifle.mdl
$cdmaterials models\Weapons\V_hand models\Weapons\V_irifle

// whole body
$body studio "IRifle_reference.smd"

$origin 0 0 67

//Muzzle flash
$attachment "muzzle" "Base" 0 0 20 rotate -90

$poseparameter "VentPoses" 0 1


// OLD MUZZLES - CONTROLLED BY ENGINE PARTICLES - DELETE ( COMMENT )

$sequence IR_idle "Idle" loop fps 30 activity ACT_VM_IDLE 1 node Ready
//$sequence IR_fire "Fire01" fps 30 snap activity ACT_VM_PRIMARYATTACK 1 { event AE_MUZZLEFLASH 0 "COMBINE MUZZLE" } node Fire
//$sequence fire2 "Fire02" snap fps 30 activity ACT_VM_RECOIL1 1 { event AE_MUZZLEFLASH 0 "COMBINE MUZZLE" } node Fire
//$sequence fire3 "Fire03" snap fps 30 activity ACT_VM_RECOIL2 1 { event AE_MUZZLEFLASH 0 "COMBINE MUZZLE" } node Fire
//$sequence fire4 "Fire04" snap fps 30 activity ACT_VM_RECOIL3 1 { event AE_MUZZLEFLASH 0 "COMBINE MUZZLE" } node Fire
//$sequence IR_fire2 "Alt_fire" fps 30 snap activity ACT_VM_SECONDARYATTACK 1 { event AE_MUZZLEFLASH 0 "COMBINE MUZZLE" }


// NEW MUZZLES USING OB PARTICLE SYSTEM


// How it works? - We changing old "event AE_MUZZLEFLASH" to new OB Thing "event AE_CL_CREATE_PARTICLE_EFFECT"
// "muzzle_ar2" - The Name Of Muzzle ( NOT .pcf file! the name of particle inside .pcf file )
// "follow_attachment" - moving to bone
// "muzzle" - bone name, where particle dispatching


$sequence IR_fire "Fire01" fps 30 snap activity ACT_VM_PRIMARYATTACK 1 node Fire { event AE_CL_CREATE_PARTICLE_EFFECT 0 "muzzle_ar2 follow_attachment muzzle" }
$sequence fire2 "Fire02" snap fps 30 activity ACT_VM_RECOIL1 1 node Fire { event AE_CL_CREATE_PARTICLE_EFFECT 0 "muzzle_ar2 follow_attachment muzzle" }
$sequence fire3 "Fire03" snap fps 30 activity ACT_VM_RECOIL2 1 node Fire { event AE_CL_CREATE_PARTICLE_EFFECT 0 "muzzle_ar2 follow_attachment muzzle" }
$sequence fire4 "Fire04" snap fps 30 activity ACT_VM_RECOIL3 1 node Fire { event AE_CL_CREATE_PARTICLE_EFFECT 0 "muzzle_ar2 follow_attachment muzzle" }
$sequence IR_fire2 "Alt_fire" fps 30 snap activity ACT_VM_SECONDARYATTACK 1 node Fire { event AE_CL_CREATE_PARTICLE_EFFECT 0 "muzzle_ar2 follow_attachment muzzle" }

// TEH END OF NEW CODE

$sequence IR_reload "Reload" fps 30 activity ACT_VM_RELOAD 1 node Ready {
{ event AE_CL_PLAYSOUND 1 "Weapon_AR2.Reload_Rotate" }
{ event AE_CL_PLAYSOUND 19 "Weapon_AR2.Reload_Push" }
}

$sequence IR_draw "Draw" fps 30 snap activity ACT_VM_DRAW 1 node Ready
$sequence IR_holster "Holster" fps 30 activity ACT_VM_HOLSTER 1 node Ready
$sequence idletolow "idle_to_low" fps 30 activity ACT_VM_LOWERED_TO_IDLE 1  transition Ready Low
$sequence lowtoidle "Low_to_idle" fps 30 activity ACT_VM_IDLE_TO_LOWERED 1 transition Low Ready
$sequence lowidle "Low_idle" fps 30 loop activity ACT_VM_IDLE_LOWERED 1 node Low
$sequence shake "Shake" fps 30 loop activity ACT_VM_FIDGET 1 node Fire

$animation a_vent_neutral "Vent_Poses" frame 0 0
$animation a_vent_open "Vent_Poses" frame 0 0 subtract a_vent_neutral 0
$animation a_vent_closed "Vent_Poses" frame 1 1 subtract a_vent_neutral 0
$sequence VentPoses a_vent_open a_vent_closed blend "VentPoses" 1 0 delta autoplay


And Second one is coding ( in you weapon .cpp file )

Here example :
Code: Select all
cpp code:
CBaseViewModel *vm = pPlayer->GetViewModel();
        DispatchParticleEffect("weapon_muzzle_flash_shotgun", PATTACH_POINT_FOLLOW, vm, vm->LookupAttachment( "muzzle" ),true);


But you still need to edit you .QC file, or old muzzle effect will dispatching too.

SO, i recommend to you use first way.
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Return to Art Creation

Who is online

Users browsing this forum: No registered users