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

[L4D & L4D2] Indomitable Survivor Bot v1.9 [2-December-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
typowritter
Junior Member
Join Date: Sep 2021
Old 10-18-2022 , 04:32   Re: [L4D & L4D2] Indomitable Survivor Bot v1.3.1 [1-May-2022]
Reply With Quote #21

To avoid the situation where all survivors are grabbed by a special infected, while the bots can't die and stuck the game, I added the functionality where bots can save themselves from special infected.

Code:
#define isInfectedBot(%1) (isBot(%1) && GetClientTeam(%1) == 3)

public void OnPluginStart() {
...
	HookEvent("jockey_ride", AutoSaveTheBots);
	HookEvent("tongue_grab", AutoSaveTheBots);
	HookEvent("charger_carry_start", AutoSaveTheBots);
	HookEvent("lunge_pounce", AutoSaveTheBots);
...
}

public void AutoSaveTheBots(Event event, const char[] name, bool dontBroadcast) {
	int infected = GetClientOfUserId(GetEventInt(event, "userid"));
	int victim = GetClientOfUserId(GetEventInt(event, "victim"));
	if (isSurvivorBot(victim)) {
		CreateTimer(5.0, KillInfected, infected);
	}
}

public Action KillInfected(Handle timer, int infected) {
	if (isInfectedBot(infected))
		ForcePlayerSuicide(infected);
}
A new convar to control the timeout to kill the infected maybe helpful, but I don't bother to do so and call it a day.
typowritter is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 10-21-2022 , 13:27   Re: [L4D & L4D2] Indomitable Survivor Bot v1.3.1 [1-May-2022]
Reply With Quote #22

Quote:
Originally Posted by typowritter View Post
To avoid the situation where all survivors are grabbed by a special infected, while the bots can't die and stuck the game, I added the functionality where bots can save themselves from special infected.

Code:
#define isInfectedBot(%1) (isBot(%1) && GetClientTeam(%1) == 3)

public void OnPluginStart() {
...
	HookEvent("jockey_ride", AutoSaveTheBots);
	HookEvent("tongue_grab", AutoSaveTheBots);
	HookEvent("charger_carry_start", AutoSaveTheBots);
	HookEvent("lunge_pounce", AutoSaveTheBots);
...
}

public void AutoSaveTheBots(Event event, const char[] name, bool dontBroadcast) {
	int infected = GetClientOfUserId(GetEventInt(event, "userid"));
	int victim = GetClientOfUserId(GetEventInt(event, "victim"));
	if (isSurvivorBot(victim)) {
		CreateTimer(5.0, KillInfected, infected);
	}
}

public Action KillInfected(Handle timer, int infected) {
	if (isInfectedBot(infected))
		ForcePlayerSuicide(infected);
}
A new convar to control the timeout to kill the infected maybe helpful, but I don't bother to do so and call it a day.
hey, we can use left4dhooks to prevent be control, and i will add the option when all survivor human down make plugin temporary disable
__________________
NoroHime is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 10-21-2022 , 15:01   Re: [L4D & L4D2] Indomitable Survivor Bot v1.4 [22-October-2022]
Reply With Quote #23

update

Quote:
about
  • prevents control from special infecteds
  • auto revive from ledge grabbed
  • temporary disable damage resistance when player gets down

ConVar

PHP Code:
// make bot indomitable abilities need alive human, 1=need alive 2=need stand on ground 0=do not check
indomitable_bot_need_human "1"

// prevent be control from: 1=charger 2=hunter 4=smoker 8=jockey -1=All 15=All
// add numbers together you want, require 'Left 4 Dhooks Direct'
indomitable_bot_block_control "-1"

// prevent the ledge grab -1=dont prevent 0=instantly 1.0=prevent after 1.0 seconds, require 'Left 4 Dhooks Direct'
indomitable_bot_block_ledgegrab "0" 

changelog
  • v1.4
    fix some damage source(like tank fist) bypass the plugin cause not works,
    add feature: prevents be control from charger/jockey/smoker/hunter/ledge grab, require 'Left 4 Dhooks Direct',
    add feature: optional temporary disable the bot indomitable abilities when human gets down,
    remove enabler ConVar, if you need disabled just unmount the plugin; 22-October-2022
  • v1.4.1 a negligence cause ConVar block_control detail config not work yet; 22-October-2022(2nd time) (sorry i shoulnt coding at 4:00AM)
__________________

Last edited by NoroHime; 10-21-2022 at 23:51.
NoroHime is offline
AK978
Senior Member
Join Date: Jun 2018
Old 10-23-2022 , 01:27   Re: [L4D & L4D2] Indomitable Survivor Bot v1.4.1 [22-October-2022]
Reply With Quote #24

L 10/23/2022 - 13:15:12: Info (map "c1m1_hotel") (file "E:\steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\logs\error s_20221023.log")
L 10/23/2022 - 13:15:12: [SM] Unable to load plugin "l4d_bot_healing.smx": Native "MemoryPatch.CreateFromConf" was not found.
AK978 is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 10-23-2022 , 06:59   Re: [L4D & L4D2] Indomitable Survivor Bot v1.4.1 [22-October-2022]
Reply With Quote #25

Quote:
Originally Posted by AK978 View Post
L 10/23/2022 - 13:15:12: Info (map "c1m1_hotel") (file "E:\steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\logs\error s_20221023.log")
L 10/23/2022 - 13:15:12: [SM] Unable to load plugin "l4d_bot_healing.smx": Native "MemoryPatch.CreateFromConf" was not found.
this error from another plugin https://forums.alliedmods.net/showthread.php?p=2785360
i guess you need Source Scramble https://forums.alliedmods.net/showthread.php?t=317175
-----
update

changelog
  • v1.4.2 a little negligence cause damage modifier stacks after every map changed; 25-October-2022
  • v1.5 if damage reducement finally less than 1 then make it be random. because 0.99 cannot cause real damage; 26-October-2022
__________________

Last edited by NoroHime; 10-26-2022 at 07:52.
NoroHime is offline
AK978
Senior Member
Join Date: Jun 2018
Old 10-23-2022 , 07:04   Re: [L4D & L4D2] Indomitable Survivor Bot v1.4.1 [22-October-2022]
Reply With Quote #26

sorry.
AK978 is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 11-10-2022 , 07:10   Re: [L4D & L4D2] Indomitable Survivor Bot v1.6 [10-November-2022]
Reply With Quote #27

update
Quote:
changelog
  • v1.6 Fixed changing bots gravity when they are being flung, compatibility support for the "Detonation Force" plugin (update by Silvers); 10-November-2022
  • v1.7 Fixed compatibility issue with "Weapons Movement Speed" plugin by "Silvers" (update by Silvers); 11-November-2022
  • v1.8 Now optionally uses the "Lagged Movement" plugin by "Silvers" to prevent conflicts when multiple plugins try to set player speed: (update by Silvers); 12-November-2022
__________________

Last edited by NoroHime; 11-12-2022 at 07:23.
NoroHime is offline
Maur0
Senior Member
Join Date: Aug 2020
Old 11-12-2022 , 21:30   Re: [L4D & L4D2] Indomitable Survivor Bot v1.6 [10-November-2022]
Reply With Quote #28

Quote:
Originally Posted by NoroHime View Post
update
Thank you very much for this update. everything works perfectly
Maur0 is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 12-01-2022 , 12:58   Re: [L4D & L4D2] Indomitable Survivor Bot v1.3.1 [1-May-2022]
Reply With Quote #29

Quote:
Originally Posted by Foxy0606 View Post
There's a bug in this cvar, bot have infinity throwable
PHP Code:
// allow infinity ammo 1=infinity clip 2=infinity reserved ammo 0=disable
// -
// Default: "1"
indomitable_bot_infinity_ammo "2" 

yes this is, but i dont think these is a bug, throwable actually has reserved ammo
PHP Code:
ammo_adrenaline_max
ammo_firstaid_max
ammo_molotov_max
ammo_painpills_max
ammo_pipebomb_max
ammo_vomitjar_max 
unexpect is ammo_chainsaw_max = 20, but on real game, they has 30 clip + 1 reserved, hmmm sounds weird
__________________

Last edited by NoroHime; 12-01-2022 at 13:40.
NoroHime is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 12-01-2022 , 15:23   Re: [L4D & L4D2] Indomitable Survivor Bot v1.3.1 [1-May-2022]
Reply With Quote #30

Quote:
Originally Posted by typowritter View Post
I managed to get a solution, resetting the movement rate to default when a jockey or smoker attached to the bots, and restore the value after release.

Code:
public void OnPluginStart() {
...
	HookEvent("jockey_ride", SetDefaultMovementRate);
	HookEvent("tongue_grab", SetDefaultMovementRate);
	HookEvent("jockey_ride_end", RestoreMovementRate);
	HookEvent("tongue_release", RestoreMovementRate);
...
}

public void SetDefaultMovementRate(Event event, const char[] name, bool dontBroadcast) {
	int victim = GetClientOfUserId(GetEventInt(event, "victim"));
	if (isSurvivorBot(victim)) {
		SetTerrorMovement(victim, 1.0);
	}
}

public void RestoreMovementRate(Event event, const char[] name, bool dontBroadcast) {
	int victim = GetClientOfUserId(GetEventInt(event, "victim"));
	if (isSurvivorBot(victim)) {
		SetTerrorMovement(victim, movement_rate);
	}
}
Weirdly though, it seems the SetTerrorMovement was called when the hooked events happen, but the speed still remain the same. Only after manually reloading the plugin can make it works as expected.
Can't figure out why
these problem also solved on update

Quote:

PHP Code:
// allow infinity ammo 1=infinity clip 2=infinity reserved ammo 0=disable
// 0.5=half chance to reserved ammo -0.5=half chance to clip ammo
indomitable_bot_infinity_ammo "1"

// does allow bot has infinity throwable usage,
// remember on vanilla game bot cant throw anything,
// combine to use with third-party plugins. 0.5 mean half chance
indomitable_bot_infinity_throwable "1.0" 
  • v1.9
    fix ConVar *_infinity_ammo giving ammo even bot fire failure,
    *_infinity_ammo can accepts float value between -1.0 and 1.0, 0.5 mean 50% chance to give one reserved ammo, -0.5 mean 50% chance to give one clip ammo,
    *_infinity_ammo will keep chainsaw clip full, not overflow,
    change code variable style to hungarian notation,
    if set *_movement_rate, survivor bot will back to regular movement speed temporary when bot be controlled by special infected,
    new ConVar *_infinity_throwable to allow bot infinity throwable usage, combine to use with third-party plugins. 0.5 mean half chance; 2-December-2022
glad to use L4DD make me coding easier
__________________

Last edited by NoroHime; 12-01-2022 at 15:56.
NoroHime 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 20:56.


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