Jump to content

  • Log In with Google      Sign In   
  • Create Account

Sammieo

Member Since 17 Feb 2013
Offline Last Active May 08 2013 04:35 AM

Posts I've Made

In Topic: [Update 8pm GMT] UDK: Model's animations aren't playing!

20 March 2013 - 07:52 AM

Thanks for the clarity there. I tried both, and it didn't quite work out.


Ah well, no big bother. I'm gonna try one kismet video and hope that takes care of things. Fingers crossed!


In Topic: [Update 8pm GMT] UDK: Model's animations aren't playing!

19 March 2013 - 05:50 PM

Ah, I see! Silly me, I should have caught onto that earlier. Good news, I tried the name var instead and it got past the compiler without a bother.

 

...Bad news, it's still not working. >_< The lil' birdy is just hovering there, no matter what my anim calls say.

Ho-hum. Lemme show you the code one more time, since this is almost over:
 


class BirdPawn extends UTPawn;

var int IsoCamAngle;
var float CamOffsetDistance;

//var() SkeletalMeshComponent BirdMesh;
//var() SkeletalMeshComponent CurrMesh;

var name BirdWalkAnim;
var name BirdFlyAnim;

simulated function PostBeginPlay()
{
    super.PostBeginPlay();
    //AttachMesh();
    SetMeshVisibility(true);
    //PlayAnim( self.Boobooday_Packed_FlapWings, , True );
}

simulated function SetCharacterClassFromInfo(class<UTFamilyInfo> Info)
{
    //Ignoring family info
}

simulated function SetMeshVisiblity(bool bVisible)
{
    super.SetMeshVisibility(bVisible);
    Mesh.SetOwnerNoSee(false);
}

simulated function bool CalcCamera(float DeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV)
{
    local Vector HitLocation, HitNormal;

    out_CamLoc           = Location;
    out_CamLoc.X        -= Cos(Rotation.Yaw * UnrRotToRad) * Cos(IsoCamAngle * UnrRotToRad) * CamOffsetDistance;
    out_CamLoc.Y        -= Sin(Rotation.Yaw * UnrRotToRad) * Cos(IsoCamAngle * UnrRotToRad) * CamOffsetDistance;
    out_CamLoc.Z        -= Sin(IsoCamAngle * UnrRotToRad) * CamOffsetDistance;

    out_CamRot.Yaw       = Rotation.Yaw;
    out_CamRot.Pitch     = IsoCamAngle;
    out_CamRot.Roll      = 0;

    if (Trace(HitLocation, HitNormal, out_CamLoc, Location, false, vect(12, 12, 12)) != none)
    {
        out_CamLoc = HitLocation;
    }

    return true;
}

defaultproperties
{
    IsoCamAngle=20
    CamOffsetDistance=190.0
    MaxFallSpeed=30000

    Begin Object Class=AnimNodeSequence Name=MeshSequenceA
    End Object

    /*
    * Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
    *  bEnabled=TRUE
    *  End Object
    * Components.Add(MyLightEnvironment)
    */

    Begin Object Name=WPawnSkeletalMeshComponent
          SkeletalMesh=SkeletalMesh'BirdPackage.Boobooday_Packed'
          AnimSets(0)=AnimSet'BirdPackage.Armature'
          Animations=MeshSequenceA
          AnimTreeTemplate=None
          Translation=(Z=-20.0)
          Materials(0)=Material'EditorMaterials.WidgetMaterial_X'
          LightEnvironment=MyLightEnvironment
          Scale3D=(X=5.00,Y=5.00,Z=5.25)
    End Object

    BirdWalkAnim = WalkOnLand
    BirdFlyAnim = FlapWings
}
 
Controller:

class BirdPlayerController extends UTPlayerController;

var vector PlayerViewOffset;
var bool bHasFood;

