Raised This Month: $7 Target: $400
 1% 

[L4D & L4D2] ZSpawn: Zombie Spawn manager (v1.2.5)[09-Mar-2021]


Post New Thread Reply   
 
Thread Tools Display Modes
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-06-2021 , 05:24   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.1)[05-May-2021]
Reply With Quote #11

You should be setting the timer handle to null in the timer callback if you're closing the timer, which you do in the first two lines of the timer callback code. See the [TUT] SourcePawn Scripting - Tips, Basics to Advanced thread for details on dealing with timer handles and ways to use them without issues. You can call "delete g_hSpawnTimer" multiple times since delete closes the timer if it's a valid handle and sets g_hSpawnTimer to null.


Edit: You're also leaking ray trace handles by never deleting them:

Quote:
TR_TraceRayFilterEx
Return Value

Ray trace handle, which must be closed via CloseHandle() or delete.

Also couple spelling mistakes (just pointing out to help you):

succefully > successfully
oposite > opposite
wich > which
commads > commands
Minium > Minimum
__________________

Last edited by Silvers; 05-06-2021 at 05:33.
Silvers is offline
Striker black
Member
Join Date: Apr 2013
Old 05-06-2021 , 23:07   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.1)[05-May-2021]
Reply With Quote #12

[QUOTE=Earendil;2746068]I found the problem, fixed for next update.

Does that mean it's still not fixed?

I tried the current version and my server crashed after 30 minutes
__________________
--------------------------------------

Last edited by Striker black; 05-06-2021 at 23:08.
Striker black is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 05-08-2021 , 07:41   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.1)[05-May-2021]
Reply With Quote #13

Quote:
Originally Posted by Striker black View Post

Does that mean it's still not fixed?

I tried the current version and my server crashed after 30 minutes
Sorry, I noticed after uploading v1.1, I will try to publish the next update with the fix tomorrow, with L4D support and some new features.
Earendil is offline
Sev
Veteran Member
Join Date: May 2010
Old 05-08-2021 , 16:44   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.1)[05-May-2021]
Reply With Quote #14

Good work on this plugin.

Only feature I'd suggest down the road is perhaps some kind of save feature that would allow you to save individual locations for tanks and witches to spawn that could be saved in a config file.
Sev is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 05-08-2021 , 22:12   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.1)[05-May-2021]
Reply With Quote #15

Updated to v1.2:
HTML Code:
- Added support for Left 4 Dead.
- Plugin uses "info_gamemode" to check current gamemode (thanks to Silvers for the suggestion).
- Fixed some spelling mistakes (again thanks to Silvers).
- New ConVar "zspawn_gamemode_override" can force the plugin to emulate another gamemode, it can be used to solve bugs in mutations if the gamemode is not detected correctly.
- [L4D2]Trying to add more than 6 values in special limits and weight convars will report and error instead of accepting the first 6 values.
- Fixed leaks with ray trace handles.
- Solved CloseHandle errors with timers.
- Fixed the error getting invalid client (Client index 65 is invalid).
- Solved bug in scavenge that stopped autospawn if "zspawn_autosp_stop_notmoving" was set to 1.
- Plugin now can spawn tanks in scavenge when survivors reach specific scores (new ConVar "zspawn_autotank_scav_amount").
- Admin spawn commands now report the amount of infected spawned, if no infected could be spawned it will report an error.
- Autospawn of tanks and witches now uses the survivor closest to the end of map to get the spawn position.
- If admins try to spawn more than 16 zombies the value will be clamped to 16.
- Added tags in plugin messages.
Attached Files
File Type: smx l4d_zspawn.smx (21.7 KB, 100 views)
File Type: sp Get Plugin or Get Source (l4d_zspawn.sp - 87 views - 56.9 KB)

Last edited by Earendil; 05-08-2021 at 22:16. Reason: Fixed attachments
Earendil is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 05-09-2021 , 01:08   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.2)[09-May-2021]
Reply With Quote #16

Code:
L4D_GetRandomPZSpawnPosition(client, zombieclass, 5, vPos);
L4D_GetRandomPZSpawnPosition could return false on failure to find valid location.

