PDA

View Full Version : Weapon custom fire animation HELPP



alvarofer0020
02-07-2010, 09:52 AM
hi i have a litle problem with a custom fire animation i have add to my weapon i have added the sockets add the animsets in the weapon code and add the fire animation name but when i shot it doesnt play my Custom fire animation it just work when i use the shock Rifle code so please help if any interesed here is my weapon code


class UTWeap_uzi extends UTWeap_uzi_base;




defaultproperties
{


Begin Object Name=FirstPersonMesh // First person settings
SkeletalMesh=SkeletalMesh'lascosasdeljuego.uzi'
AnimSets(0)=AnimSet'lascosasdeljuego.uzianimacione s'
End Object

Name="Default__UTWeap_assaultrifle"
ObjectArchetype=UTWeapon'UTGame.Default__UTWeapon'




Begin Object Name=PickupMesh
SkeletalMesh=SkeletalMesh'lascosasdeljuego.uzi'
End Object

AttachmentClass=class'UTAttachment_uzi'







WeaponRange=50



PickupSound=SoundCue'A_Pickups.Weapons.Cue.A_Picku p_Weapons_Link_Cue'

AmmoCount=120
LockerAmmoCount=20
MaxAmmoCount=120
MaxDesireability=0.7
AIRating=+0.3
CurrentRating=+0.3



FireInterval(0)=+0.10 // Done in Seconds (0.10 is 600 RPM)
FireInterval(1)=+0.10







GroupWeight=0.5

WeaponFireAnim(1)=WeaponAltFire

MuzzleFlashSocket=MF










PlayerViewOffset=(X=16.0,Y=-18,Z=-18.0)



{


here is UTAttachment_uzi


class UTAttachment_uzi extends UTWeaponAttachment;





defaultproperties
{
// Weapon SkeletalMesh
Begin Object Name=SkeletalMeshComponent0
SkeletalMesh=SkeletalMesh'lascosasdeljuego.uzi'

End Object






and here is UTWeap_uzi_base


class UTWeap_uzi_base extends UTWeapon
abstract;

alvarofer0020
02-07-2010, 01:26 PM
help pleaseeeeeeeee

geodav
02-07-2010, 01:31 PM
please use the code tags when posting code, you'll find it when you click the "Go Advanced" button.
if you used bone translation in your anims then you have to remove the tick from the Anim Rotaition Only box
http://img237.imageshack.us/img237/6503/aminrotationonly.jpg (http://img237.imageshack.us/i/aminrotationonly.jpg/)

alvarofer0020
02-07-2010, 01:58 PM
i have try that but it continue with out working

geodav
02-07-2010, 02:26 PM
class UTWeap_uzi extends UTWeap_uzi_base;


defaultproperties
{

Begin Object Name=FirstPersonMesh // First person settings
SkeletalMesh=SkeletalMesh'lascosasdeljuego.uzi'
AnimSets(0)=AnimSet'lascosasdeljuego.uzianimacione s'
End Object

Name="Default__UTWeap_assaultrifle"
ObjectArchetype=UTWeapon'UTGame.Default__UTWeapon'

Begin Object Name=PickupMesh
SkeletalMesh=SkeletalMesh'lascosasdeljuego.uzi'
End Object

AttachmentClass=class'UTAttachment_uzi'

WeaponRange=50

PickupSound=SoundCue'A_Pickups.Weapons.Cue.A_Picku p_Weapons_Link_Cue'

AmmoCount=120
LockerAmmoCount=20
MaxAmmoCount=120
MaxDesireability=0.7
AIRating=+0.3
CurrentRating=+0.3

FireInterval(0)=+0.10 // Done in Seconds (0.10 is 600 RPM)
FireInterval(1)=+0.10

GroupWeight=0.5

WeaponFireAnim(1)=WeaponAltFire

MuzzleFlashSocket=MF

PlayerViewOffset=(X=16.0,Y=-18,Z=-18.0)



}

take note of the very last bracket you have a { when it should be }

what anim names are you using, they must be the same as the original anims

alvarofer0020
02-07-2010, 03:01 PM
i have fix the code errores but it continue with out working and the anim names are the exact names

geodav
02-07-2010, 03:17 PM
what does your UTWeap_uzi_base.uc look like

alvarofer0020
02-07-2010, 03:36 PM
here is the UTWeap_uzi_base code


class UTWeap_uzi_base extends UTWeapon
abstract;

geodav
02-07-2010, 03:41 PM
try removing this line

WeaponFireAnim(1)=WeaponAltFire

alvarofer0020
02-07-2010, 05:35 PM
well it continue with out working but i dont know why my custom animations work when i just change the shock rifle models and animsets but how im going to sell my game i cant copy any UDK weapon code

danimal'
02-08-2010, 03:35 AM
Um, it works just fine if you do it right. Seriously, repost your code, both base and the other, with proper code tags, otherwise we really can't give meaningful feedback. Geodav should not be doing it for you (dude stop being so nice) :) I for instance see a space in your Animset name that shouldn't be there, but I have no way of knowing whether that's REALLY what your code looks like.

Custom weapon animations work just fine, see my signature for an example (albeit a bad example). Repost if you want help, otherwise we're shooting in the dark and having to try to interpret badly copied wall-of-code-text.

alvarofer0020
02-08-2010, 06:20 AM
ok i have alredy repost the code in the main topic with proper code tags and the same with utattachment_uzi and utweap_uzi_base so if you want go to the main topic and chek the code

Hitpawz
02-08-2010, 11:24 AM
You can use all the code in UDK, just not models, textures or sounds.

Zerav
02-08-2010, 11:58 AM
Hitpawz is correct.

alvarofer0020
02-08-2010, 12:46 PM
O_O thanksssssss

geodav
02-08-2010, 01:45 PM
ok looks better, are you still having problems, if you can use the shockrifle code thats great, it's what i've based most of my weapons on and see-ing as i can't code i'm doing well ;)

@danimal'
(dude stop being so nice) i'll try LOL

danimal'
02-08-2010, 08:59 PM
Good just reposting, it's still ugly but at least we can give feedback. If you can, try to clean it up in the future, those massive gaps seem unnecessary. Two things jump out at me.

- Why is this there: WeaponFireAnim(1)=WeaponAltFire, given the code you posted, it doesn't make any sense. That alone can be overriding whatever you defined up top as your animset, try commenting it out.

- Are you in 3rd or 1st person? I've begun to figure out an awful lot of headaches are being caused because people follow tuts that set them up in 3rd person and are creating animations appropriate for 1st person and defining them in 1st person.

Gjallerhorn
02-09-2010, 09:37 PM
I'm having a similar problem as the OP. My gun shows up in game and can fire, but will not play my animations. Not sure why, the names match up fine. I've also unchecked the Anim Rotation Only box, but that didn't help either.


class UTWeap_Gyro extends UTWeap_GyroBase;


defaultproperties
{
// Weapon SkeletalMesh
Begin Object class=AnimNodeSequence Name=MeshSequenceGyro
End Object

// Weapon SkeletalMesh
Begin Object Name=FirstPersonMesh
SkeletalMesh=SkeletalMesh'WP_Gyro.Mesh.WP_Gyro_1p'
AnimSets(0)=AnimSet'WP_Gyro.Anim.WP_Gyro_1P_Anim'
Animations=MeshSequenceGyro
Rotation=(Yaw=-16384)
FOV=60.0
End Object

AttachmentClass=class'MyGame.UTAttachment_Gyro'

Begin Object Name=PickupMesh
SkeletalMesh=SkeletalMesh'WP_Gyro.Mesh.WP_Gyro_3p'
End Object

InstantHitMomentum(0)=+60000.0

WeaponFireTypes(0)=EWFT_InstantHit

InstantHitDamage(0)=45
FireInterval(0)=+0.77

InstantHitDamageTypes(0)=class'UTDmgType_ShockPrim ary'

WeaponFireSnd[0]=SoundCue'A_Weapon_ShockRifle.Cue.A_Weapon_SR_Fire Cue'
WeaponEquipSnd=SoundCue'A_Weapon_ShockRifle.Cue.A_ Weapon_SR_RaiseCue'
WeaponPutDownSnd=SoundCue'A_Weapon_ShockRifle.Cue. A_Weapon_SR_LowerCue'
PickupSound=SoundCue'A_Pickups.Weapons.Cue.A_Picku p_Weapons_Shock_Cue'




ShotCost(0)=1

FireOffset=(X=20,Y=5)
PlayerViewOffset=(X=17,Y=10.0,Z=-8.0)

AmmoCount=20
LockerAmmoCount=20
MaxAmmoCount=40

//FireCameraAnim(1)=CameraAnim'Camera_FX.ShockRifle. C_WP_ShockRifle_Alt_Fire_Shake'

//WeaponFireAnim(1)=WeaponAltFire

MuzzleFlashSocket=MuzzleFlashSocket
//MuzzleFlashPSCTemplate=WP_ShockRifle.Particles.P_S hockRifle_MF_Alt
//MuzzleFlashAltPSCTemplate=WP_ShockRifle.Particles. P_ShockRifle_MF_Alt
MuzzleFlashColor=(R=200,G=120,B=255,A=255)
MuzzleFlashDuration=0.33
//MuzzleFlashLightClass=class'UTGame.UTShockMuzzleFl ashLight'
CrossHairCoordinates=(U=256,V=0,UL=64,VL=64)
LockerRotation=(Pitch=32768,Roll=16384)

//
IconCoordinates=(U=728,V=382,UL=162,VL=45)

QuickPickGroup=0
QuickPickWeight=0.9

WeaponColor=(R=160,G=0,B=255,A=255)

InventoryGroup=4
GroupWeight=0.5

IconX=400
IconY=129
IconWidth=22
IconHeight=48
//

Begin Object Class=ForceFeedbackWaveform Name=ForceFeedbackWaveformShooting1
Samples(0)=(LeftAmplitude=90,RightAmplitude=40,Lef tFunction=WF_Constant,RightFunction=WF_LinearDecre asing,Duration=0.1200)
End Object
WeaponFireWaveForm=ForceFeedbackWaveformShooting1
}


and yes, i know there's some lowercase p's in there. They match up to the file name, udk won't recognize the change in the editor for some reason.

alvarofer0020
02-10-2010, 06:14 AM
i think is becouse you had to put the weapon sockets

Gjallerhorn
02-10-2010, 10:49 AM
I figured it out. Did not realize how picky unreal is about the names of the actual animations. changing them to the default names allowed them to work.

Hitpawz
02-10-2010, 11:28 AM
If you check the .uc file that your weapon extends from, maybe check what that extends from too, eventually you'll find the code that calls those particular animation filenames.

@GJallerhorn, what's the "Animations=MeshSequenceGyro" for? Have you tried commenting that out and renaming the animations?

Just for reference, you should watch GeoDav's tutorials as they're invaluable, but here's the required naming convention for 1p weapon animations. It must match exactly and they must all be there:

WeaponFire
WeaponAltFire
WeaponFireInstiGib
WeaponIdle
WeaponEquip
WeaponPutDown

alvarofer0020
02-12-2010, 05:33 AM
i have naped my weapon fire animation as WeaponFire and it no work i have try change it to WeaponAltFire and it continue with out work

geodav
02-12-2010, 01:37 PM
all i can suggest now is to upload your code + content package + plus 3d app files (all in 1 rar file) and pm me the link so that i can have a look to see where the problem is

alvarofer0020
02-12-2010, 02:28 PM
ok in some minutes i send you the link geodav

Sahkan
01-31-2014, 03:39 PM
sorry for bumping such an old post but i have the exact same problem, did any one find a way to make it work ?