UE2 - UT2kX Mutator to change Character Class

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

TheKiller

RISING-DEAD.COM
Jan 14, 2011
41
0
6
Romania
rising-dead.com
Hello !
i am a member on the Wiki site for a while (really came handy a few times)
and i said to register here after i found "bAddToServerPackages" on Wiki and Googled untill this forum

I Made a few Weapons and Characters Modifications for the Game Land Of The Dead (Based on UT2003) and i was Wondering if Someone knows a way to make two mutators

i want a mutator that Changes a player class with another for
example change FAT Character with a Thin Character ..

and a way to Change the Hands texture of a character (the weapon hands not the 3rd person hands)

Sorry for my silly English
 

[GU]elmur_fud

I have balls of Depleted Uranium
Mar 15, 2005
3,148
31
48
45
Waco, Texas
mtbp.deviantart.com
Well if u r just wanting to change visuals I think you could do that by modding the code for various player model efects such as the texture overlays for things like adreneline combo's or double damage. Just a geuss really.
 

TheKiller

RISING-DEAD.COM
Jan 14, 2011
41
0
6
Romania
rising-dead.com
hm... not sure i get what u mean

Here are some quotes i made in 2009 in some forum

Hey i want to create a character and make him to use the hands texture from an other directory and not the DOTZWeapons.utx
i know how to change the hands so when you pick a weapon it uses hands from a other directory
but idk how to make this on a character
can someone help me with a sample script that dos that ?

For DA, DS, NG, I extended the base Weapon code, and created a new set of Weapons, adding this to the base Weapon:


Code:
simulated function PostBeginPlay() {
            super.PostBeginPlay();
	if(NGPawn(Owner) != None && NGPawn(Owner).HandsMaterial != None) {
		CopyMaterialsToSkins();
		for(x = 0; x < Skins.Length; x++) {
			if(Skins[x] == Texture'DOTZTWeapons.WeaponHands.WeaponHands')
				Skins[x] = NGPawn(Owner).HandsMaterial;
		}
	}
}

But i dont understand much of the reply ...

is there a way to change the texture image from a file into a mutator?
 

[GU]elmur_fud

I have balls of Depleted Uranium
Mar 15, 2005
3,148
31
48
45
Waco, Texas
mtbp.deviantart.com
A mutator has to have at least a script. Some code at it's base. If all u are trying to do is swap existing data u shouldn't need to repackage said data in your mut. All you should need is the instructions, I am not sure how to write those instruction just saying that you could probably use the same code that swaps textures for those functions with very little rewrite.
 

TheKiller

RISING-DEAD.COM
Jan 14, 2011
41
0
6
Romania
rising-dead.com
i have the Mutator Class thats found in the game files as all other UT Based games

i have Wrote a few mutators to Replace Weapons but that was because i had a script to start with
i dont know too much of the language
 
Last edited:

TheKiller

RISING-DEAD.COM
Jan 14, 2011
41
0
6
Romania
rising-dead.com
Haven't touched mut's in quite a while, but if they're able to change the pawn class, you can intercept the code that assigns the skin (pawn pulls from the familyinfo)

Mmmmmmmm.... sounds like chinese :rolleyes:
i cant write script for unreal .. all the mods and mutators i did were changing textures and adding extra default propreties that were already codded etc and then recompile them :D

Could you try making some example code please :)
 

kiff

That guy from Texas. Give me some Cash
Jan 19, 2008
3,793
0
0
Tx.
www.desert-conflict.org
wow, you're fast. I deleted that about a minute after I posted it. since you caught me...

This is UDK code, but you mentioned 2004, so it might not apply. anyways...

UTFamilyInfo:
Code:
/** Return the appropriate team materails for this character class given a team */
function static GetTeamMaterials(int TeamNum, out MaterialInterface TeamMaterialHead, out MaterialInterface TeamMaterialBody)
{
	TeamMaterialHead = (TeamNum < default.CharacterTeamHeadMaterials.length) ? default.CharacterTeamHeadMaterials[TeamNum] : default.CharacterMesh.Materials[0];
	TeamMaterialBody = (TeamNum < default.CharacterTeamBodyMaterials.length) ? default.CharacterTeamBodyMaterials[TeamNum] : default.CharacterMesh.Materials[1];
}

