AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] ScavengeBotsDS (https://forums.alliedmods.net/showthread.php?t=311004)

Xanaguy 09-29-2018 21:16

[L4D2] ScavengeBotsDS
 
3 Attachment(s)
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...

Xanaguy 09-30-2018 03:05

Re: [L4D2] ScavengeBotsDS (Improved)
 
Updated. There's literally only two things that are needed for this plugin to become perfect. Enjoy!

Lux 09-30-2018 04:20

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by Timocop (Post 2585717)
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");




Xanaguy 09-30-2018 16:33

Re: [L4D2] ScavengeBotsDS (Improved)
 
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 09-30-2018 18:09

Re: [L4D2] ScavengeBotsDS (Improved)
 
Updated again: I had a fix that I forgot I removed, it's been reintroduced.

Xanaguy 10-01-2018 03:29

Re: [L4D2] ScavengeBotsDS (Improved)
 
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.

Lux 10-01-2018 03:53

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by Xanaguy (Post 2617573)
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); 


Xanaguy 10-01-2018 05:28

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by Lux (Post 2617577)
(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.

Xanaguy 10-01-2018 06:08

Re: [L4D2] ScavengeBotsDS (Improved)
 
Update: This plugin should be fully upgraded, rendering the original plugin obsolete. Thanks once again, Machine, for providing the original, brilliant plugin!

Xanaguy 10-01-2018 14:23

Re: [L4D2] ScavengeBotsDS (Improved)
 
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.

Psyk0tik 10-01-2018 17:30

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by Xanaguy (Post 2617659)
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.

50 updates later...

Lol jk

Great job! :D

Xanaguy 10-01-2018 19:40

Quote:

Originally Posted by Crasher_3637 (Post 2617678)
50 updates later...

Lol jk

Great job! :D

Thanks! If you know any maps that feature scavenging by either the Scavenge game mode, or at any point in Coop/Versus, please send me a list. I'll be happy to try everything out. (Cravenge had such a list that covered everything, but was lost... RIP)

No update: Just added the .cfg in case people are unable to find it. This goes in the "data" folder.

Xanaguy 10-05-2018 04:51

Re: [L4D2] ScavengeBotsDS (Improved)
 
Data Update: Fixed "Journey To Splash Mountain" Coordinates and angles from being right in the generator, which causes the bot carrying the single gas can from not being able to secure the gas. (They will still carry it even when empty, but it should be easier to yoink that can away from the survivor when at the generator.) I will add more campaign maps that feature scavenging when I find it. I will also appreciate any help in identifying campaigns that has scavenging on coop/versus at any point in the campaign.

DreadedGhoul575 10-05-2018 08:01

Re: [L4D2] ScavengeBotsDS (Improved)
 
Shame the bots barely heal or shoot when they're scavenging gascans; probably can't be fixed, but still good job with the improvement.

Xanaguy 10-05-2018 12:50

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by DreadedGhoul575 (Post 2618242)
Shame the bots barely heal or shoot when they're scavenging gascans; probably can't be fixed, but still good job with the improvement.

Yea... this plugin doesnít change the botsí behavior, it just makes more campaigns compatible with it.

DreadedGhoul575 10-05-2018 18:09

Re: [L4D2] ScavengeBotsDS (Improved)
 
It does make them a bit dumb, like the default one, but I guess that comes with a mod like this. More recommended with a player on the survivor team, since they struggle completely by their own as 4 bots.

Xanaguy 10-05-2018 19:48

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by DreadedGhoul575 (Post 2618392)
It does make them a bit dumb, like the default one, but I guess that comes with a mod like this. More recommended with a player on the survivor team, since they struggle completely by their own as 4 bots.

Maybe it's because they continue getting cans when a survivor is pinned by a SI. This plugin here will fix it. With this, the bots should be able to drop cans to save a survivor.

CarlWantsACar 10-06-2018 03:41

Re: [L4D2] ScavengeBotsDS (Improved)
 
where do i put cfg file? in the config maybe? :3

Xanaguy 10-06-2018 03:46

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by CarlWantsACar (Post 2618462)
where do i put cfg file? in the config maybe? :3

It goes in the sourcemod/data folder this time.

jamalsheref2 10-12-2018 18:16

Re: [L4D2] ScavengeBotsDS (Improved)
 
they still suck

Xanaguy 10-12-2018 19:26

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by jamalsheref2 (Post 2619423)
they still suck


Quote:

Originally Posted by Xanaguy (Post 2618301)
Yea... this plugin doesnít change the botsí behavior, it just makes more campaigns compatible with it.


bewbsftw 11-21-2018 05:43

Re: [L4D2] ScavengeBotsDS (Improved)
 
Dude, can you please add support for the campaign "Pasiri"

Xanaguy 11-21-2018 11:49

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by bewbsftw (Post 2625001)
Dude, can you please add support for the campaign "Pasiri"


Add the map you want in the .cfg along with the specific coordinates and angles you want the bots to pour the gas at.

You can find the mapís console name in the information text when you load up the map (in console). And you can get the coordinates and angles by positioning yourself by the gas nozzle (where to pour the gas) and enter (getpos_exact) in console.

bewbsftw 11-22-2018 02:53

Re: [L4D2] ScavengeBotsDS (Improved)
 
Ok, thanks! :D

Xanaguy 01-04-2019 14:28

Re: [L4D2] ScavengeBotsDS (Improved)
 
Data Update: Added "Dark Carnival: Remix" Chapter 5 in the .cfg file (This is only for the monorail objective and not the concert finale). If there are any maps, coop or Scavenge that I am able to add, please let me know.

Xanaguy 01-14-2019 19:19

Re: [L4D2] ScavengeBotsDS (Improved)
 
Plugin Update: Fixed Bots continuing to get gas cans and carrying them away on the Scavenge game mode (This applied to unregistered maps).

The plugin has been split into two branches. There should be no more issues with different nozzle locations or maps that have scavenging in both game modes.

Marttt 01-20-2019 08:58

Re: [L4D2] ScavengeBotsDS (Improved)
 
Is it possible to configure this for the bots to deliver the cola to the Dead Center 2 map?
It looks like the same "engine" but needs to check if the item is a cola and not a can of gasoline.

just an idea

Xanaguy 01-20-2019 13:03

Re: [L4D2] ScavengeBotsDS (Improved)
 
Quote:

Originally Posted by Marttt (Post 2635630)
Is it possible to configure this for the bots to deliver the cola to the Dead Center 2 map?
It looks like the same "engine" but needs to check if the item is a cola and not a can of gasoline.

just an idea

Iíve tried, many times. The bots will just stand there doing absolutely nothing until the colaís been delivered. I can try again since I havent tried everything though.

Xanaguy 02-12-2019 05:13

Re: [L4D2] ScavengeBotsDS (Improved)
 
To be honest, i havent suffered any crashes related to ScavengeBotsDS. In fact, the only times I would be crashing is if i was running something like Day Break or Yama or any campaign with a certain CI addon. Everything else is perfect.

DreadedGhoul575 03-16-2019 20:56

Re: [L4D2] ScavengeBotsDS (Improved)
 
Only error with this is that the bots don't defend themselves or heal.

Marttt 04-12-2019 09:35

Re: [L4D2] ScavengeBotsDS (Improved)
 
Here are some reports that I got from the error log,
The plugin is working fine (no problems), is just a report in case of a future fix.

PLUGIN_VERSION "1.4"

PHP Code:

SourceMod error session started
Info 
(map "c1m4_atrium")
Exception reportedEntity 409 (409is invalid
Blaming

Call stack trace:
  [
0GetEntPropEnt
  
[1Line 601attach::OnPreThink 

PHP Code:

Exception reportedProperty "m_useActionOwner" not found
Blaming

Call stack trace:
  [
0GetEntPropEnt
  
[1Line 601attach::OnPreThink

Exception reported
Property "m_useActionOwner" not found (entity 409/infected)
Exception reportedProperty "m_useActionOwner" not found (entity 409/molotov_projectile)
Exception reportedProperty "m_useActionOwner" not found (entity 409/info_particle_system)
Exception reportedProperty "m_useActionOwner" not found (entity 409/prop_dynamic


Xanaguy 06-06-2019 22:44

Re: [L4D2] ScavengeBotsDS (Improved)
 
A *MAJOR* update has been uploaded. Please reread the initial post for more information.

Mr. Man 06-07-2019 01:49

Re: [L4D2] ScavengeBotsDS (Improved)
 
Keep up the good work! Using the latest release without any issues yet.

Xanaguy 06-08-2019 21:50

Re: [L4D2] ScavengeBotsDS (Improved)
 
A bugfix update has been released. This version should now be compatible with (almost) every campaign. Refer to the list of campaigns for more details.

Xanaguy 06-09-2019 04:50

Re: [L4D2] ScavengeBotsDS (Improved)
 
Made a mistake in the last version. My apologies, the new version should fix it.

Xanaguy 06-12-2019 04:18

Re: [L4D2] ScavengeBotsDS (Improved)
 
An update has been released. Bugfix and a new blacklist.

Xanaguy 06-16-2019 17:51

Re: [L4D2] ScavengeBotsDS
 
Updated for any player using sourcemod locally. Bools will now reset for each mapstart and round conclusion. They will now never bring Gascans to the wrong target when switching campaigns.

Edit: Updated again to correct checks for the map blacklist.

zaviier 07-23-2019 08:25

Re: [L4D2] ScavengeBotsDS
 
L 07/23/2019 - 20:18:43: [SM] Exception reported: Game event "finale_vehicle_incoming" does not exist
L 07/23/2019 - 20:18:43: [SM] Blaming: scavengebotsds.smx
L 07/23/2019 - 20:18:43: [SM] Call stack trace:
L 07/23/2019 - 20:18:43: [SM] [0] HookEvent
L 07/23/2019 - 20:18:43: [SM] [1] Line 67, /home/forums/content/files/2/7/7/3/8/6/175977.attach::OnPluginStart

Xanaguy 07-23-2019 12:46

Re: [L4D2] ScavengeBotsDS
 
Quote:

Originally Posted by zaviier (Post 2660309)
L 07/23/2019 - 20:18:43: [SM] Exception reported: Game event "finale_vehicle_incoming" does not exist
L 07/23/2019 - 20:18:43: [SM] Blaming: scavengebotsds.smx
L 07/23/2019 - 20:18:43: [SM] Call stack trace:
L 07/23/2019 - 20:18:43: [SM] [0] HookEvent
L 07/23/2019 - 20:18:43: [SM] [1] Line 67, /home/forums/content/files/2/7/7/3/8/6/175977.attach::OnPluginStart


What map were you on?

zaviier 07-23-2019 12:58

Re: [L4D2] ScavengeBotsDS
 
Quote:

Originally Posted by Xanaguy (Post 2660323)
What map were you on?

Dead Center


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

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