Cozmo wrote:Dug up part of my mod quickly and edited it into this. I haven't tested it, but it should delete any lockpicks/multitools/medkits the player has as they spawn, so they basically spawn with nothing.
- Code: Select all
//======================================
//
//======================================
class ClassName extends Mutator config(DeusEx);
function PostBeginPlay()
{
Level.Game.BaseMutator.AddMutator(Self);
}
function ModifyPlayer(Pawn Other)
{
local DeusExPickup DXP;
foreach AllActors(Class'DeusExPickup', DXP)
{
if(DXP.Owner == DeusExPlayer(Other))
{
DXP.Destroy();
}
}
}
defaultproperties
{
}
Thanks guys. Sorry for the late reply. Forgot I made the post after having to do some stuff.
Couple questions. I've got a basic understanding of C++ through school but not necessarily Uscript.
Could you explain what this check is doing? :
- Code: Select all
if(DXP.Owner == DeusExPlayer(Other))
If that line wasn't there, and it was just :
- Code: Select all
foreach AllActors(Class'DeusExPickup', DXP)
{
DXP.Destroy();
}
would it work? If so, what would the effect be? my guess would be it would also delete lockpicks/tools on the ground as well?
(mainly interested in how the "DeusExPlayer(Other)" works)
Also.
I assume I could also replace something like the DX Player's mesh and skins if I wanted to, using the same methods? (might be fun to have a playable map that has a goal (i.e.
not an "RP" map) with skins other than nsf and unatco.
would something like this be proper?
bad code- Code: Select all
function ModifyPlayer(Pawn Other)
{
local DeusExPickup DXP;
local DeusExPlayer p;
foreach AllActors(Class'DeusExPickup', DXP)
{
if(DXP.Owner == DeusExPlayer(Other))
{
DXP.Destroy();
}
}
foreach AllActors(Class'DeusExPlayer', p)
{
if(p == mpunatco)
{
p.MultiSkins(0) = whatever;
}
}
}
would something like that work?