UTPawn:
Code:
/** Set various basic properties for this UTPawn based on the character class metadata */
simulated function SetCharacterClassFromInfo(class<UTFamilyInfo> Info)
{
	local UTPlayerReplicationInfo PRI;
	local int i;
	local int TeamNum;
	local MaterialInterface TeamMaterialHead, TeamMaterialBody, TeamMaterialArms;

	PRI = GetUTPlayerReplicationInfo();

	if (Info != CurrCharClassInfo)
	{
		// Set Family Info
		CurrCharClassInfo = Info;

		// get the team number (0 red, 1 blue, 255 no team)
		TeamNum = GetTeamNum();

		// AnimSets
		Mesh.AnimSets = Info.default.AnimSets;

		//Apply the team skins if necessary
		if (WorldInfo.NetMode != NM_DedicatedServer)
		{
			Info.static.GetTeamMaterials(TeamNum, TeamMaterialHead, TeamMaterialBody);
		}

		// 3P Mesh and materials
		SetCharacterMeshInfo(Info.default.CharacterMesh, TeamMaterialHead, TeamMaterialBody);

		// First person arms mesh/material (if necessary)
		if (WorldInfo.NetMode != NM_DedicatedServer && IsHumanControlled() && IsLocallyControlled())
		{
			TeamMaterialArms = Info.static.GetFirstPersonArmsMaterial(TeamNum);
			SetFirstPersonArmsInfo(Info.static.GetFirstPersonArms(), TeamMaterialArms);
		}

		// PhysicsAsset
		// Force it to re-initialise if the skeletal mesh has changed (might be flappy bones etc).
		Mesh.SetPhysicsAsset(Info.default.PhysAsset, true);

		// Make sure bEnableFullAnimWeightBodies is only TRUE if it needs to be (PhysicsAsset has flappy bits)
		Mesh.bEnableFullAnimWeightBodies = FALSE;
		for(i=0; i<Mesh.PhysicsAsset.BodySetup.length && !Mesh.bEnableFullAnimWeightBodies; i++)
		{
			// See if a bone has bAlwaysFullAnimWeight set and also
			if( Mesh.PhysicsAsset.BodySetup[i].bAlwaysFullAnimWeight &&
				Mesh.MatchRefBone(Mesh.PhysicsAsset.BodySetup[i].BoneName) != INDEX_NONE)
			{
				Mesh.bEnableFullAnimWeightBodies = TRUE;
			}
		}

		//Overlay mesh for effects
		if (OverlayMesh != None)
		{
			OverlayMesh.SetSkeletalMesh(Info.default.CharacterMesh);
		}

		//Set some properties on the PRI
		if (PRI != None)
		{
			PRI.bIsFemale = Info.default.bIsFemale;
			PRI.VoiceClass = Info.static.GetVoiceClass();

			// Assign fallback portrait.
			PRI.CharPortrait = Info.static.GetCharPortrait(TeamNum);

			// a little hacky, relies on presumption that enum vals 0-3 are male, 4-8 are female
			if ( PRI.bIsFemale )
			{
				PRI.TTSSpeaker = ETTSSpeaker(Rand(4));
			}
			else
			{
				PRI. TTSSpeaker = ETTSSpeaker(Rand(5) + 4);
			}
		}

		// Bone names
		LeftFootBone = Info.default.LeftFootBone;
		RightFootBone = Info.default.RightFootBone;
		TakeHitPhysicsFixedBones = Info.default.TakeHitPhysicsFixedBones;

		// sounds
		SoundGroupClass = Info.default.SoundGroupClass;

		DefaultMeshScale = Info.Default.DefaultMeshScale;
		Mesh.SetScale(DefaultMeshScale);
		BaseTranslationOffset = CurrCharClassInfo.Default.BaseTranslationOffset;
		CrouchTranslationOffset = BaseTranslationOffset + CylinderComponent.Default.CollisionHeight - CrouchHeight;
	}
}

/** Accessor that sets the character mesh to use for this pawn, and updates instance of player in map if there is one. */
simulated function SetCharacterMeshInfo(SkeletalMesh SkelMesh, MaterialInterface HeadMaterial, MaterialInterface BodyMaterial)
{
    Mesh.SetSkeletalMesh(SkelMesh);

	if (WorldInfo.NetMode != NM_DedicatedServer)
	{
		if (VerifyBodyMaterialInstance())
		{
			BodyMaterialInstances[0].SetParent(HeadMaterial);
			if (BodyMaterialInstances.length > 1)
			{
			   BodyMaterialInstances[1].SetParent(BodyMaterial);
			}
		}
		else
		{
			`log("VerifyBodyMaterialInstance failed on pawn"@self);
		}
	}
}
 

TheKiller

RISING-DEAD.COM
Jan 14, 2011
41
0
6
Romania
rising-dead.com
hehe .. yeah im fast xD
i was wondering why did you deleted it

i can kinda tell that from the UTFamilyInfo code

it looks too much like the short if statements from PHP
i have never seen that in any classes i put my nose in :|