Results 1 to 4 of 4
  1. #1

    Default Pawn Subclass is spawning Mesh on top of Parent Class's Mesh

    This is probably a silly scripting error but here it goes. I have a class called ScientistClass. It spawns a scientist. I also have a subclass of ScientistClass called ScientistDesk. This should spawn a scientist sitting at a desk. Instead it spawns a scientist sitting at a desk, which sits on top of a scientist. Basically it calls both mesh's, animations and all, instead of modifying ScientistClass into ScientistDesk. My first guess is the SMesh variable, because I don't really understand it and I just modified it into SMeshDesk. I didn't write all of this because I'm not that good but I'm tasked with troubleshooting it. Thanks in advance for any help.

    This is the ScientistClass

    class ScientistClass extends Pawn
    placeable;
    var DynamicLightEnvironmentComponent LightEnvironment;

    DefaultProperties
    {
    Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
    bSynthesizeSHLight=TRUE
    bIsCharacterLightEnvironment=TRUE
    bUseBooleanEnvironmentShadowing=FALSE
    End Object
    Components.Add(MyLightEnvironment)
    LightEnvironment=MyLightEnvironment

    Begin Object class=SkeletalMeshComponent Name=SMesh
    SkeletalMesh=SkeletalMesh'Scientist.SkeletalMesh.S cientist_Mesh'
    AnimTreeTemplate=AnimTree'Scientist.Scientist_Tree '
    AnimSets(0)=AnimSet'Scientist.Scientist_Idles'
    bAcceptsLights=true
    Translation=(Z=-58);
    LightEnvironment=MyLightEnvironment

    CastShadow=true
    CollideActors=true;

    End Object
    Mesh=SMesh
    Components.Add(SMesh)
    groundspeed=150
    DrawScale=1.4
    }


    And this is the ScientistDesk

    class ScientistDesk extends ScientistClass
    placeable;

    DefaultProperties
    {
    Begin Object class=SkeletalMeshComponent Name=SMeshDesk
    SkeletalMesh=SkeletalMesh'Scientist.SkeletalMesh.S cientistDesk_Mesh'
    AnimTreeTemplate=AnimTree'Scientist.ScientistDesk_ AnmTree'
    AnimSets(0)=AnimSet'Scientist.ScientistDesk_AnmSet '
    LightEnvironment=MyLightEnvironment1
    End Object
    Mesh=SMeshDesk
    Components.Add(SMeshDesk)
    DrawScale=1.4
    }

  2. #2
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    51

    Default

    Since your ScientistDesk subclass uses a different object class name (SMeshDesk) than the one in ScientistClass (SMesh), there's no way for UDK to know that it has to replace the base object class. Perhaps changing the object class name from SMeshDesk to SMesh will fix the problem. But maybe it's a better idea to not declare any meshes or animations in ScientistClass. How about making an additional subclass (ScientistStanding perhaps?) and place your SMesh object class in there, similar to what you did for the object class in ScientistDesk. That way, you don't have to worry about either subclass inheriting unwanted meshes or animation.

  3. #3
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    424

    Default

    "Begin Object class=SkeletalMeshComponent Name=SMeshDesk"

    "Begin Object class=SkeletalMeshComponent Name=SMesh"

    You basically having two meshes.

    What you should do is:

    class ScientistDesk extends ScientistClass
    placeable;

    DefaultProperties
    {
    Begin Object SkeletalMeshComponent Name=SMesh

  4. #4

    Default

    Thanks for the help guys. This is what I ended up with so others can see. They both use SMesh, but I just change what SMesh represents for the subclass.
    klasodeth has a good point about having each character be a separate subclass. That seems way better for organization and I'll do that in the future.
    I will copy both scripts so others can see.

    This is the parent class,

    class ScientistClass extends Pawn
    placeable;
    var DynamicLightEnvironmentComponent LightEnvironment;

    DefaultProperties
    {
    Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
    bSynthesizeSHLight=TRUE
    bIsCharacterLightEnvironment=TRUE
    bUseBooleanEnvironmentShadowing=FALSE
    End Object
    Components.Add(MyLightEnvironment)
    LightEnvironment=MyLightEnvironment

    Begin Object class=SkeletalMeshComponent Name=SMesh
    SkeletalMesh=SkeletalMesh'Scientist.SkeletalMesh.S cientist_Mesh'
    AnimTreeTemplate=AnimTree'Scientist.Scientist_Tree '
    AnimSets(0)=AnimSet'Scientist.Scientist_Idles'
    bAcceptsLights=true
    Translation=(Z=-58);
    LightEnvironment=MyLightEnvironment

    CastShadow=true
    CollideActors=true;

    End Object
    Mesh=SMesh
    Components.Add(SMesh)
    groundspeed=150
    DrawScale=1.4
    }


    And here is the sub class,


    class Scientist_Notes extends ScientistClass
    placeable;

    DefaultProperties
    {
    Begin Object Name=SMesh
    SkeletalMesh=SkeletalMesh'Scientist.SkeletalMesh.S cientist_Mesh'
    AnimTreeTemplate=AnimTree'Scientist.Scientist_Note s'
    AnimSets(0)=AnimSet'Scientist.Scientist_Idles'
    bAcceptsLights=true
    LightEnvironment=MyLightEnvironment

    CastShadow=true
    CollideActors=true;
    End Object
    Mesh=SMesh
    Components.Add(SMesh)
    }


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.