Author
|
|
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
|
Plugin ID:
|
6459
|
Plugin Version:
|
2.2
|
Plugin Category:
|
Gameplay
|
Plugin Game:
|
Left 4 Dead
|
Plugin Dependencies:
|
|
Servers with this Plugin:
|
|
| |
Plugin Description:
|
Teleport tank if he was stuck within collision and can't move
|
|
|
03-04-2019
, 21:46
[L4D1 & L4D2] Tank anti-stuck (anti-block)
|
#1
|
Description:
Intended for intensive game.
Depending on server build complexity, sooner or later, players face a problem when tank is getting stuck (collide with another models and can't move - as a result: too easy too kill, or even loss of control).
Plugin try to resolve/prevent several problems:
- tank stuck
- losing control
- blocking tank by players (e.g. on the ladder)
- all team-rush
- player idle(stucker) /bug the tank by sitting in place where tank can't catch him (punishment)
- one player rush (punishment)
How does it work?
There are several rules (all configurable by ConVars):
- When tank spawn, plugin track for the maximum time allowed for tank to be non-angry (see "l4d_TankAntiStuck_non_angry_time").
If player didn't angry the tank during this time, it will be automatically teleported to players.
Behaviour can be disabled by "l4d_TankAntiStuck_non_angry_time" set to 0.
After become angry:
- There is a mechanism of identifying of stuck based on the origin of tank.
If he didn't move more than > X radius (see "l4d_TankAntiStuck_non_stuck_radius")
for the last Y sec. (see "l4d_TankAntiStuck_check_interval") it is considered as stucked,
and teleporting process begins.
- if all the team tried to run away from tank (rush) for some reason e.g. when tank is out of map or they rush specially,
plugin identify the distance between tank and the nearest player - if it is > X (see "l4d_TankAntiStuck_tank_distance_max")
tank will be teleported to the nearest player.
Behaviour can be disabled by "l4d_TankAntiStuck_tank_distance_max" set to 0.
- if l4d_TankAntiStuck_rusher_punish set to 1, plugin will check the distance between the nearest tank to each individual client, if he is too far, client will be punished by teleporting tank direclty in player's position.
- if l4d_TankAntiStuck_idler_punish set to 1, plugin will check is player move (see additional ConVars). If player behave himself like idle (usually due to sitting in the place where tank can't catch him) for more than (3 sec. each 3 times, see settings), client will be punished by teleporting tank direclty in player's position.
How does it teleport:
- Firstly plugin attempt to make smooth teleport applying new velocity on direction to the nearest player next to the tank.
If it is failed in X tries, plugin make instant teleport to the place under the head of the player (see "l4d_TankAntiStuck_head_height_max").
If that place is not empty (collide with something), plugin try to find another empty place around the nearest player (see "l4d_TankAntiStuck_head_height_min").
And lastly:
- plugin apply game ConVar "tank_stuck_failsafe" (untested, unproved) in attempt to fix problem when tank losing control after colliding the model for ~ 15 sec.
This part is not very necessary if you use my plugin with default settings.
Behaviour can be disabled by "l4d_TankAntiStuck_apply_convar" set to 0.
Also you can configure "l4d_TankAntiStuck_all_intellect" - to define who anti-stuck is applicable to (bots or bots + real players in infected team).
Compatibility: - L4D1.
- L4D2 - untested. Should work ok.
Commands: Nothing. There are several service cmds in debug mode for test reasons only.
Settings (ConVars):
- "l4d_TankAntiStuck_enable" (1) - Enable plugin (1 - On / 0 - Off)
- "l4d_TankAntiStuck_non_angry_time" (45) - Automatic tank teleport if he is not angry within specified time (in sec.) after spawn (0 - to disable)
- "l4d_TankAntiStuck_tank_distance_max" (1000) - Maximum distance allowed between tank and the nearest player (after been angered). Otherwise, it will be teleported (0 - to disable)
- "l4d_TankAntiStuck_head_height_max" (150) - Distance under the head of player, tank will be instantly teleported to, by default, when tank failed to unstuck wasting all attempts to free using smooth teleport
- "l4d_TankAntiStuck_head_height_min" (80) - Distance under the head of player, tank will be instantly teleported to, if plugin failed to find more appropriate location
- "l4d_TankAntiStuck_check_interval" (3) - Time intervals (in sec.) tank stuck should be checked
- "l4d_TankAntiStuck_non_stuck_radius" (15) - Maximum radius where tank is cosidered non-stucked when not moved during X sec. (see l4d_TankAntiStuck_check_interval ConVar)
- "l4d_TankAntiStuck_inst_tele_dist" (50) - Distance for instant type of teleport
- "l4d_TankAntiStuck_smooth_tele_dist" (150) - Distance for smooth type of teleport
- "l4d_TankAntiStuck_smooth_tele_power" (300) - Power (velocity) for smooth type of teleport
- "l4d_TankAntiStuck_dest_object" (1) - Object to teleport tank to (0 - next to current tank, 1 - next to another tank, 2 - next to player)
- "l4d_TankAntiStuck_all_intellect" (1) - 1 - Apply anti-stuck to both: when bots or real player control tank, 0 - apply to tank bot (fake) only
- "l4d_TankAntiStuck_apply_convar" (1) - 1 - Apply special ConVar in attempt to fix problem when tank losing its control after stuck (just in case). 0 - do not apply
- "l4d_TankAntiStuck_idler_punish" (1) - Punish the player who doesn't move by teleporting nearest tant to him? (0 - No / 1 - Yes)
- "l4d_TankAntiStuck_idler_radius" (30) - Maximum radius within player moves considered as idler (stucker)
- "l4d_TankAntiStuck_idler_check_times" (3) - Number of checks before finally considering player as idler (stucker)
- "l4d_TankAntiStuck_idler_check_interval" (3) - Interval (in sec.) between each check for idler (stucker)
- "l4d_TankAntiStuck_idler_minplayers" (2) - Minimum living players allowed for 'Idle player' rule to work
- "l4d_TankAntiStuck_rusher_punish" (1) - Punish the player who rush too far from the nearest tank by teleporting tank to him? (0 - No / 1 - Yes)
- "l4d_TankAntiStuck_rusher_dist" (2000) - Maximum distance to the nearest tank considered as rusher
- "l4d_TankAntiStuck_rusher_check_times" (3) - Number of checks before finally considering player as rusher
- "l4d_TankAntiStuck_rusher_check_interval" (10) - Interval (in sec.) between each check for rusher
- "l4d_TankAntiStuck_rusher_minplayers" (2) - Minimum living players allowed for 'Rusher player' rule to work
Using:
Copy smx to addons/sourcemod/plugins
Credits:
* Peace-Maker - for some examples on TraceHull filter.
* stinkyfax - for examples of teleport in direction math.
* cravenge - for some ConVar, possibly, preventing tank from losing control when stuck.
* midnight9, PatriotGames - who tried to help me with another ConVars against losing tank control.
Related topics:
[L4D] Tank gets frozen
[L4D2] Fix frozen tanks
[L4D] Give Tank control to other player
DonateDonates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
- Patreon (Paypal)
- BitCoin
- Ю.Money
__________________
Last edited by Dragokas; 04-15-2021 at 08:51.
|
|
|
|