Why zeroping doesn't work with nw lms

Discussions about Coding and Scripting
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Why zeroping doesn't work with nw lms

Post by iloveut99 »

Hi,

I know that zeroping doesn't work with normal weapons lastmanstanding (sniper, shock riffle don't appear in player inventory), but does work with instagib lastmanstanding.

Does anyone know the reason?

I was thinking in fix it.
User avatar
papercoffee
Godlike
Posts: 10676
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.

Re: Why zeroping doesn't work with nw lms

Post by papercoffee »

somehow I have a similar problem with the "enhanced enforcer-mini-gun" mutator what make it possible to do head-shots with this two weapons.
I think it is the LMS-game type what doesn't allow mutated or modded weapons. It seems the zeroping mutate the sniper- and shock-rifle so LMS disable this weapons.

maybe this give you the hind to the right direction.
You don't have to fix the ZP mutator but the LMS game type.
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: Why zeroping doesn't work with nw lms

Post by iloveut99 »

I'm fixing lms gametype. :)

Thanks for the tip.

This is the current lms code to gve the nw weapons:
function AddDefaultInventory( pawn PlayerPawn )
{
local Weapon weap;
local int i;
local inventory Inv;
local float F;

if ( PlayerPawn.IsA('Spectator') || (bRequireReady && (CountDown > 0)) )
return;
Super.AddDefaultInventory(PlayerPawn);

GiveWeapon(PlayerPawn, "Botpack.ShockRifle");
GiveWeapon(PlayerPawn, "Botpack.UT_BioRifle");
GiveWeapon(PlayerPawn, "Botpack.Ripper");
GiveWeapon(PlayerPawn, "Botpack.UT_FlakCannon");

if ( PlayerPawn.IsA('PlayerPawn') )
{
GiveWeapon(PlayerPawn, "Botpack.SniperRifle");
GiveWeapon(PlayerPawn, "Botpack.PulseGun");
GiveWeapon(PlayerPawn, "Botpack.Minigun2");
GiveWeapon(PlayerPawn, "Botpack.UT_Eightball");
PlayerPawn.SwitchToBestWeapon();
}
Theoretically the zp mutator should replace the botpack weapons but seems something is failing.

\Edit

Noticed this code:
function bool IsRelevant(actor Other)
{
local Mutator M;
local bool bArenaMutator;

for (M = BaseMutator; M != None; M = M.NextMutator)
{
if (M.IsA('Arena'))
bArenaMutator = True;
}

if ( bArenaMutator )
{
if ( Other.IsA('Inventory') && (Inventory(Other).MyMarker != None) && !Other.IsA('UT_Jumpboots') && !Other.IsA('Ammo'))
{
Inventory(Other).MyMarker.markedItem = None;
return false;
}
} else {
if ( Other.IsA('Inventory') && (Inventory(Other).MyMarker != None) && !Other.IsA('UT_Jumpboots'))
{
Inventory(Other).MyMarker.markedItem = None;
return false;
}
}

return Super.IsRelevant(Other);
}
So maybe be this the code that empty zp guns, since the normal zp mutator isn't an arena, need to test although.
User avatar
Feralidragon
Godlike
Posts: 5503
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Why zeroping doesn't work with nw lms

Post by Feralidragon »

Well, this is not a problem of LMS. To prove it, just go to a regular DM, with ZP sniper and such on, and make a "loaded" command in the console, and check which ones you have.

Arenas work mostly because they add the arena weapon to your "default inventory", so you always (re)spawn with them already in any gametype.

I have this fixed in NW3 though, so both "loaded" and LMS work with them perfectly, including with ScriptedPawns (SkaarjTrooper), but I had to do somewhat a workaround for this, which consists in a custom ReplaceWith function from the mutator, a custom actor to replace the weapon 0.035 seconds later to be able to reassign the new weapon to the respective Instigator, works very well).
Somewhat, a mutator replaces a weapon even before the Instigator and Owner are assigned to it, so in some pawns the new weapon will just float and be "pickable", with bots and players the weapons seems to destroy themselves, so to avoid this, I spawn that actor to delay the replace, so the variables get assigned so I can use them to replace the weapon correctly afterwards.

I can PM or post here the code if you want (it's from NW3, which is not released yet, but there's no need to hide fixes I already made), just noticed I have to optimize it a bit first when I looked at it again today.

EDIT: Thinking better, in case you just want to fix this for LMS, just make the mutator to add those weapons to the player's inventory directly, and call it a LMS_ZP-Fix mutator or something. You choose :)
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: Why zeroping doesn't work with nw lms

Post by iloveut99 »

Yeah I though that. (even with custom ini so we can add custom weapons) The problem is that I believe that there are different zp weapons names due the different zp mutators. Also a custom ini would be more difficult to the admins to configure their servers.

I'm building a new gametype based in lms (which I called it lms+) so I can use any lms functions to fix the problem. You may send me a pm with the code so I may have a look to find a good way to fix it.

I'll dig more deep in next days to fix this problem, because I were lacking time lately.