simulated function PostBeginPlay()
{
  super.PostBeginPlay();
  bNoCrosshair = true;
  `log("The Bird player controller has finally spawned!");
  GoToState('Walking');

  Pawn.Mesh.SetHidden(false);
}

reliable client function ClientSetHUD(class<HUD> newHUDType)
{
  if(myHUD != none)
           myHUD.Destroy();

  myHUD = spawn(class'BirdHUD', self);
}

auto state Walking extends PlayerWalking
{
  simulated function BeginState(Name PreviousStateName)
  {
    Pawn.SetMovementPhysics();
    `log(GetStateName() );
    `log("Hello, the Bird is now walking!");
    Pawn.Mesh.PlayAnim( BirdPawn(Pawn).BirdWalkAnim, , True );
    //Pawn.Mesh.PlayAnim( BirdPawn(Pawn).Boobooday_Packed_WalkOnLand, , True );
  }
  function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot)
  {
    local vector X, Y, Z;
    //`log(NewAccel);

    GetAxes(Pawn.Rotation, X, Y, Z);
    NewAccel = PlayerInput.aForward * X + PlayerInput.aStrafe*Y;
    NewAccel.Y = 0;
    NewAccel = Pawn.AccelRate * Normal(NewAccel);

    super.ProcessMove(DeltaTime, X * VSize(NewAccel), DoubleClickMove, DeltaRot);
  }
}

state BirdFlying extends PlayerFlying
{
  simulated function BeginState(name PreviousStateName)
  {
    super.BeginState(PreviousStateName);
    Pawn.Mesh.PlayAnim( BirdPawn(Pawn).BirdFlyAnim, , True );
    `log("Now in Flying state!");
  }
}

defaultproperties
{
  bBehindView = true
  PlayerViewOffset = (X=256, Y = 0, Z = 0)
  bHasFood = true
}

 


In Topic: [Update 8pm GMT] UDK: Model's animations aren't playing!

19 March 2013 - 03:44 AM

EDIT: Collision cylinder is aligned just fine now: my problem was I wasn't using extreme enough units. Lowering the unreal units into the negatives did me just fine.

I've edited the scaling and the model's now at a size that I want it! Only one problem remains - playing animations.

As for the animations, I'm getting a really strange error with PlayAnim: I know my animation names and package names are correct, but with Unrealscript

Pawn.Mesh.PlayAnim( BirdPawn(Pawn).Boobooday_Packed_WalkOnLand, , True ); //causes an error

Just gives me the error:

Unrecognised member "Boobooday_Packed_WalkOnLand" in class "BirdPawn"

(If you're wondering why I'm saying Boobooday_Packed instead of BooboodayPacked, it's because that's my re-imported package.)

I'm not sure if there's some variable I'm meant to assign for the animation or what, since I don't have anything like that in the code; I still have that BirdWalkAnim name var lying around, but I'm not sure how to it - do you mean to just call that whenever I use PlayAnim?

All the other resources I've found on the topic seem to point me to Kismet, but with only two days to learn it in, I'd love it if Unrealscript could cover me.


In Topic: [Update 8pm GMT] UDK: Model's animations aren't playing!

16 March 2013 - 06:45 PM

Trying the second option gave an interesting and comically alarming result - I think it worked, but it's really small! This may be something I have to change in the unreal edior, but right now the model is a small dot so tiny I confused it for a crosshair at first! If I squint, I think animations are even playing, but it'd be easier to tell if it were in a larger size.

I ask since I'm uncertain where to go for this - Blender or Unreal Editor, I presume - or what tools I should use when I get there; are there any bright ideas out there on how to increase a model's size?


In Topic: [Update 8pm GMT] UDK: Model's animations aren't playing!

16 March 2013 - 04:46 AM

Thanks for the clarity.

I have an AnimSet, and truth be told my project isn't meant to be about animation or modelling, just tieing UDK together in a way as to create a functional game, so this is just to make thiings fit a 'narrative' of sorts that my mechanics have hopefully laid out. An AnimTree is something I'd like to do fundamentally, but truth be told I'd like to be able to focus on my other modules that I've long neglected (particularly with exams around the corner!), so I hope you'll forgive me if I try and make do without one. If I can get my lil' Boobooday model playing with two/three animations from the Armature set, I'll be stoked.

I've tried your method and, good news, the model has changed! Bad news, though, is that the model now hovers a few inches above the ground, and is still the same UTBot model, only with no animations. Something's clearly gone wrong along the way, as I'm supposed to be seeing a little bird right about now.
Hrghm, any ideas?


PARTNERS