Vanishing equipment

  • 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.

Silver_Ibex

Member
Feb 27, 2001
654
0
16
The problem is that my mutator only gives the characters their default starting equipment on every other spawn, so if you get fragged you have to wait till you get fragged again to spawn with equipment

Is the problem in this mutator code, or should I be looking elsewhere?

class Equipment expands Mutator;
//
//

var PUTlsight LS;
var PUTgrapple GR;

function ModifyPlayer(Pawn Other)
{
Super.ModifyPlayer(Other);

if ( Other.IsA('Spectator') || Other.FindInventoryType(class'PUTLSight') != none ) return;
if ( Other.IsA('Bot') || Other.FindInventoryType(class'PUTLSight') != none ) return;
if ( Other.IsA('Spectator') || Other.FindInventoryType(class'PUTgrapple') != none ) return;
if ( Other.IsA('Bot') || Other.FindInventoryType(class'PUTgrapple') != none ) return;

LS = Spawn(class'PUTLSight',,, Location);
LS.GiveTo(Other);
LS.Activate();
LS.bHeldItem = true;

GR = Spawn(class'PUTgrapple',,, Location);
GR.GiveTo(other);
GR.bHeldItem = true;

}


function Mutate(string MutateString, PlayerPawn Sender)
{
if ( MutateString ~= "SwLSight" )
{
if ( Level.NetMode == NM_Standalone )
{
LS = PUTlsight(Sender.FindInventoryType(class'PUTLSight'));
LS.Activate();
}
}
else Super.Mutate(MutateString, Sender);
}
 

eXoR

Lead coder
Oct 22, 2001
36
0
0
38
Holland
exorcist.gamepoint.net
Heya,

I don’t know how your equipment classes are set up, but when I look at your ModifyPlayer function I think what is happening is that there still is equipment for the player that spawns but it stopped working somehow (can’t tell how exactly because I don’t know your equipment class code) and because the player still has that in it’s inventory. Try logging in your ModifyPlayer function when the function returns because there still is such an inventory item, and log when it indeed does spawn the inventory items. That way you can find out if your equipment is not working or that it’s not spawned.

Also, the ~= operator in a string means approximately equality, in normal words if the string is the same as the string after the operator case Insensitive.

Hope this helps you,

eXoR.