Announcement

Collapse
No announcement yet.

Need Help To Make subclass of XIntroPawn

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

  • replied
    You could try a LinkMesh(Level.GetLocalPlayerController().Pawn.Mes h);
    That should work. Be sure to check so it doesn't give you an Accessed None though.

    Leave a comment:


  • replied
    Originally posted by xkznanna
    Try someting like
    I've mean other: when loaded any singleplayer profile, this pawn have a textures and mesh of player character in this profile.

    I made this script, but it doesent work:

    Code:
    class VIntroPawn extends xPawn;
    
    var ShadowProjector PawnShadow;
    
    var() vector ShadowDirection;
    var() byte ShadowDarkness;
    var() string MeshNameString;
    
    var() string	sChar, sName, sNameD, sCharD, sVoice, sVoiceD;
    
    var() xUtil.PlayerRecord PlayerRec;
    
    function AddDefaultInventory();	// Override
    
    simulated function Destroyed()
    {
        if( PawnShadow != None )
            PawnShadow.Destroy();
    
        Super.Destroyed();
    }
    
    simulated function PostBeginPlay()
    {
        Super.PostBeginPlay();
    
    	if ( (Mesh == None) && (MeshNameString != "") )
    		LinkMesh(mesh(DynamicLoadObject(MeshNameString,class'Mesh')));
    	
    	if(bShadowCast)
    	{
    		PawnShadow = Spawn(class'ShadowProjector',Self,'',Location);
    		PawnShadow.ShadowActor = self;
    		PawnShadow.RootMotion = True;
    		PawnShadow.LightDirection = Normal(ShadowDirection);
    		PawnShadow.LightDistance = 192;
    		PawnShadow.MaxTraceDistance = 350;
    		PawnShadow.InitShadow();
    		PawnShadow.ShadowTexture.ShadowDarkness = ShadowDarkness;
    	}
    	
    	SetPlayerRec();
    	SetCharacter();	
    	
    }
    
    function SetCharacter()
    {
    	local Mesh PlayerMesh;
    	local Material BodySkin, HeadSkin;
      local string BodySkinName, HeadSkinName, TeamSuffix;
    	
    	// Mesh
    	PlayerMesh = Mesh(DynamicLoadObject(PlayerRec.MeshName, class'Mesh'));
    	if(PlayerMesh == None)
    	{
    		Log("[FOR UC Developer] Could not load mesh: "$PlayerRec.MeshName$" For player: "$PlayerRec.DefaultName);
    		return;
    	}
    	
    
    	// Body skin
      BodySkinName = PlayerRec.BodySkinName $ TeamSuffix;
    
    	// Head skin
        HeadSkinName = PlayerRec.FaceSkinName;
        if ( PlayerRec.TeamFace )
        	HeadSkinName $= TeamSuffix;
    
    	BodySkin = Material(DynamicLoadObject(BodySkinName, class'Material'));
    	if(BodySkin == None)
    	{
    		Log("[FOR UC Developer] Could not load body material: "$PlayerRec.BodySkinName$" For player: "$PlayerRec.DefaultName);
    		return;
    	}	
    
    	HeadSkin = Material(DynamicLoadObject(HeadSkinName, class'Material'));
    	if(HeadSkin == None)
    	{
    		Log("[FOR UC Developer] Could not load head material: "$HeadSkinName$" For player: "$PlayerRec.DefaultName);
    		return;
    	}
    	
    
    	LinkMesh(PlayerMesh);
    	Skins[0] = BodySkin;
    	Skins[1] = HeadSkin;
    }	
    
    function SetPlayerRec()
    {
    	local int i;
    	local array<xUtil.PlayerRecord> PList;
    
    	class'xUtil'.static.GetPlayerList(PList);
    
    	// Filter out to only characters without the 's' menu setting
    	for(i=0; i<PList.Length; i++)
    	{
        	if ( sChar ~= Plist[i].DefaultName )
        	{
            	PlayerRec = PList[i];
            	break;
            }
        }
    }

    Leave a comment:


  • replied
    Try someting like

    code
    _____________________________________________

    class MYxIntroPawn extends xIntroPawn;
    {

    }

    defaultproperties
    {
    Mesh=SkeletalMesh'MyPackage.MyMesh'
    Skins(0)=Texture'MyTexturePackage.MyBodySkin'
    Skins(1)=Texture'MyTexturePackage.MyHeadSkin'
    }
    ____________________________________________

    if you using a player model you can find the mesh and texture packages in the .upl file in the system folder

    hope it helps

    Leave a comment:


  • started a topic Need Help To Make subclass of XIntroPawn

    Need Help To Make subclass of XIntroPawn

    Hall of Champions video in my TC mod ut][c need have character of player at the end doing a victory dance like in '99.

    I need a subclass of XIntroPawn, which will using skins and model from loaded character in single player.
Working...
X