Announcement

Collapse
No announcement yet.

Tutorial: Creating custom AnimNodes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    You are right. If MyAnimBlendByWeaponType compile before my weapons classes - there no errors, to achieve these i just rename MyGame_LaserRifle to MyGame_PlasmaRafle. But there must to be another way. I not sure what to do with dependsOn(MyWeaponType), when I implement it into MyAnimBlendByWeaponType i receive error.

    Thank you in advance

    Leave a comment:


  • replied
    Really stuck with this, any help would be appreciated.

    Leave a comment:


  • replied
    I guess there something need to be done with MyAnimBlendByWeaponType:

    class MyAnimBlendByWeaponType extends UTAnimBlendBase;

    enum MyWeaponType
    {
    MWT_Pistol,
    MWT_Shotgun,
    MWT_RocketLauncher,
    MWT_LaserRifle
    };

    simulated function SetWeaponAnimType(MyWeaponType weapAnimType)
    {
    SetActiveChild(weapAnimType, BlendTime);
    }

    DefaultProperties
    {
    Children(0)=(Name="Pistol")
    Children(1)=(Name="Shotgun")
    Children(2)=(Name="RocketLauncher")
    Children(3)=(Name="LaserRifle")
    bFixNumChildren=True
    }

    Leave a comment:


  • replied
    Here is may attachment classes (ShotgunAttachment work fine, LaserRifleAttachment compile with error)

    class MyGame_ShotgunAttachment extends UTWeaponAttachment;

    var ParticleSystem BeamTemplate;
    var class<UDKExplosionLight> ImpactLightClass;
    var int CurrentPath;
    var MyWeaponType WeaponAnimType;
    var AnimSet PawnAnimSet;
    var name PawnAnim;

    simulated function ThirdPersonFireEffects(vector HitLocation)
    {
    local MyGame_PlayerPawn P;
    P = MyGame_PlayerPawn(Instigator);

    Super.ThirdPersonFireEffects(HitLocation);

    P.TopHalfAnimSlot.PlayCustomAnim(PawnAnim, 1.0, 0.2, 0.2, FALSE, TRUE);

    }

    simulated function AttachTo(UTPawn OwnerPawn)
    {
    local MyGame_PlayerPawn AnimPawn;

    super.AttachTo(OwnerPawn);

    AnimPawn= MyGame_PlayerPawn(OwnerPawn);
    if (AnimPawn != none)
    {
    AnimPawn.SetWeaponAnimType(WeaponAnimType);
    }
    }


    simulated function bool AllowImpactEffects(Actor HitActor, vector HitLocation, vector HitNormal)

    {

    return (HitActor != None && UTProj_ShockBall(HitActor) == None && Super.AllowImpactEffects(HitActor, HitLocation, HitNormal));

    }

    simulated function SetMuzzleFlashParams(ParticleSystemComponent PSC)

    {

    local float PathValues[3];

    local int NewPath;

    Super.SetMuzzleFlashparams(PSC);

    if (Instigator.FiringMode == 0)

    {

    NewPath = Rand(3);

    if (NewPath == CurrentPath)

    {

    NewPath++;

    }

    CurrentPath = NewPath % 3;

    PathValues[CurrentPath % 3] = 1.0;

    PSC.SetFloatParameter('Path1',PathValues[0]);

    PSC.SetFloatParameter('Path2',PathValues[1]);

    PSC.SetFloatParameter('Path3',PathValues[2]);

    // CurrentPath++;

    }

    else if (Instigator.FiringMode == 3)

    {

    PSC.SetFloatParameter('Path1',1.0);

    PSC.SetFloatParameter('Path2',1.0);

    PSC.SetFloatParameter('Path3',1.0);

    }

    else

    {

    PSC.SetFloatParameter('Path1',0.0);

    PSC.SetFloatParameter('Path2',0.0);

    PSC.SetFloatParameter('Path3',0.0);

    }


    }

    defaultproperties

    {

    // Weapon SkeletalMesh

    Begin Object Name=SkeletalMeshComponent0

    SkeletalMesh=SkeletalMesh'MyGameContent.Weapons.Sh otgun'

    End Object

    MuzzleFlashSocket=MuzzleFlashSocket

    MuzzleFlashPSCTemplate(0)=ParticleSystem'WP_LinkGu n.Effects.P_FX_LinkGun_MF_Primary'



    MuzzleFlashColor=(R=255,G=120,B=255,A=255)

    MuzzleFlashDuration=.33;

    MuzzleFlashLightClass=class'UTGame.UTShockMuzzleFl ashLight'

    bMuzzleFlashPSCLoops=true

    WeaponClass=class'MyGame_Shotgun'

    ImpactLightClass=class'UTShockImpactLight'

    WeaponAnimType=MWT_Shotgun

    PawnAnimSet=AnimSet'MyGameContent.Animations.Pawn_ Anim'
    PawnAnim=Pawn_Shotgun_shot

    }



    For MyGame_LaserRifleAttachment the difference is:

    WeaponClass=class'MyGame_LaserRifle'
    WeaponAnimType=MWT_LaserRifle

    Everything else same.

    Leave a comment:


  • replied
    Thank you for answer, i appreciate the help. Have error "Failed to find DependsOn/Implements class 'MyWeaponType' while parsing 'MyGame_MyAnimBlendByWeaponType' "

    Problem is when i use script with only 3 weapon that i implement in it before (pistol, shotgun, rocketlauncher) everything work fine, but when i want to add another weapon - LaserRifle (first 3 weapon i add with success), attachment class and LaseRrifle class same as pistol, shotgun, even skeletal mesh same, i have a error Mygame_LaserRifleAttachment: Unrecognized type 'MyWeaponType'.

    Sorry for my bad English.
    Thank you in advance

    Leave a comment:


  • replied
    MyAnimBlendByWeaponType needs to know about MyWeaponType at compile time. for this to happen you need to make sure MyWeaponType is compiled before MyAnimBlendByWeaponType. and for this you need to use the dependsOn keyword. like this,
    Code:
    class MyAnimBlendByWeaponType extends UTAnimBlendBase
    dependsOn(MyWeaponType);
    //rest of code

    Leave a comment:


  • replied
    The same error when only Bow2 weapon class (and attachment class) exist.

    Leave a comment:


  • replied
    Hi, I follow this tutorial and it is work for me. But when i try to add one more weapon type (let's say bow2) i've got a error Mygame_Bow2Attachment: Unrecognized type 'MyWeaponType'.
    For example:
    class MyAnimBlendByWeaponType extends UTAnimBlendBase;

    enum MyWeaponType
    {
    MWT_Sword,
    MWT_Gun,
    MWT_Bow,
    MWT_Bow2
    };

    simulated function SetWeaponAnimType(MyWeaponType weapAnimType)
    {
    SetActiveChild(weapAnimType, BlendTime);
    }

    DefaultProperties
    {
    Children(0)=(Name="Sword")
    Children(1)=(Name="Gun")
    Children(2)=(Name="Bow")
    Children(3)=(Name="Bow2")
    bFixNumChildren=True
    }




    Attachment class same as for (gun, bow and sword)

    DefaultProperties
    {
    WeaponAnimType=MWT_Bow2
    }


    Thank you in advance

    Leave a comment:


  • replied
    I am using his custom animnode...It works perfectly until I try to rotate and then the animation goes to Rif...also I have the jump problem

    Leave a comment:


  • replied
    Originally posted by Kelt'ar View Post
    bUMP! And the jump animation doesnt work...the char plays the run anim when falling.
    Unless this has to do with immortius' sample code for a custom AnimNode you should make your own thread over on the Characters and Animation forum. When you do, make sure to include a screenshot of the anim tree.

    /off topic. Thanks immortius

    Leave a comment:


  • replied
    bUMP! And the jump animation doesnt work...the char plays the run anim when falling.

    Leave a comment:


  • replied
    For some reason, My Idle animation for one of my weapons is not working...The character plays the rifle animation instead:

    See pic:


    Uploaded with ImageShack.us

    THe one on the left is the Idle and the right is when the character is moving

    Ideas anyone?

    Leave a comment:


  • replied
    THis is beautiful! This $#!+ works!!!

    Leave a comment:


  • replied
    immortius can u help; I want to have multiple Animation sets how do i set weapons to use specific animsets?

    Leave a comment:


  • replied
    Ah!!!!! So that why it was not working!! Thanks a lot!! now I can see it : )

    Leave a comment:

Working...
X