Raised This Month: $32 Target: $400
 8% 

[L4D2] Weapons Skins RNG [v1.1.1 | 05-February-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Plugin ID:
7307
Plugin Version:
1.1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    1000 
    Plugin Description:
    Applies random skins to spawned weapons
    Old 09-29-2020 , 11:10   [L4D2] Weapons Skins RNG [v1.1.1 | 05-February-2024]
    Reply With Quote #1

    L4D2 ONLY

    Description

    With the L4D2 Last Stand update, some of the new things brought are new skins for weapons (e.g.: golden crowbar).

    This plugin applies random skins to spawned weapons.

    Features
    • Applies a random skin to weapon entities on spawn.
    • Allows equipping weapons with the same skin from the spawner entities. (e.g.: weapon_rifle_spawn)
    • Allows configuring which weapons should have RNG skin.
    • Ignore weapons that already have a skin different than default.

    Preview



    Note: This video is not mine. (Credits: Lucarbuncle)



    Cvars

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

    PHP Code:
    // Weapon skin RNG for Auto Shotgun.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_auto_shotgun "1"

    // Weapon skin RNG for Cricket Bat melee.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_cricket_bat "1"

    // Weapon skin RNG for Crowbar melee.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_crowbar "1"

    // Enable/Disable the plugin.
    // Note: Enabling this may glitch some plugins that checks the gascan skin to detect if is a scavenge one.
    // 0 = Disable, 1 = Enable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_enable "1"

    // Weapon skin RNG for Gascan.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_gascan "1"

    // Weapon skin RNG for Hunting Rifle.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_hunting_rifle "1"

    // Ignore weapons that already have a skin different than default.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_ignore_skin "1"

    // Weapon skin RNG for Pistol Magnum.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_pistol_magnum "1"

    // Weapon skin RNG for Pump Shotgun.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_pump_shotgun "1"

    // Weapon skin RNG for AK47 Rifle.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_rifle_ak47 "1"

    // Weapon skin RNG for M16 Rifle.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_rifle_m16 "1"

    // Weapon skin RNG for Chrome Shotgun.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_shotgun_chrome "1"

    // Weapon skin RNG for SMG Uzi.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_smg_uzi "1"

    // Weapon skin RNG for Silenced SMG.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_wskin_rng_smg_silenced "1" 
    Admin Commands
    • sm_wskin_rng => Scramble the weapon skins randomly in real time. (z flag required)
    • sm_print_cvars_l4d2_wskin_rng => Print the plugin related cvars and their respective values to the console. (z flag required)

    Change Log

    Spoiler


    Notes
    • The skin change was achieved by changing the weapon "m_nSkin" netprop value.
    • For spawner entities the "m_nWeaponSkin" is also changed to the same value.
    • If the map, by default, changes the skin of a weapon, this plugin won't prevent it.
    • When the weapon is already equipped (active) I had to apply the skin also to the "m_hViewModel" netprop, otherwise there is some delay on skins changes.
    • Not all weapons have new skins and some aren't so different from the original one.
    • The currently supported weapons are:
      Melees: Crowbar, Cricket Bat
      Pistols: Magnum
      SMGs: Uzi; Silenced
      Shotguns: Pump; Chrome; Auto
      Rifles: M16; AK47
      Sniper: Hunting Rifle
      Gascan
    • These weapons have 2 new skins: Magnum; M16; AK47, the others just 1.
    • Total of 14 new skins from 11 weapons.
    • The gas can skin isn't affected by this plugin.
    • By now, 29-September-2020, there are no more skins available.
    • The plugin may not work properly for clients that use addons to change the weapon appearance.
    • Enabling gascan RNG skin may glitch some plugins that check the skin to detect if is a scavenge one.
    • I don't know if it conflicts with the "Golden Crowbar" achievement.

    To Do
    • Create a config to select the % chance to apply a different skin.

    Thank you!
    • Alex Alcalá - for testing in his server and reporting some bugs.
    • Tonblader - for testing in his server and reporting some bugs.
    • larrybrains - for requesting a cvar to control which weapons should RNG.
    • Krufftys Killers - for reporting an issue.
    • TrevorSoldier - for requesting the gascan skin.
    • Toranks - for reporting gascan skin not working on pickup.
    • ryzewash - for reporting skins not working on prop_physics gascans and for the snippet code to fix gascan skin on pickup.
    • HarryPotter - for reporting errors and requesting a cvar to ignore weapons with skin.

    Related Plugins

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

    Installation
    • Put the "l4d2_wskin_rng.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_wskin_rng.sp - 157 views - 28.3 KB)
    __________________

    Last edited by Marttt; 02-05-2024 at 10:13.
    Marttt is offline
    AlexAlcala
    Member
    Join Date: May 2019
    Location: Perú
    Old 09-29-2020 , 11:13   Re: [L4D2] Weapons Skins RNG
    Reply With Quote #2

    Marttt <3 good plugin
    AlexAlcala is offline
    Mi.Cura
    Veteran Member
    Join Date: Dec 2016
    Location: Brazil
    Old 09-29-2020 , 17:25   Re: [L4D2] Weapons Skins RNG [v1.0.0 | 29-September-2020]
    Reply With Quote #3

    Great job my friend..
    __________________
    Mi.Cura | Modded Servers | L4D2
    https://steamcommunity.com/groups/micuramodzombie
    Mi.Cura is offline
    Sev
    Veteran Member
    Join Date: May 2010
    Old 09-29-2020 , 17:29   Re: [L4D2] Weapons Skins RNG [v1.0.0 | 29-September-2020]
    Reply With Quote #4

    One way this could be improved even further, either with this plugin or the menu plugin (probably makes more sense for the menu plugin) is adding a cookie similar to what's seen with survivor chat select for the characters. Only here, the server would remember what skin you chose for the weapons you decided to choose them for.

    Last edited by Sev; 09-29-2020 at 17:30.
    Sev is offline
    AK978
    Senior Member
    Join Date: Jun 2018
    Old 09-29-2020 , 18:58   Re: [L4D2] Weapons Skins RNG [v1.0.0 | 29-September-2020]
    Reply With Quote #5

    L 09/30/2020 - 06:45:43: [SM] Blaming: l4d_wskin_rng.smx
    L 09/30/2020 - 06:45:43: [SM] Call stack trace:
    L 09/30/2020 - 06:45:43: [SM] [0] GetEventInt
    L 09/30/2020 - 06:45:43: [SM] [1] Line 345, l4d_wskin_rng.sp::Event_SpawnerGiveItem
    L 09/30/2020 - 06:45:44: [SM] Exception reported: Invalid game event handle 0 (error 4)
    AK978 is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 09-30-2020 , 09:30   Re: [L4D2] Weapons Skins RNG [v1.0.0 | 29-September-2020]
    Reply With Quote #6

    error.log
    Quote:
    L 09/30/2020 - 21:07:19: [SM] Exception reported: Invalid game event handle 0 (error 4)
    L 09/30/2020 - 21:07:19: [SM] Blaming: l4d_wskin_rng.smx
    L 09/30/2020 - 21:07:19: [SM] Call stack trace:
    L 09/30/2020 - 21:07:19: [SM] [0] GetEventInt
    L 09/30/2020 - 21:07:19: [SM] [1] Line 355, l4d_wskin_rng.sp::Event_SpawnerGiveItem
    L 09/30/2020 - 21:07:19: [SM] Exception reported: Invalid game event handle 0 (error 4)
    L 09/30/2020 - 21:07:19: [SM] Blaming: l4d_wskin_rng.smx
    L 09/30/2020 - 21:07:19: [SM] Call stack trace:
    L 09/30/2020 - 21:07:19: [SM] [0] GetEventInt
    L 09/30/2020 - 21:07:19: [SM] [1] Line 355, l4d_wskin_rng.sp::Event_SpawnerGiveItem
    Perhaps don't use EventHookMode_PostNoCopy?
    PHP Code:
    HookEvent("spawner_give_item"Event_SpawnerGiveItemEventHookMode_PostNoCopy); 
    __________________

    Last edited by HarryPotter; 09-30-2020 at 09:34.
    HarryPotter is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 09-30-2020 , 09:59   Re: [L4D2] Weapons Skins RNG [v1.0.0 | 29-September-2020]
    Reply With Quote #7

    This is awesome, Marttt! I was waiting for someone to make a plugin like this. Great job!
    __________________
    Psyk0tik is offline
    foxhound27
    AlliedModders Donor
    Join Date: Sep 2019
    Location: Argentina
    Old 09-30-2020 , 15:41   Re: [L4D2] Weapons Skins RNG [v1.0.0 | 29-September-2020]
    Reply With Quote #8

    great job Mart ♥

    Last edited by foxhound27; 09-30-2020 at 16:06. Reason: ;D
    foxhound27 is offline
    Mr. Man
    Veteran Member
    Join Date: Mar 2011
    Location: Huh?
    Old 10-01-2020 , 12:28   Re: [L4D2] Weapons Skins RNG [v1.0.2 | 30-September-2020]
    Reply With Quote #9

    FYI the .cfg file has a text error: should be 0 for disabled and 1 for enabled. You have the same small problem in the Weapon Skin Menu thread.
    __________________
    Mr. Man is offline
    Smoak
    Junior Member
    Join Date: Dec 2019
    Location: Maine
    Old 10-20-2020 , 23:00   Re: [L4D2] Weapons Skins RNG [v1.0.2 | 30-September-2020]
    Reply With Quote #10

    It's not really working for me, like, it never chooses any skins for the tier 1 guns and the tier 2 guns rarely get their skins in either. Is there a way to like, configure the likeliness that one skin appears compared to the other??
    Smoak is offline
    Reply



    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 01:15.


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