PDA

View Full Version : Need Help To Make subclass of XIntroPawn



legacy-SDVenom
08-18-2005, 01:04 AM
Hall of Champions video in my TC mod ut][c (http://www.ataricommunity.com/forums/showthread.php?s=&threadid=480593) 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.

legacy-xkznanna
08-18-2005, 02:14 PM
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

legacy-SDVenom
08-19-2005, 03:53 AM
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:


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,cla ss'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;
}
}
}

Angel_Mapper
08-19-2005, 05:22 AM
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.