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

[L4D & L4D2] Christmas Tree (1.9) [28-Jan-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6798
Plugin Version:
1.9
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    14 
    Plugin Description:
    Spawns gift packages under a Christmas Tree.
    Old 11-07-2019 , 12:00   [L4D & L4D2] Christmas Tree (1.9) [28-Jan-2024]
    Reply With Quote #1





    Related Plugins:


    Thanks:
    • Dragokas for the idea and request, L4D1 saved spawn data and lots of help testing.



    About:
    • Spawn single gifts or trees either temporary or saved to the map.
    • Gifts can break and spawn an item or weapon.
    • L4D is missing the L4D2 gift model and uses a crate.
    • Aim at the Gnome to delete, edit position and angles. The tree is non-solid.
    • Maximum of 2 trees per map. Gifts are limited to 32. Recompile to change limits.
    • Trees (with default settings) use approx 45 entities (2 models + 6 gifts + 1 spark + 4 lights + 32 sprites). On explosion about 8 temporary entities.
    • It's not a CPU intensive plugin for the server. Rainbow option will increase bandwidth slightly.
    • Optionally adds dissolve effects to gifts when detecting l4d_dissolve_infected.txt gamedata. Can be disabled with l4d_tree_effects cvar.
    • This plugin is large because of the effects stocks, spawning capability and all the options with that.
    • Fully handles late loading, unloading, turning on/off and deletes unused items.
    • Recommended additional plugins: Neon Beams for decorations. Weather Control or xMas for snow.
    • Optional data config provided with trees saved to every Valve map. Thanks to "Dragokas" for the L4D1 data.



    Gifts Drop Chances:
    • Weighted chance for item and weapon selection on gift breaking.
    • L4D1 auto ignores chances for L4D2 items and weapons.
    • Each value in the l4d_tree_items cvar represents the chance of each specific item or weapon dropping from 0 to 100%.
    • The order is as follows, includes example cvars for no weapons:
      Spoiler



    Admin Commands: (requires "z" flag)

    PHP Code:
    sm_tree_spawn    // Spawns a temporary Gift/Tree at your crosshair. Usage: sm_tree_spawn [type: 0=Gift. 1=Tree.]
    sm_tree_save     // Spawns a Gift/Tree at your crosshair and saves to config. Usage: sm_tree_save [type: 0=Gift. 1=Tree.]
    sm_tree_del      // Removes the Gift/Tree you are pointing at and deletes from the config if saved.
    sm_tree_clear    // Removes all Gifts/Trees spawned by this plugin from the current map.
    sm_tree_wipe     // Removes all Gifts/Trees from the current map and deletes them from the config.
    sm_tree_reload   // Resets the plugin and reloads the data config and saved spawns.
    sm_tree_glow     // Toggle to enable glow on all Gifts/Trees to see where they are placed.
    sm_tree_list     // Display a list Gift/Tree positions and the total number of.
    sm_tree_tele     // Teleport to a Gift/Tree (Usage: sm_tree_tele <index: 1 to MAX_SPAWNS (32)>).
    sm_tree_ang      // Displays a menu to adjust the Gift/Tree angles your crosshair is over.
    sm_tree_pos      // Displays a menu to adjust the Gift/Tree origin your crosshair is over. 



    CVars:

    Saved to l4d_christmas_tree.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    l4d_tree_allow           "1"          // 0=Plugin off, 1=Plugin on.
    l4d_tree_modes           ""           // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d_tree_modes_off       ""           // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d_tree_modes_tog       "0"          // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d_tree_ball_count      "8"          // How many balls to display per column.
    l4d_tree_ball_columns    "4"          // How many columns of balls to display.
    l4d_tree_ball_radius     "45.0"       // Distance from the tree base to display balls
    l4d_tree_col_gift        "255 0 0"    // Gift color. 0=Off (default Gift color). Three values between 0-255 separated by spaces. RGB: Red Green Blue.
    l4d_tree_col_tree        "0 255 0"    // Tree color. 0=Off (default Tree color). Three values between 0-255 separated by spaces. RGB: Red Green Blue.
    l4d_tree_effects         "31"         // 0=Off. 1=Lights, 2=Balls, 4=Sparks, 8=Dissolver (gifts), 16=Smoke (gifts - may cause rare crash on servers), 31=All. Add numbers together.
    l4d_tree_gifts           "6"          // How many packages to spawn under the tree.
    l4d_tree_items           "80,100,25,25,25,40,15,15,15,2,2,2,5,5,5,2,5,1,1,2,0,2,5,0,0,2,0,5,1,5" // Item chance. See above for details.
    l4d_tree_melee           "0,0,0,10,0,0,0,50,50,0,50,10,10" // Melee weapon chance - values must be comma separated: Axe, Baseball Bat, Cricket Bat, Crowbar, Frying Pan, Golf Club, Guitar, Katana, Machete, Nightstick, Knife, Pitchfork, Shovel.
    l4d_tree_glow            "255 0 0"    // 0=Off. L4D2 only: glow outline on gifts. Three values between 0-255 separated by spaces. RGB: Red Green Blue.
    l4d_tree_health          "1"          // 0=Does not break or drop items. Health of gifts before they can break and drop items.
    l4d_tree_rainbow         "2"          // 0=Off. 1=Gifts change color over time. 2=Trees change color over time. 3=Both
    l4d_tree_rate            "10"         // How fast the color changes when using rainbow option.
    l4d_tree_speed           "0.2"        // How often to update the colors per second.
    l4d_tree_version                      // Christmas Tree plugin version. 



    Changes:
    Code:
    1.9 (28-Jan-2024)
        - Fixed memory leak caused by clearing StringMap/ArrayList data instead of deleting.
    
    1.8 (30-Jul-2022)
        - Changed cvar "l4d_tree_effects" to turn gifts smoke on or off. This may fix a random rare server crash. Thanks to "Hawkins" for reporting.
    
    1.7 (06-Dec-2021)
        - L4D2: Added cvar "l4d_tree_melee" to control melee type spawn chance. Requested by "CaRmilla".
        - L4D2: Modified cvar "l4d_tree_items" adding an entry to the end for melee chance spawn.
        - Changes to fix warnings when compiling on SourceMod 1.11.
    
    1.6 (30-Sep-2020)
        - Fixed compile errors on SM 1.11.
    
    1.5 (10-May-2020)
        - Blocked glow command from L4D1 which does not support glows.
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
        - Various changes to tidy up code.
    
    1.4 (01-Apr-2020)
        - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
    
    1.3 (19-Dec-2019)
        - Versus gamemodes now spawn the same items for both teams.
    
    1.2 (07-Nov-2019)
        - Fixed incorrect gamedata path not loading dissolve if available.
    
    1.1 (07-Nov-2019)
        - Fixed gamedata missing error.
        - Fixed gifts spawning in the ground in L4D1.
    
    1.0 (07-Nov-2019)
        - Initial release.


    Installation
    1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    2. Optionally download "l4d_christmas_tree.cfg" and save to your servers \addons\sourcemod\data\ folder. This has trees saved to every Valve map.
    Attached Files
    File Type: cfg l4d_christmas_tree.cfg (13.0 KB, 2184 views)
    File Type: sp Get Plugin or Get Source (l4d_christmas_tree.sp - 140 views - 66.5 KB)
    __________________

    Last edited by Silvers; 01-28-2024 at 02:14.
    Silvers is offline
    phoenix0001
    Senior Member
    Join Date: Apr 2010
    Location: China
    Old 11-07-2019 , 13:24   Re: [L4D & L4D2] Christmas Tree (1.0) [07-Nov-2019]
    Reply With Quote #2

    L 11/08/2019 - 02:23:57: SourceMod error session started
    L 11/08/2019 - 02:23:57: Info (map "c5m1_waterfront_sndscape") (file "E:\1L4D2\left4dead2\addons\sourcemod\logs\er rors_20191108.log")
    L 11/08/2019 - 02:23:57: [SM] Error parsing gameconfig file "E:\1L4D2\left4dead2\addons\sourcemod\gamedat a\l4d_dissolve_infected.txt":
    L 11/08/2019 - 02:23:57: [SM] Error 1 on line 0, col 0: Stream failed to open
    L 11/08/2019 - 02:23:57: [SM] Exception reported: Unable to open l4d_dissolve_infected: File could not be opened: 系统找不到指定的文件。


    L 11/08/2019 - 02:23:57: [SM] Blaming: l4d_christmas_tree.smx
    L 11/08/2019 - 02:23:57: [SM] Call stack trace:
    L 11/08/2019 - 02:23:57: [SM] [0] LoadGameConfigFile
    L 11/08/2019 - 02:23:57: [SM] [1] Line 195, E:\1L4D2\left4dead2\addons\sourcemod\scriptin g\l4d_christmas_tree.sp::OnPluginStart
    L 11/08/2019 - 02:23:57: [SM] Unable to load plugin "l4d_christmas_tree.smx": Error detected in plugin startup (see error logs)
    __________________
    I like this BBS sharing of spirit

    I come from China, my English is poor
    phoenix0001 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 11-07-2019 , 14:47   Re: [L4D & L4D2] Christmas Tree (1.0) [07-Nov-2019]
    Reply With Quote #3

    Quote:
    Originally Posted by phoenix0001 View Post
    -
    Thanks updated.
    __________________
    Silvers is offline
    KRUTIK
    Senior Member
    Join Date: Feb 2019
    Location: Мос
    Old 11-08-2019 , 23:50   Re: [L4D & L4D2] Christmas Tree (1.2) [07-Nov-2019]
    Reply With Quote #4

    Cool as always, thanks.
    KRUTIK is offline
    Voevoda
    Senior Member
    Join Date: Aug 2016
    Old 11-18-2019 , 21:10   Re: [L4D & L4D2] Christmas Tree (1.2) [07-Nov-2019]
    Reply With Quote #5

    Hi @Silvers add more snow
    Voevoda is offline
    Arthedains
    Junior Member
    Join Date: Nov 2016
    Location: Europe
    Old 12-07-2019 , 18:18   Re: [L4D & L4D2] Christmas Tree (1.2) [07-Nov-2019]
    Reply With Quote #6

    Nevermind. My friend found his problem he had unrelated to the plugin. Everything is working fine. Thank you for your contribution to these great games

    Last edited by Arthedains; 12-13-2019 at 14:14.
    Arthedains is offline
    foxhound27
    AlliedModders Donor
    Join Date: Sep 2019
    Location: Argentina
    Old 12-10-2019 , 22:15   Re: [L4D & L4D2] Christmas Tree (1.2) [07-Nov-2019]
    Reply With Quote #7

    i love it, thank you!! btw it is possible to add any

    railroad_light_blink1
    railroad_light_blink3
    railroad_light_blink2
    railroad_light_blink4

    particle to it?

    Last edited by foxhound27; 12-11-2019 at 10:54. Reason: wrong particle
    foxhound27 is offline
    larrybrains
    Senior Member
    Join Date: May 2017
    Old 12-17-2019 , 20:14   Re: [L4D & L4D2] Christmas Tree (1.2) [07-Nov-2019]
    Reply With Quote #8

    Fun plugin! It's working great on my server, but I was wondering if you would be able to add an option that spawns the same gift items for each team in versus?
    larrybrains is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 12-18-2019 , 21:17   Re: [L4D & L4D2] Christmas Tree (1.3) [19-Dec-2019]
    Reply With Quote #9

    Quote:
    Originally Posted by larrybrains View Post
    Fun plugin! It's working great on my server, but I was wondering if you would be able to add an option that spawns the same gift items for each team in versus?
    Done.

    Quote:
    1.3 (19-Dec-2019)
    - Versus gamemodes now spawn the same items for both teams.
    __________________
    Silvers is offline
    larrybrains
    Senior Member
    Join Date: May 2017
    Old 12-19-2019 , 14:02   Re: [L4D & L4D2] Christmas Tree (1.3) [19-Dec-2019]
    Reply With Quote #10

    Quote:
    Originally Posted by Silvers View Post
    Done.
    Much appreciated. Working great!
    larrybrains 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 09:11.


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