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

[L4D2] ScavengeBotsDS


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Xanaguy
Senior Member
Join Date: Jan 2017
Plugin ID:
6282
Plugin Version:
2.0
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    The bots now have extended GasCan Scavenging compatibility (and smarter/more logical behavior)
    Old 09-29-2018 , 21:16   [L4D2] ScavengeBotsDS
    Reply With Quote #1

    This branch of the revolutionary "ScavengeBots" by Machine allows for bots to be able to scavenge cans in more maps that were originally incompatible with more appropriate behavior regarding Scavenging. Please read everything to become familiar with its changes, some things may show up as bugs when it's really not.

    Major Change:

    - ScavengeBotsDS is now merged into one sole plugin once again. Additional details have been listed below

    Summary:

    - Bots will now scavenge in all maps where they are able. They will (and should) start immediately once the gascan progress display is visible on the HUD. Finales/Scavenge Events without the scavenge progress display (non-existing, for whatever reason) will not prompt bots to scavenge gascans.

    - Bots will immediately stop scavenging cans when the goal is reached (when the display disappears or when the escape vehicle is either inbound or available). They will then resume following the player or proceed on their own (as an all bot team) once the area is clear.

    - There will now be three .cfg files that must be installed in sourcemod/data. ScavengeBotsDS will focus on Coop/Versus non-finale instances. ScavengeFinaleBotsDS will handle Finale based instances (including Dark Carnival Remix). And ScavengeGameBotsDS will focus on all Scavenge game mode maps. Addon maps can still be added in the proper format and appropriate file to test and experiment with.

    - For more information, please check the original Scavengebots plugin linked above.

    How does ScavengeBotsDS differ from its original counterpart?:

    - This branch doesn't check if an entity with the specific name of "trigger_finale" is a certain "type" [(type == 4)] when the finale starts. Instead, it checks if the Gas Can Progress HUD exists as this is more relevant to Scavenging events/finales.

    - This branch also has many events linked to bots being able to scavenge when the progress is visible. They will now help out on (almost) every instance possible.

    - This version will now be able to target up to one non-finale nozzle and one finale nozzle per map.

    - Lastly, this plugin will force the bots to stop collecting cans when the goal is reached. This is to stop bots from getting extra cans when it's time to proceed in the map. (Special cases are listed below)

    ScavengeBotsDS Changelog:

    - This plugin has reached maximum potential and should be compatible with "Pour Gas" by Silvers and "Chainsaw Refueling" by DJ_West and almost every scavenging related map.

    - After taking Lux's advice and Timocop's implementation, memory leaks have now been removed.

    - Fixed any and all finales that trips the game events "finale_vehicle_ready" and "instructor_server_hint_create" at the same time. (This is mostly the case for "Welcome To Hell" in Single-Player.)

    - Fixed bots getting gascans on maps that were not registered (Mostly Badwater Basin).

    - (Scavenge) Fixed bots continuing to grab gas cans on "scavenge_round_start" even though the map was not registered in the .cfg

    - Merged functionality back into one plugin. ScavengeBotsDS is now omni-compatible on it's own for almost every scavenging instance.

    - Re-arraged some coding/functions to prevent errors from being spammed into the console when a bot reaches a certain goal. Functionality should still be the same.

    - New bool to stop bots from taking gas cans and running off when the escape is available.

    - Bugfixes, added blacklist of completely incompatible scavenge maps.

    - Ensured Bots will activate properly for those using sourcemod locally.

    - 8/10/19: Fixed all possible Scavenge matches so that bots will no longer refuse to collect cans when the round ends (and the teams swap).

    - Added a bunch of valid maps in their appropriate cfg file.

    - 8/15/19: Fixed Urban Flight finale (and any other similar instances). A rare bug indeed.

    - 8/27/19: Bots that are in Critical Condition (has greyed out vision) will no longer attempt to collect gascans. In order for them to collect gascans again, they must either get healed by a human ally (other bots will still attempt to get gascans while they're healthy), or heal themselves. Also improved bot check.


    Demonstrations of maps that were originally unsupported:

    Dead City II, White Forest, Urban Flight, Farewell Chenming, Journey to Splash Mountain, Gone in 60 Smokers, Fatal Freight.

    Notes:

    Please remove the original "ScavengeBots" plugin from the "sourcemod/plugins" folder if it's present there to avoid issues from the two plugins.

    Please also remove all other .smx files of "ScavengeBots" from the plugin folder before installing for the same reason above

    If you think a map is incompatible in a way that the bots will not be able to secure gas cans (i.e. Badwater Basin), please remove the map entry from the proper .cfg file. Any scavenging related maps that aren't in the .cfg will NOT prompt bots to scavenge gas cans at all. This is to prevent bots from carrying said cans away from the objective and giving the players unnecessary stress.

    There may be times where a bot will start pouring their gas can at the same time when the escape is available. This will prompt bots to resume scavenging as normal until there's no more gas cans. (This only applies to campaign maps that have extra gas cans)

    Compatibility:

    The Scavenge game mode will work on any map unless it is a map with multiple nozzles in the same scenario type.
    Sadly, this list is incomplete. If you notice that any campaign/map that has scavenging is not on this list, please let me know so I can include it.

    Compatible campaigns:
    1. BOT - Battle with Ogress Toys
    2. Claustrophobia
    3. Dark Blood 2
    4. Day Break
    5. Dark Carnival: Remix
    6. Dead City II
    7. Death Sentence
    8. Downtown Dine
    9. Farewell Chenming
    10. Fatal Freight
    11. Gone in 60 smokers
    12. IMPJAW C1
    13. Infection Overdrive
    14. Journey to Splash Mountain - Do not let bots carry the gas can until it is full.
    15. Last Ride
    16. Leaving Home
    17. Left 4 Bowl
    18. LostSchool - The first gas can must be picked up.
    19. Military Industrial Complex II
    20. Plan B (hiding finale)
    21. Precinct 84
    22. Precinct 84 ( 2018 )
    23. Resident Evil 3 - Has 3 nozzles. The bots will only focus on one of them. Will possibly include soon.
    24. Road To Nowhere 2
    25. Urban Flight - Bots will attempt to get gas cans before finale starts, they will stop when the first tank dies.
    26. Welcome to Hell
    27. White Forest
    28. Yama
    Incompatible campaigns:
    1. Badwater Basin - The goal moves...
    2. Complex Course - The Gas Can Progress HUD doesn't exist...
    3. DE_Prodigy - The Gas Can Progress HUD doesn't exist...
    4. Left or Right - The Gas Can Progress HUD doesn't exist...
    Attached Files
    File Type: sp Get Plugin or Get Source (scavengebotsds.sp - 5913 views - 31.1 KB)
    File Type: zip ScavengeBotsDS - Data Pack.zip (5.8 KB, 3385 views)

    Last edited by Xanaguy; 04-05-2020 at 01:36.
    Xanaguy is offline
    Xanaguy
    Senior Member
    Join Date: Jan 2017
    Old 09-30-2018 , 03:05   Re: [L4D2] ScavengeBotsDS (Improved)
    Reply With Quote #2

    Updated. There's literally only two things that are needed for this plugin to become perfect. Enjoy!
    Xanaguy is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 09-30-2018 , 04:20   Re: [L4D2] ScavengeBotsDS (Improved)
    Reply With Quote #3

    Quote:
    Originally Posted by Timocop View Post
    You should avoid all "script" cmds, they leak very badly and fill up ram because they create a new instance all the time. Use the logic_script entity instead, they wont leak.

    Heres my stock i made:
    PHP Code:
    /**
    * Runs a single line of vscript code.
    * NOTE: Dont use the "script" console command, it startes a new instance and leaks memory. Use this instead!
    *
    * @param sCode        The code to run.
    * @noreturn
    */
    stock L4D2_RunScript(const String:sCode[], any:...)
    {
        static 
    iScriptLogic INVALID_ENT_REFERENCE;
        if(
    iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic)) {
            
    iScriptLogic EntIndexToEntRef(CreateEntityByName("logic_script"));
            if(
    iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic))
                
    SetFailState("Could not create 'logic_script'");
            
            
    DispatchSpawn(iScriptLogic);
        }
        
        static 
    String:sBuffer[512];
        
    VFormat(sBuffersizeof(sBuffer), sCode2);
        
        
    SetVariantString(sBuffer);
        
    AcceptEntityInput(iScriptLogic"RunScriptCode");

    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Xanaguy
    Senior Member
    Join Date: Jan 2017
    Old 09-30-2018 , 16:33   Re: [L4D2] ScavengeBotsDS (Improved)
    Reply With Quote #4

    Updated: Thanks, Lux and Timocop. I still need to add a check for an all bot team for finales (as an else) and maybe mid-campaign scavenging (which should work wonders with my Autotrigger).
    Xanaguy is offline
    Xanaguy
    Senior Member
    Join Date: Jan 2017
    Old 09-30-2018 , 18:09   Re: [L4D2] ScavengeBotsDS (Improved)
    Reply With Quote #5

    Updated again: I had a fix that I forgot I removed, it's been reintroduced.
    Xanaguy is offline
    Xanaguy
    Senior Member
    Join Date: Jan 2017
    Old 10-01-2018 , 03:29   Re: [L4D2] ScavengeBotsDS (Improved)
    Reply With Quote #6

    Updated: If anyone wishes to help me on my final request for this plugin, please see the additional notes at the bottom of the original post. This may be the final update for now.
    Xanaguy is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 10-01-2018 , 03:53   Re: [L4D2] ScavengeBotsDS (Improved)
    Reply With Quote #7

    Quote:
    Originally Posted by Xanaguy View Post
    Updated: If anyone wishes to help me on my final request for this plugin, please see the additional notes at the bottom of the original post. This may be the final update for now.
    (game_scavenge_progress_display)CScavengeProg ressDisplay
    Has an entprop called
    "m_bActive"
    we can do a simple if statment here just an example i'v not tried it but i guess this is a sendprop it is transmitted to clients.
    PHP Code:
    if(GetEntProp(entityProp_Send"m_bActive"1))
       
    bScavengeActive true;
    else
       
    bScavengeActive false
    or like this
    PHP Code:
    bScavengeActive GetEntProp(entityProp_Send"m_bActive"1); 
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D

    Last edited by Lux; 10-01-2018 at 03:59. Reason: Im so bad
    Lux is offline
    Xanaguy
    Senior Member
    Join Date: Jan 2017
    Old 10-01-2018 , 05:28   Re: [L4D2] ScavengeBotsDS (Improved)
    Reply With Quote #8

    Quote:
    Originally Posted by Lux View Post
    (game_scavenge_progress_display)CScavengeProg ressDisplay
    Has an entprop called
    "m_bActive"
    we can do a simple if statment here just an example i'v not tried it but i guess this is a sendprop it is transmitted to clients.
    PHP Code:
    if(GetEntProp(entityProp_Send"m_bActive"1))
       
    bScavengeActive true;
    else
       
    bScavengeActive false
    or like this
    PHP Code:
    bScavengeActive GetEntProp(entityProp_Send"m_bActive"1); 
    The first set of code greatly helps, but bScavengeInProgress is still set to true when the goal is reached for when the display is disabled. I tried timers, but they required a new entity altogether, which kinda ruined the original plan. Or is there something I'm missing? Once I'm done with that, this plugin is aced.

    Edit 1: Got it, never mind.

    Last edited by Xanaguy; 10-01-2018 at 05:48. Reason: Issue resolved
    Xanaguy is offline
    Xanaguy
    Senior Member
    Join Date: Jan 2017
    Old 10-01-2018 , 06:08   Re: [L4D2] ScavengeBotsDS (Improved)
    Reply With Quote #9

    Update: This plugin should be fully upgraded, rendering the original plugin obsolete. Thanks once again, Machine, for providing the original, brilliant plugin!

    Last edited by Xanaguy; 10-01-2018 at 06:08.
    Xanaguy is offline
    Xanaguy
    Senior Member
    Join Date: Jan 2017
    Old 10-01-2018 , 14:23   Re: [L4D2] ScavengeBotsDS (Improved)
    Reply With Quote #10

    Final Update(?): Fixed an instance of some finales triggering the available rescue and creating a game instructor hint at the same time prompting bots to scavenge cans again (if the progress display is there), this plugin should be 100% aced now.
    Xanaguy 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 16:08.


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