|
Veteran Member
Join Date: Aug 2016
Location: bed
|
12-01-2022
, 15:23
Re: [L4D & L4D2] Indomitable Survivor Bot v1.3.1 [1-May-2022]
|
#30
|
Quote:
Originally Posted by typowritter
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.
|
|
|
|