PHP Code:
/**
 * @brief Attempts to find a random valid position to spawn a Special Infected
 * @remarks The zombieClass does not matter but different values yield different results:
 * @remarks Using the Tank zombieClass probably searches for a larger area that's clear of objects
 *
 * @param client            Client id to find an area near this player
 * @param zombieClass        Special Infected class to search for a spawn position for
 * @param attempts            How many tries to find a valid location
 * @param vecPos            The vector array to store the valid location on success
 *
 * @return                    True on success, false on failure to find valid location
 */
native bool L4D_GetRandomPZSpawnPosition(int clientint zombieClassint attemptsfloat vecPos[3]); 
so I usually write
PHP Code:
if(L4D_GetRandomPZSpawnPosition(clientzombieclass5vPos) == true)
{
    
L4D2_SpawnSpecial(zombieclassvPosNULL_VECTOR);
}
else
{
    
PrintToServer("[TS] Couldn't find a valid Spawn position in 5 tries");

__________________
HarryPotter is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 05-09-2021 , 05:59   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.2)[09-May-2021]
Reply With Quote #17

Quote:
Originally Posted by HarryPotter View Post
L4D_GetRandomPZSpawnPosition could return false on failure to find valid location.
You are right, that would spawn an infected in the last spawn in the best case. In worst case it would spawn special on (0,0,0). Thanks for the advice.

Quote:
Originally Posted by Sev View Post
Good work on this plugin.

Only feature I'd suggest down the road is perhaps some kind of save feature that would allow you to save individual locations for tanks and witches to spawn that could be saved in a config file.
Thats a good idea, I will take a look on that, I have never worked with that cfg in a plugin, so firs I will have to learn how to do that correctly.

Last edited by Earendil; 05-09-2021 at 06:51.
Earendil is offline
Striker black
Member
Join Date: Apr 2013
Old 05-09-2021 , 22:34   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.2.1)[09-May-2021]
Reply With Quote #18

In the previous version the tanks established by zspawn_autotank_min "5" - zspawn_autotank_max "7" were perfectly covered, but now in the new version "1.2.1" testing in more than 3 campaigns no bot tank was spawned.

Maybe I need to change something else?
__________________
--------------------------------------
Striker black is offline
Krufftys Killers
Senior Member
Join Date: Jan 2014
Old 05-11-2021 , 07:54   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.2.1)[09-May-2021]
Reply With Quote #19

Got this error today
L 05/10/2021 - 21:273: SourceMod error session started
L 05/10/2021 - 21:273: Info (map "c9m1_alleys") (file "C:\servers\madhouse\left4dead2\addons\source mod\logs\errors_20210510.log")
L 05/10/2021 - 21:273: [SM] Exception reported: Array index out-of-bounds (index 6, limit 6)
L 05/10/2021 - 21:273: [SM] Blaming: l4d_zspawn.smx
L 05/10/2021 - 21:273: [SM] Call stack trace:
L 05/10/2021 - 21:273: [SM] [1] Line 1391, l4d_zspawn.sp::NextSpecialSpawn
L 05/10/2021 - 21:273: [SM] [2] Line 1165, l4d_zspawn.sp::AutoSpawn_Timer
L 05/10/2021 - 217:24: Error log file session closed.
Krufftys Killers is offline
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 05-20-2021 , 21:43   Re: [L4D2] ZSpawn: Zombie Spawn manager (v1.1)[05-May-2021]
Reply With Quote #20

Quote:
Originally Posted by Striker black View Post
In the previous version the tanks established by zspawn_autotank_min "5" - zspawn_autotank_max "7" were perfectly covered, but now in the new version "1.2.1" testing in more than 3 campaigns no bot tank was spawned.

Maybe I need to change something else?
Attached Files
File Type: sp Get Plugin or Get Source (l4d_zspawn_fix.sp - 94 views - 42.8 KB)

Last edited by foxhound27; 05-20-2021 at 21:43.
foxhound27 is offline
Reply


Thread Tools
Display Modes

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 01:07.


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