AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Improved and Perfected SurvivorAI Autotrigger (https://forums.alliedmods.net/showthread.php?t=310638)

Xanaguy 09-13-2018 04:54

[L4D2] Improved and Perfected SurvivorAI Autotrigger
 
1 Attachment(s)
This plugin was originally crafted by AtomicStryker, that covered only the main 5 campaigns.

Then when I was looking for recommended plugins on the "Competitive-Bots+" workshop item discussion, I found ijj's variant that covered more campaigns. But it still wasn't enough for every map to be completed from start to finish.

So I took it upon myself to complete all the necessary maps, triggers, and teleport spots to ensure that the bots will always traverse to the saferoom. Here it is.

General changes made that were different from ijj's variant:

- Added missing, vital triggers for all official maps, both event and teleportation, Bots should be able to complete all maps from start to finish.
- Fixed Tank encounter on The Sacrifice - Docks. (The original coding had the checks and effects backwards).
- Overhauled Textual notifications to chat to be less plain.

Upgrades:

- Bots are now guaranteed to call Whitaker in the gun shop.

- While this isn't really too much of a change, it still helps for that one guy: After taking Lux's advice and Timocop's implementation, memory leaks have been removed.

- 2/3/2019:

- Added support for many addon campaigns.

- Added failsafe for The Sacrifice - Docks.

- Reinstated The Sacrifice - Port since it works for mutations that can only be played in single-player ("maxplayers" **MUST BE "1"! NO GREATER!**)

- AutoTrigger will now activate when it is just bots alive on the survivor team, even if every human player was killed in action.

- 6/9/2019:

- Included full support of Yama. (Listed in the compatible campaigns)

- 10/7/2020:

- Extended compatibilities to many custom campaigns. Exact list is unknown.

- Fixed an incorrect entity name for DayBreak - Chapter 1

- The alarmed doors will now unblock the nav on open on DayBreak - Chapter 2

- There is a slight delay before closing the doors behind the survivors after they teleport on DayBreak - Chapter 5. This will allow the finale to initiate properly.

- 10/8/2020:

- Fixed some issues reported by Crasher. (I was not able to verify everything, details in the reply)

- 10/9/2020:

- Changed a check for bots to a proper check.

List of supported campaigns:
  1. Fatal Freight
  2. Precinct 84 ( 2018 )
  3. Road To Nowhere 2
  4. Suicide Blitz II
  5. Urban Flight
  6. Wan Li
  7. Welcome to Hell
  8. Yama

Iizuka07 09-13-2018 07:49

Re: [L4D2] Improved and Perfected SurvivorAI Autotrigger
 
pretty nice since I use competitive bots +. This will be fun

Thanks for your work

DreadedGhoul575 09-26-2018 16:35

Re: [L4D2] Improved and Perfected SurvivorAI Autotrigger
 
Bots get stuck on chapter 2 on Dead Center unfortunately, even with the scavengebots mod.

Xanaguy 09-26-2018 22:11

Re: [L4D2] Improved and Perfected SurvivorAI Autotrigger
 
Quote:

Originally Posted by DreadedGhoul575 (Post 2616901)
Bots get stuck on chapter 2 on Dead Center unfortunately, even with the scavengebots mod.

Got a feeling that the bots may end up getting stuck in the gunshop where they were supposed to call Whitaker which does happen often enough to warrant a fix. Very well. I'll get right on it.

Edit 1: If your problem happens when they were supposed to get in the supermarket, then the trigger should have happened when the bots neared the truck, then it would have been about 60 seconds until the truck cleared.
Edit 2: Scavenge bots only works for Finales and the Scavenge Game Mode, not stuff like the cola delivery.

cravenge 09-28-2018 04:18

Re: [L4D2] Improved and Perfected SurvivorAI Autotrigger
 
Nice work for completing this, Xanaguy. :up:

Quote:

Originally Posted by DreadedGhoul575 (Post 2616901)
...

If you want bots to get something other than gascans by themselves, the same function from the plugin you mentioned can be copied and rewritten to check for that "something" instead.

Xanaguy 09-28-2018 16:51

Re: [L4D2] Improved and Perfected SurvivorAI Autotrigger
 
Quote:

Originally Posted by cravenge (Post 2617081)
Nice work for completing this, Xanaguy. :up:

Thanks! I'm planning on adapting the scavenge bots to the cola event in Dead Center, but I've seem to have ran into a snag that I can't resolve alone. Maybe together we can come up with a working plugin.

Lux 09-30-2018 04:20

Re: [L4D2] Improved and Perfected SurvivorAI Autotrigger
 
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:45

Re: [L4D2] Improved and Perfected SurvivorAI Autotrigger
 
Updated: Thanks Lux and Timocop. This plugin should be fully aced now.

DreadedGhoul575 10-04-2018 07:05

Re: [L4D2] Improved and Perfected SurvivorAI Autotrigger
 
Quote:

Originally Posted by Xanaguy (Post 2616928)
Got a feeling that the bots may end up getting stuck in the gunshop where they were supposed to call Whitaker which does happen often enough to warrant a fix. Very well. I'll get right on it.

Edit 1: If your problem happens when they were supposed to get in the supermarket, then the trigger should have happened when the bots neared the truck, then it would have been about 60 seconds until the truck cleared.
Edit 2: Scavenge bots only works for Finales and the Scavenge Game Mode, not stuff like the cola delivery.

Yeah, it's near the truck, where nothing happened. I'll try again and see if it works this time.

Shame bots can't pickup the cola.

Edit: Just tested and it does work; before they were stuck and the autotrigger didn't move them, great job with this.
My last one to test is chapter 3 on Swamp Fever, since by default, bots won't activate the bridge to lower, and I wanna see if this autotrigger makes them do this, without by default cheating and going through the bushes by teleporting/cheating.

Edit 2: Chapter 3 on Swamp Fever works, good job with this. :)

Xanaguy 10-04-2018 13:32

Re: [L4D2] Improved and Perfected SurvivorAI Autotrigger
 
Quote:

Originally Posted by DreadedGhoul575 (Post 2617983)
Yeah, it's near the truck, where nothing happened. I'll try again and see if it works this time.

Shame bots can't pickup the cola.

Edit: Just tested and it does work; before they were stuck and the autotrigger didn't move them, great job with this.
My last one to test is chapter 3 on Swamp Fever, since by default, bots won't activate the bridge to lower, and I wanna see if this autotrigger makes them do this, without by default cheating and going through the bushes by teleporting/cheating.

It’ll work. Though they may just try to teleport through the bushes anyways, at least then, the panic event will start. That’s all that matters.


All times are GMT -4. The time now is 20:34.

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