Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualSammieo

Posted 19 March 2013 - 05:57 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
}

 


#1Sammieo

Posted 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:

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:
 
Pawn:
[code]class CrowPawn 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

    /*Begin Object Name=WPawnSkeletalMeshComponent //Name=Boobooday
          SkeletalMesh=SkeletalMesh'BirdPackage.BooboodayPacked'
          AnimSets(0)=AnimSet'BirdPackage.Armature'
          Animations=MeshSequenceA
          AnimTreeTemplate=None
          Materials(0)=Material'EditorMaterials.WidgetMaterial_X'
          LightEnvironment=MyLightEnvironment
          Scale3D=(X=0.25,Y=0.25,Z=0.5)
          End Object
          //BirdMesh=Boobooday
          //Components.Add(Boobooday) */

    BirdWalkAnim = WalkOnLand
    BirdFlyAnim = FlapWings
}[/code]
 
Controller:
[code]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 );
  }
/*
*vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot)
*/
  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);
    /*
    `log(NewAccel);
    `log("You should see the AltAccel directly above this message!!");
    */

    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
}
*/

PARTNERS