Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

[L4D] Tank anti-stuck (anti-block)


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Description:

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)

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.

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_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

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.
ChangeLog (pre-release)

Attached Files
File Type: sp Get Plugin or Get Source (l4d_TankStuckTeleport.sp - 26.7 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...