AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [l4d2] Removing certain items like defibrillators (https://forums.alliedmods.net/showthread.php?t=332508)

spaghettipastaman 05-16-2021 15:19

[l4d2] Removing certain items like defibrillators
 
I've been trying to find a way to remove defibrillators in L4D2, because I use a ragdoll mod that looks really weird when it's revived from like 20 meters away. Anybody know a way to remove them from the game? (Including scripted defib spawns)

GoGetSomeSleep 05-18-2021 15:45

Re: [l4d2] Removing certain items like defibrillators
 
you can use stripper or vscript i can give you some codes.

for stripper:
left4dead2/addons/stripper/global_filters.cfg

PHP Code:

modify:
{
    
match:
    {
        
"classname" "weapon_item_spawn"
    
}
    
replace:
    {
        
"item12" "0"
    
}
}
filter:
{
    
"classname" "weapon_defibrillator_spawn"
}
{
    
"classname" "weapon_defibrillator"



for vscript
left4dead2/scripts/vscripts/versus(or coop?).nut

PHP Code:

MutationOptions <-
{

// convert defibs to ammo, start

    
weaponsToConvert =
    {
        
weapon_defibrillator            "ammo_spawn" // changes defibs to ammo, if yo don't wanna than remove
    
}

    function 
ConvertWeaponSpawnclassname )
    {
        if ( 
classname in weaponsToConvert )
        {
            return 
weaponsToConvert[classname];
        }
        return 
0;
    }

// convert defibs to ammo, stop
    
    
weaponsToRemove =
    {
        
weapon_defibrillator 0
    
}

    function 
AllowWeaponSpawnclassname )
    {
        if ( 
classname in weaponsToRemove )
        {
            return 
false;
        }
        return 
true;
    }
    
    function 
ShouldAvoidItemclassname )
    {
        if ( 
classname in weaponsToRemove )
        {
            return 
true;
        }
        return 
false;
    }



spaghettipastaman 05-18-2021 16:49

Re: [l4d2] Removing certain items like defibrillators
 
Quote:

Originally Posted by GoGetSomeSleep (Post 2747226)
you can use stripper or vscript i can give you some codes.

for stripper:
left4dead2/addons/stripper/global_filters.cfg

PHP Code:

modify:
{
    
match:
    {
        
"classname" "weapon_item_spawn"
    
}
    
replace:
    {
        
"item12" "0"
    
}
}
filter:
{
    
"classname" "weapon_defibrillator_spawn"
}
{
    
"classname" "weapon_defibrillator"



for vscript (with vslib)
left4dead2/scripts/vscripts/versus(or coop?).nut

PHP Code:

MutationOptions <-
{

// convert defibs to ammo, start

    
weaponsToConvert =
    {
        
weapon_defibrillator            "ammo_spawn" // changes defibs to ammo, if yo don't wanna than remove
    
}

    function 
ConvertWeaponSpawnclassname )
    {
        if ( 
classname in weaponsToConvert )
        {
            return 
weaponsToConvert[classname];
        }
        return 
0;
    }

// convert defibs to ammo, stop
    
    
weaponsToRemove =
    {
        
weapon_defibrillator 0
    
}

    function 
AllowWeaponSpawnclassname )
    {
        if ( 
classname in weaponsToRemove )
        {
            return 
false;
        }
        return 
true;
    }
    
    function 
ShouldAvoidItemclassname )
    {
        if ( 
classname in weaponsToRemove )
        {
            return 
true;
        }
        return 
false;
    }



I can't seem to find VScripts, but i can find VSlib,
other than that thanks for the help

GoGetSomeSleep 05-18-2021 17:05

Re: [l4d2] Removing certain items like defibrillators
 
i can send you a zip if you don't wanna use stripper for some reason

spaghettipastaman 05-18-2021 17:13

Re: [l4d2] Removing certain items like defibrillators
 
Sure

GoGetSomeSleep 05-18-2021 17:22

Re: [l4d2] Removing certain items like defibrillators
 
vslib is not required for basics like remove defibs but if you use vscript, vslib is needed in some cases for things you want. you can add on top when you setup vslib: IncludeScript("vslib");

i am not including vslib on zip not required.

Download left4dead2 vscripts for remove defibs.zip

spaghettipastaman 05-18-2021 17:30

Re: [l4d2] Removing certain items like defibrillators
 
thanks, it works like a charm

a2121858 01-01-2022 11:52

Re: [l4d2] Removing certain items like defibrillators
 
Can someone help me replace sniper_awp with sniper_scout?

I use stripper, which removes the fixed AWP on c1m2, but for some maps, the AWP is still generated in the safe house. How should I configure it to replace sniper_awp with sniper_scout on all maps? Can anyone help me?:)

This is the configuration I am using:

global_filters.cfg
PHP Code:

modify:
{
    
match:
    {
        
"weapon_selection" "weapon_sniper_awp"
    
}
    
replace:
    {
        
"weapon_selection" "weapon_sniper_scout"
    
}
}

modify:
{
    
match:
    {
        
"classname" "weapon_sniper_awp_spawn"
    
}
    
replace:
    {
        
"classname" "weapon_sniper_scout_spawn"
    
}



Marttt 01-02-2022 11:26

Re: [l4d2] Removing certain items like defibrillators
 
probably they are a "weapon_spawn" entity.

https://developer.valvesoftware.com/wiki/Weapon_spawn

You need to change the weapon_sniper_awp option.

PHP Code:

modify:
{
    
match:
    {
        
"classname" "weapon_spawn"
        "weapon_selection" "weapon_sniper_awp"
    
}
    
replace:
    {
        
"weapon_selection" "weapon_sniper_scout"
    
}



a2121858 01-03-2022 03:38

Re: [l4d2] Removing certain items like defibrillators
 
Quote:

Originally Posted by Marttt (Post 2767458)
probably they are a "weapon_spawn" entity.

https://developer.valvesoftware.com/wiki/Weapon_spawn

You need to change the weapon_sniper_awp option.

PHP Code:

modify:
{
    
match:
    {
        
"classname" "weapon_spawn"
        "weapon_selection" "weapon_sniper_awp"
    
}
    
replace:
    {
        
"weapon_selection" "weapon_sniper_scout"
    
}



Thank you, Mr. Marttt.
I do it in your way, but there is no effect.
AWP still generated in the safety house.

PHP Code:

modify:
{
    
match:
    {
        
"classname" "weapon_spawn"
        "weapon_selection" "weapon_sniper_awp"
    
}
    
replace:
    {
        
"weapon_selection" "weapon_sniper_scout"
    
}


modify:
{
    
match:
    {
        
"classname" "weapon_sniper_awp_spawn"
    
}
    
replace:
    {
        
"classname" "weapon_sniper_scout_spawn"
    
}




All times are GMT -4. The time now is 12:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.