Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualSammieo

Posted 14 March 2013 - 04:21 PM

Ratrace, thanks for the great help! I've imported the model I want over to UDK and I've set up the code in the MyPawn class so far, but I've ran into a strange error:
 

"Error, Type mismatch in Call to 'SetSkeletalMesh', parameter 1"

From my reading on the wiki and beyond, the only mandatory argument for SetSkeletalMesh is just one Skeletal mesh. I've gotten no complaints from the way I've set up BirdMesh and MeshSequenceA in Defaultproperties, so I feel like this is the one place the problem's coming from.

 

Here's the code in full, with (mostly) only the relevant parts left in.

 

 

class BirdPawn extends UTPawn;

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

var name BirdWalkAnim;

simulated function PostBeginPlay()
{
    super.PostBeginPlay();
    SetMeshVisibility(true);
    `log("The player birdpawn has spawned!");
}

function AttachMesh()
{
   CurrMesh = new(self) class'SkeletalMeshComponent';
   CurrMesh.SetSkeletalMesh(BirdMesh);  //This line causes the error!
   CurrMesh.SetLightEnvironment( MyLightEnvironment );

   AttachComponent(CurrMesh);
}

defaultproperties
{
    Begin Object Class=AnimNodeSequence Name=MeshSequenceA
    End Object

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

    Begin Object= Class=SkeletalMeshComponent Name=Boobooday
          SkeletalMesh=SkeletalMesh'BirdPackage.BooboodayPacked'
          AnimSets(0)=AnimSet'BirdPackage.Armature'
          Animations=MeshSequenceA
          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
}


 

I also tried setting this code up in the BirdActor class, but I encountered the same issues. I may have misunderstood something you were telling me, but I thought I'd define the mesh to be the main item and then pass that in as the Skeletal Mesh to set and attach to the pawn as a component.

I'm a little baffled myself, if I can say so. Can anyone offer any advice?


#2Sammieo

Posted 14 March 2013 - 03:04 PM

Ratrace, thanks for the great help! I've imported the model I want over to UDK and I've set up the code in the MyPawn class so far, but I've ran into a strange error:
 

"Error, Type mismatch in Call to 'SetSkeletalMesh', parameter 1"

From my reading on the wiki and beyond, the only mandatory argument for SetSkeletalMesh is just one Skeletal mesh. I've gotten no complaints from the way I've set up BirdMesh and MeshSequenceA in Defaultproperties, so I feel like this is the one place the problem's coming from.

 

Here's the code in full, with (mostly) only the relevant parts left in.

 

 

class CrowPawn extends UTPawn;

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

var name BirdWalkAnim;

simulated function PostBeginPlay()
{
    super.PostBeginPlay();
    SetMeshVisibility(true);
    `log("The player crow pawn has spawned!");
}

function AttachMesh()
{
   CurrMesh = new(self) class'SkeletalMeshComponent';
   CurrMesh.SetSkeletalMesh(BirdMesh);  //This line causes the error!
   CurrMesh.SetLightEnvironment( MyLightEnvironment );

   AttachComponent(CurrMesh);
}

defaultproperties
{
    Begin Object Class=AnimNodeSequence Name=MeshSequenceA
    End Object

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

    Begin Object= Class=SkeletalMeshComponent Name=Boobooday
          SkeletalMesh=SkeletalMesh'BirdPackage.BooboodayPacked'
          AnimSets(0)=AnimSet'BirdPackage.Armature'
          Animations=MeshSequenceA
          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
}


I also tried setting this code up in the CrowActor class, but I encountered the same issues. I may have misunderstood something you were telling me, but I thought I'd define the mesh to be the main item and then pass that in as the Skeletal Mesh to set and attach to the pawn as a component.

I'm a little baffled myself, if I can say so. Can anyone offer any advice?


#1Sammieo

Posted 14 March 2013 - 03:03 PM

Ratrace, thanks for the great help! I've imported the model I want over to UDK and I've set up the code in the MyPawn class so far, but I've ran into a strange error:
 

"Error, Type mismatch in Call to 'SetSkeletalMesh', parameter 1"

From my reading on the wiki and beyond, the only mandatory argument for SetSkeletalMesh is just one Skeletal mesh. I've gotten no complaints from the way I've set up BirdMesh and MeshSequenceA in Defaultproperties, so I feel like this is the one place the problem's coming from.

 

Here's the code in full, with (mostly) only the relevant parts left in.

 

class CrowPawn extends UTPawn;

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

var name BirdWalkAnim;

simulated function PostBeginPlay()
{
    super.PostBeginPlay();
    SetMeshVisibility(true);
    `log("The player crow pawn has spawned!");
}

function AttachMesh()
{
   CurrMesh = new(self) class'SkeletalMeshComponent';
   CurrMesh.SetSkeletalMesh(BirdMesh);  //This line causes the error!
   CurrMesh.SetLightEnvironment( MyLightEnvironment );

   AttachComponent(CurrMesh);
}

defaultproperties
{
    Begin Object Class=AnimNodeSequence Name=MeshSequenceA
    End Object

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

    Begin Object= Class=SkeletalMeshComponent Name=Boobooday
          SkeletalMesh=SkeletalMesh'BirdPackage.BooboodayPacked'
          AnimSets(0)=AnimSet'BirdPackage.Armature'
          Animations=MeshSequenceA
          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
}


I also tried setting this code up in the CrowActor class, but I encountered the same issues. I may have misunderstood something you were telling me, but I thought I'd define the mesh to be the main item and then pass that in as the Skeletal Mesh to set and attach to the pawn as a component.

Can anyone see my mistake?

PARTNERS