DXMP removing lockpicks/multitools, F12 and such?

Talk about any Deus Ex game modification here, e.g. maps, package or a total conversion.

Moderator: Forum Guards

DXMP removing lockpicks/multitools, F12 and such?

Postby WeeCrab » Sat May 14, 11 7:27 am

Any easy way to use a mod that automatically removes a players lockpick and multitool when they enter the server or respawn?

Also, would killing augmentations (perhaps even the Flashlight) be possible with a mod? I.e. host a server allowing 2 augs (+flashlight) at start, but the mod would take precedence when the game actually starts and remove them. ?

Reason: Wanted to try and make an interesting and challenging co-op map for players, but some built-in stuff in DXMP kind of ruins it. For example, you'd be able to suicide 4 times at the spawnpoint, and voila, you now have 5 lockpicks, multitools, and medkits from the corpses. Or, join, throw stuff on ground, leave and rejoin, repeat. This just won't do.
Last edited by WeeCrab on Sat May 14, 11 7:28 am, edited 1 time in total.
WeeCrab
Newbie
 
Posts: 43
Joined: Wed Jul 29, 09 6:10 am

Postby Dae » Sat May 14, 11 9:36 am

It's all possible with mutators.

Not exactly what you're looking for, but still:
http://www.dxalpha.com/forum/viewtopic.php?t=6094
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Cozmo » Sat May 14, 11 10:55 am

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
{
}
Cozmo_RPG (v1 & v2)
MPConversations - A tool for creating multiplayer RPG stuff
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby WeeCrab » Mon May 23, 11 6:36 am

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?
Last edited by WeeCrab on Mon May 23, 11 6:44 am, edited 5 times in total.
WeeCrab
Newbie
 
Posts: 43
Joined: Wed Jul 29, 09 6:10 am

Postby Cozmo » Mon May 23, 11 10:25 am

I'm not familiar with languages other than Uscript atm, so sorry if my explanations aren't very good. :)

Code: Select all
if(DXP.Owner == DeusExPlayer(Other))


This line checks if the "Owner" variable in the pickup class is the "Other"/Pawn from the mutator function (in this case, player who's just spawned). This is only necessary because the ForEach function executes the code inside it once for each of the actors found, so you're right; without the check, it would delete all the lockpicks that didn't belong to the player too.

The other line ("DeusExPlayer(Other)") is a cast from a Pawn variable to a DeusExPlayer, but I think Owner is a Pawn anyway so I'm not sure why I did that actually :? mistake from chopping up code I guess.

As for changing team skins, we can access those directly so we don't need a ForEach here. I'll write something quickly and explain it later if you need it. :)

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();
      }
   }

   p = DeusExPlayer(Other);

   if(p.PlayerReplicationInfo.Team == 0) //I think 0 = UNATCO, 1 = NSF but not sure
   {
      p.MultiSkins(0) = whatever;
   }
}
Last edited by Cozmo on Mon May 23, 11 10:28 am, edited 2 times in total.
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby WeeCrab » Sat May 28, 11 2:15 am

Awesome, thank you

A question about the mutator code: when exactly does that code execute? Every time a player joins or respawns specifically? Or is it constantly running, non-stop, always attempting to delete inventory?

One more (I think :) )
Is there any similar code that might work to remove the F12 flashlight, or to remove augs in general? (Note: I'm not anti-augs. I'm definitely all for augs when it comes to DXMP. However this mod wouldn't really be compatible with augs, and if I do make new character models, it would seem strange if they have eye-flashlights.)

As far as I know, augs can be ADDED with augadd augspeed and such with cheats.
Last edited by WeeCrab on Sat May 28, 11 2:16 am, edited 1 time in total.
WeeCrab
Newbie
 
Posts: 43
Joined: Wed Jul 29, 09 6:10 am

Postby SimonDenton » Mon Jul 11, 11 6:02 am

WeeCrab wrote:Awesome, thank you

Is there any similar code that might work to remove the F12 flashlight, or to remove augs in general?


There is code in Burden of 80 Proof in the player class uc file which overrides the aug so the light aug is not there and it even removes the "No Augmentation" message when you press the other buttons. I am not familiar with mutator coding but someway you could implement the player class code.
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm


Return to Modifications

Who is online

Users browsing this forum: No registered users and 66 guests