Raised This Month: $12 Target: $400
 3% 

[L4D2] Random Glow Item [v1.0.7 | 29-May-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Plugin ID:
7439
Plugin Version:
1.0.7
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    32 
    Plugin Description:
    Gives a random glow to items on the map
    Old 12-31-2020 , 21:41   [L4D2] Random Glow Item [v1.0.7 | 29-May-2022]
    Reply With Quote #1

    L4D2 ONLY

    L4D1 version here

    Description

    This plugin applies a random glow to some items to make them easier to identify on the map.

    I used to run this plugin to find places that spawn items.

    Features
    • Allow configuring the glow by classname.
    • Allow configuring the glow color (random or specific).
    • Allow configuring the glow type.
    • Allow configuring the glow flashing.
    • Allow configuring the min distance to glow.
    • Allow configuring the max distance to glow.
    • Allow configuring the glow brightness (not accurate).
    • Allow ignoring scavenge gas cans.
    • Fix spawner entities glow.
    • Remove health cabinet glow on open when enabled.

    Preview



    Cvars

    A configuration file named "l4d2_random_glow_item.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder.

    PHP Code:
    // Enable/Disable the plugin.
    // 0 = Disable, 1 = Enable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_random_glow_item_enable "1"

    // Remove glow from health cabinet after being opened.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_random_glow_item_health_cabinet "1"

    // Algorithm value to detect the glow minimum brightness for a random color (not accurate).
    // -
    // Default: "0.5"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_random_glow_item_min_brightness "0.5"

    // Delete *_spawn entities when its count reaches 0.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_random_glow_item_remove_spawner "1"

    // Apply glow to scavenge gascans.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_random_glow_item_scavenge_gascan "0" 
    Data file (data/l4d2_random_glow_item.cfg)
    PHP Code:
    // Attributes explained:
    //  "enable"   -> Apply plugin glow to entity. "0" = Disable, "1" = Enable.
    //  "random"   -> Apply a random glow color. "0" = OFF, "1" = ON.
    //  "color"    -> Item glow color. Use three values between 0-255 separated by spaces. "<0-255> <0-255> <0-255>", e.g: "255 255 255". Ignored when "random" is "1".
    //  "flashing" -> Add a flashing effect on glowing entities. "0" = OFF, "1" = ON.
    //  "type"     -> Glow type. "0" = OFF, "1" = OnUse (doesn't works), "2" = OnLookAt (doesn't works well for some entities), "3" = Constant (better results but visible through walls).
    //  "rangemin" -> Minimum distance that the client must be from the entity to start glowing. "0" = No minimum distance.
    //  "rangemax  -> Maximum distance that the client can be away from the entity to start glowing. "0" = No maximum distance.

    "l4d2_random_glow_item"
    {
        
    "default"
        
    {
            
    "enable"        "1"
            "random"        "1"
            "color"         "255 255 255"
            "flashing"      "0"
            "type"          "3"
            "rangemin"      "0"
            "rangemax"      "510"
        
    }

        
    "classnames"
        
    {
            
    // Primary Weapons - Slot 1
            // Tier 1
            // SMGs
            
    "weapon_smg"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_smg_silenced"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_smg_mp5"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    // Shotguns
            
    "weapon_pumpshotgun"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_shotgun_chrome"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }

            
    // Tier 2
            // Rifles
            
    "weapon_rifle"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_rifle_desert"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_rifle_ak47"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_rifle_sg552"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    // Shotguns
            
    "weapon_autoshotgun"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_shotgun_spas"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    // Snipers
            
    "weapon_hunting_rifle"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_sniper_military"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_sniper_scout"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_sniper_awp"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    // Tier 3
            
    "weapon_rifle_m60"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_grenade_launcher"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }

            
    // Secondary Weapons - Slot 2
            // Pistols
            
    "weapon_pistol"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }
            
    "weapon_pistol_magnum"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 255"
            
    }

            
    // Throwables - Slot 3
            
    "weapon_molotov"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 100 0"
            
    }
            
    "weapon_pipe_bomb"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 100 0"
            
    }
            
    "weapon_vomitjar"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 100 0"
            
    }

            
    // Upgrade Packs - Slot 4
            
    "weapon_upgradepack_explosive"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 0"
            
    }
            
    "weapon_upgradepack_incendiary"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 0"
            
    }

            
    // Health Items - Slot 4
            
    "weapon_first_aid_kit"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 0"
            
    }
            
    "weapon_defibrillator"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 0"
            
    }

            
    // Health Items - Slot 5
            
    "weapon_pain_pills"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 0"
            
    }
            
    "weapon_adrenaline"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 0"
            
    }

            
    // Carryables
            
    "weapon_gnome"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "weapon_cola_bottles"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "weapon_gascan"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "weapon_propanetank"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "weapon_oxygentank"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "weapon_fireworkcrate"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }

            
    // Upgrades
            
    "upgrade_laser_sight"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 255"
            
    }
            
    "upgrade_ammo_incendiary"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 255"
            
    }
            
    "upgrade_ammo_explosive"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 255"
            
    }

            
    // Others
            
    "weapon_ammo"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 255 255"
            
    }
            
    "survivor_death_model"
            
    {
                
    "enable"        "0"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "prop_health_cabinet"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "0 255 0"
            
    }
            
    "prop_fuel_barrel"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "prop_car_alarm"
            
    {
                
    "enable"        "0"
                "random"        "1"
                "color"         "255 255 255"
            
    }
            
    "prop_physics"
            
    {
                
    "enable"        "0"
                "random"        "1"
                "color"         "255 255 255"
            
    }

            
    // Miniguns
            
    "prop_minigun"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 255 255"
            
    }
            
    "prop_mounted_machine_gun"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 255 255"
            
    }
            
    "prop_minigun_l4d1"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 255 255"
            
    }

            
    // Melees - Slot 2
            
    "weapon_chainsaw"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "weapon_melee"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
        }

        
    "melees"
        
    {
            
    "fireaxe"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "frying_pan"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "machete"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "baseball_bat"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "crowbar"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "cricket_bat"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "tonfa"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "katana"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "electric_guitar"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "knife"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "golfclub"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "pitchfork"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "shovel"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
            
    "riotshield"
            
    {
                
    "enable"        "1"
                "random"        "1"
                "color"         "255 0 0"
            
    }
        }

    Admin Commands
    • sm_glowinfo => Outputs to the chat the glow info about the entity at your crosshair. (z flag required)
    • sm_glowreload => Reload the glow configs. (z flag required)
    • sm_glowremove => Remove plugin glow from entity at crosshair. (z flag required)
    • sm_glowremoveall => Remove all glows created by the plugin. (z flag required)
    • sm_glowadd => Add glow (with default config) to entity at crosshair. (z flag required)
    • sm_glowall => Add glow (with default config) to everything possible. (z flag required)
    • sm_print_cvars_l4d2_random_glow_item => Print the plugin related cvars and their respective values to the console. (z flag required)

    Change Log

    Spoiler


    Notes
    • Not all entities are able to glow.
    • There isn't an option to make the glow team-based (and I won't support it, only works with cl_fullupdate command when changing teams).
    • The color brightness algorithm maybe need a better calculation. It is used to minimize the number of entities with a weak color that you almost can't see.
    • Hand-equipped items can only glow in the default glow, so the glow is removed while equipping it and restored when dropped.

    Thank you!

    Related Plugins

    Post Reply
    • Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.

    Installation
    • Put the "l4d2_random_glow_item.cfg" file in your "\addons\sourcemod\data\" folder.
    • Put the "l4d2_random_glow_item.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.
    Attached Files
    File Type: cfg l4d2_random_glow_item.cfg (11.1 KB, 750 views)
    File Type: sp Get Plugin or Get Source (l4d2_random_glow_item.sp - 239 views - 44.6 KB)
    __________________

    Last edited by Marttt; 12-02-2023 at 10:32.
    Marttt is offline
    Mi.Cura
    Veteran Member
    Join Date: Dec 2016
    Location: Brazil
    Old 01-01-2021 , 09:55   Re: [L4D2] Random Glow Item [v1.0.0 | 31-December-2020]
    Reply With Quote #2

    Nice plugin Marttt, Thank you for sharing this...
    __________________
    Mi.Cura | Modded Servers | L4D2
    https://steamcommunity.com/groups/micuramodzombie
    Mi.Cura is offline
    user2000
    Member
    Join Date: Nov 2015
    Location: Peru - Lima
    Old 01-01-2021 , 12:47   Re: [L4D2] Random Glow Item [v1.0.0 | 31-December-2020]
    Reply With Quote #3

    after grabbing a pipe bomb or molotov the glow remains there ... or is it the plugin?
    in the case of pills the shine disappears
    user2000 is offline
    Kai0205
    Member
    Join Date: Sep 2017
    Old 01-01-2021 , 15:07   Re: [L4D2] Random Glow Item [v1.0.0 | 31-December-2020]
    Reply With Quote #4

    Can I see through the wall how to turn off?

    Kai0205 is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 01-05-2021 , 13:42   Re: [L4D2] Random Glow Item [v1.0.1 | 05-January-2021]
    Reply With Quote #5

    Answering some questions:
    Quote:
    Can I see through the wall how to turn off?
    1) You can change the glow type attribute to "2", which will glow only when you are able to see the entity, but that doesn't work for all entities, is a game behaviour, nothing that I am able to fix.
    2) You can decrease the glowing range with the minrange and maxrange attributes. You still will be able to see through walls but with a decreased range.
    __________________

    Last edited by Marttt; 08-01-2021 at 14:22.
    Marttt is offline
    a2121858
    Member
    Join Date: Sep 2020
    Old 01-08-2021 , 03:33   Re: [L4D2] Random Glow Item [v1.0.1 | 05-January-2021]
    Reply With Quote #6

    Hi, marttt. You didn't judge whether /g_hCvar_ScavengeGascan/ is enabled in /OnNextFrame/ .
    a2121858 is offline
    SDArt
    Member
    Join Date: Aug 2019
    Old 01-16-2021 , 23:38   Re: [L4D2] Random Glow Item [v1.0.2 | 08-January-2021]
    Reply With Quote #7

    When players or bots use weapons that you grabbed before- these weapons will glow on it's hands is this normal?
    Also how can i disable glows on mounted guns?
    SDArt is offline
    Striker black
    Member
    Join Date: Apr 2013
    Old 09-27-2021 , 17:38   Re: [L4D2] Random Glow Item [v1.0.5 | 12-September-2021]
    Reply With Quote #8

    Tested for hours and works perfectly.
    __________________
    --------------------------------------
    Striker black is offline
    leaffan
    Senior Member
    Join Date: Jan 2013
    Old 06-15-2023 , 15:43   Re: [L4D2] Random Glow Item [v1.0.7 | 29-May-2022]
    Reply With Quote #9

    There is such a mistake. I am taking the object, but its color still doesn't disappear. It seems like it's there, but there is actually no such object.

    IMAGE :

    https://ibb.co/WvzH8hf



    Note : "// "type" -> Glow type. "0" = OFF, "1" = OnUse (doesn't works), "2" = OnLookAt (doesn't works well for some entities), "3" = Constant (better results but visible through walls)."

    I am using Type 2 because I don't want objects to be visible through walls. Have you tried Type 3? Is there no such error there? However, I didn't choose Type 3 because objects would still be visible through walls.
    leaffan is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 06-15-2023 , 16:52   Re: [L4D2] Random Glow Item [v1.0.7 | 29-May-2022]
    Reply With Quote #10

    Try with "3" and check if the issue persists, unfortunately glow stuff in L4D2 is very glitchy (specially the type 2).
    If still bugs, I will need the map and position to "simulate".
    Can't do much to fix the 2 type because the engine was badly coded.
    __________________
    Marttt is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


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


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