I need to make something happen when damage is received.
I made a modification for the UT_Shieldbelt class that disguises the wearer as a player from the opposite team. I want it to absorb the first blast of damage, whether that be falling damage, an IG shot, or a tick from the pulse gun, etc. I figured I would just set the armor high enough to absorb an IG shot and then call the destroyed() method when damage is received.
I'm a complete newbie to uscript, but I managed to make it right up to the finishing touches before encountering this problem and resorting to posting.
Here's my code just in case. I'm not sure if any of this will be relevant to the solution at hand, but if you read it and notice and blatant newbie blunders feel free to point them out.
I really appreciate this help and all previous posts, the forum is a great resource.
I made a modification for the UT_Shieldbelt class that disguises the wearer as a player from the opposite team. I want it to absorb the first blast of damage, whether that be falling damage, an IG shot, or a tick from the pulse gun, etc. I figured I would just set the armor high enough to absorb an IG shot and then call the destroyed() method when damage is received.
I'm a complete newbie to uscript, but I managed to make it right up to the finishing touches before encountering this problem and resorting to posting.
Here's my code just in case. I'm not sure if any of this will be relevant to the solution at hand, but if you read it and notice and blatant newbie blunders feel free to point them out.
Code:
class JBondsBelt expands UT_ShieldBelt;
var texture originalSkin[4]; // original skin will be saved here when item picked up
var mesh originalMesh; // original mesh will be saved here when item picked up
function PickupFunction(Pawn Other)
{
local Pawn P;
local Pawn bestPawn;
// Finds the player with the most deaths on the enemy team and prepares to copy their appearance
for (P=Level.PawnList; P!=None ; P=P.nextPawn)
{
if (P.PlayerReplicationInfo.Team != Other.PlayerReplicationInfo.Team)
{
if (bestPawn == None)
bestPawn = P;
else if (P.DieCount >= bestPawn.DieCount)
bestPawn = P;
}
}
CopySkin(Other, bestPawn);
}
// A = pawn that's changing skin
// B = pawn who's skin is to be copied
function CopySkin(Pawn A, Pawn B)
{
local int i;
originalMesh = A.Mesh;
A.Mesh = B.Mesh;
for(i = 0; i < 4; i++)
{
originalSkin[i]=A.MultiSkins[i];
A.MultiSkins[i]=B.MultiSkins[i];
}
}
// Sets owner's skin back to whatever it was before picking up the item
function DisguiseEnd()
{
local int i;
Owner.Mesh = originalMesh;
for(i = 0; i < 4; i++)
Owner.MultiSkins[i]=originalSkin[i];
Spawn(class'EnergyBurst',,,Location);
}
function Destroyed()
{
DisguiseEnd();
Super(UT_ShieldBelt).Destroyed();
}
I really appreciate this help and all previous posts, the forum is a great resource.