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

[L4D2] Super Tanks


Post New Thread Reply   
 
Thread Tools Display Modes
Longtree
New Member
Join Date: Oct 2011
Old 10-06-2011 , 14:13   Re: [L4D2] Super Tanks
Reply With Quote #21

That fixed it.. thanks again for help. I downloaded and installed latest version of sourcemod.

Thanks again for your help.. you guys are great

Best regards,
Longtree
Longtree is offline
disawar1
AlliedModders Donor
Join Date: Aug 2011
Location: Russian
Old 12-20-2011 , 03:29   Re: [L4D2] Super Tanks
Reply With Quote #22

hi Machine, my plugin supported u Super Tanks, topic is here http://forums.alliedmods.net/showthread.php?p=1610278 Did you think about the support of all gamemods?
__________________
disawar1 is offline
Machine
Senior Member
Join Date: Apr 2010
Old 12-23-2011 , 21:14   Re: [L4D2] Super Tanks
Reply With Quote #23

Yes, I saw that. Good job. I haven't thought about adding support for other gamemodes. Maybe some day.
Machine is offline
hg0827
Junior Member
Join Date: Nov 2010
Old 03-05-2012 , 00:51   Re: [L4D2] Super Tanks
Reply With Quote #24

can add some cvars to control tank's health for default tank and every wave in fenale,thx
add cvar to set every tank's speed @.@

Last edited by hg0827; 03-05-2012 at 07:16.
hg0827 is offline
RavenDan29
Veteran Member
Join Date: Sep 2009
Old 03-05-2012 , 06:17   Re: [L4D2] Super Tanks
Reply With Quote #25

Please add a cvar for gamemodes

on Expert tanks are reading as 4000 not 8000hp why?

@wolfgang the .cfg file version would have been useful but your .smx and .sp files ae not compileing

think it best to delete this plugin till its finished
__________________

Last edited by RavenDan29; 03-05-2012 at 07:53.
RavenDan29 is offline
DarkSynergy
Member
Join Date: Jan 2011
Old 03-16-2012 , 18:00   Re: [L4D2] Super Tanks
Reply With Quote #26

I'm getting this error message repeatedly:

Code:
L 03/16/2012 - 14:19:20: [SM] Native "IsClientInGame" reported: Client index 30 is invalid
L 03/16/2012 - 14:19:20: [SM] Displaying call stack trace for plugin "SuperTanks.smx":
L 03/16/2012 - 14:19:20: [SM]   [0]  Line 1160, C:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\addons\sourcemod\scripting\SuperTanks.sp::IsTank()
L 03/16/2012 - 14:19:20: [SM]   [1]  Line 2899, C:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\addons\sourcemod\scripting\SuperTanks.sp::OnSurvivorTakeDamage()
I took a look at your code, and it looks like you assumed max clients to be 32 (checking attacker < 33). This is probably why a client index of 30 (which here is invalid) is getting through.

EDIT: Also, you use z_tank_health to determine the tank's hp, which is only correct on normal difficulty. On any other difficulty, a multiplier is applied to the tank's hp to get the true value.

Last edited by DarkSynergy; 03-16-2012 at 23:56.
DarkSynergy is offline
Machine
Senior Member
Join Date: Apr 2010
Old 03-17-2012 , 15:14   Re: [L4D2] Super Tanks
Reply With Quote #27

Quote:
Originally Posted by DarkSynergy View Post

I took a look at your code, and it looks like you assumed max clients to be 32 (checking attacker < 33). This is probably why a client index of 30 (which here is invalid) is getting through.

EDIT: Also, you use z_tank_health to determine the tank's hp, which is only correct on normal difficulty. On any other difficulty, a multiplier is applied to the tank's hp to get the true value.
Maximum clients for L4D2 is 32. I am unsure why its giving an error about client index 30 not being valid.
You have to remember, fakeclients such as bots, survivors or infected, use those client indexes aswell.
I will take a look at it tonight, maybe I need to add more checks.

I was aware of the health multiplier, but I was lazy and didn't account for it.
I will update this plugin tonight with it and add additional cvars as posters above suggested and change the way the sdkcalls are handled too. It should reduce the server load when they are called.
Machine is offline
DarkSynergy
Member
Join Date: Jan 2011
Old 03-17-2012 , 16:26   Re: [L4D2] Super Tanks
Reply With Quote #28

Quote:
Originally Posted by Machine View Post
Maximum clients for L4D2 is 32. I am unsure why its giving an error about client index 30 not being valid.
You have to remember, fakeclients such as bots, survivors or infected, use those client indexes aswell.
I will take a look at it tonight, maybe I need to add more checks.

I was aware of the health multiplier, but I was lazy and didn't account for it.
I will update this plugin tonight with it and add additional cvars as posters above suggested and change the way the sdkcalls are handled too. It should reduce the server load when they are called.
I just went ahead and changed all of the "< 33" checks to "<= MaxClients" and it seemed to take care of the problem for me. Based on what I read online "MaxClients" is determined dynamically. I'm not sure why the event would be called with an invalid client index though.

As for the health, yeah it's just an issue of detecting the difficulty cvar and applying the correct multiplier to z_tank_health. Also, although the method you used right now works, you probably could completely replace things like player_hurt and SDKCallWeaponDrop with SDKHooks functions (SDKHook_OnTakeDamage, SDKHooks_DropWeapon). If time permits, of course.

I tried it out online and it makes the finales a lot more interesting (and difficult ). Keep up the good work!
DarkSynergy is offline
Machine
Senior Member
Join Date: Apr 2010
Old 03-17-2012 , 17:53   Re: [L4D2] Super Tanks
Reply With Quote #29

Quote:
Originally Posted by DarkSynergy View Post
I just went ahead and changed all of the "< 33" checks to "<= MaxClients" and it seemed to take care of the problem for me. Based on what I read online "MaxClients" is determined dynamically. I'm not sure why the event would be called with an invalid client index though.

As for the health, yeah it's just an issue of detecting the difficulty cvar and applying the correct multiplier to z_tank_health. Also, although the method you used right now works, you probably could completely replace things like player_hurt and SDKCallWeaponDrop with SDKHooks functions (SDKHook_OnTakeDamage, SDKHooks_DropWeapon). If time permits, of course.

I tried it out online and it makes the finales a lot more interesting (and difficult ). Keep up the good work!
Yes it was sloppy on my part to use "< 33" in the first place. I usually use "<=MaxClients". I must have had a brain fart. Btw, it is possible for the SDKHook_OnTakeDamage to return no attacker indexes. Such as world damage and infected entities. But seeing as that error returned an index of 30, it should have been valid. Very strange..

Yeah I will replace those in time. When I first worked on this tank plugin, I didn't use SDKHooks, so most functions were called from the player_hurt event. I can replace that event eventually.
Machine is offline
DarkSynergy
Member
Join Date: Jan 2011
Old 03-17-2012 , 18:35   Re: [L4D2] Super Tanks
Reply With Quote #30

Quote:
Originally Posted by Machine View Post
Yes it was sloppy on my part to use "< 33" in the first place. I usually use "<=MaxClients". I must have had a brain fart. Btw, it is possible for the SDKHook_OnTakeDamage to return no attacker indexes. Such as world damage and infected entities. But seeing as that error returned an index of 30, it should have been valid. Very strange..

Yeah I will replace those in time. When I first worked on this tank plugin, I didn't use SDKHooks, so most functions were called from the player_hurt event. I can replace that event eventually.
I've had that same error spammed in my log on multiple runs, and the invalid client index reported is always 30. There definitely werent 30 clients on the server (including survivor/infected bots) when it happened though.

Also, you might be able to simplify weapon dropping to:
Code:
stock ForceWeaponDrop(client)
{
    if (client == 0 || GetClientTeam(client) != 2 || !IsPlayerAlive(client))
        return;

    new weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
    if (weapon > 0)
        SDKHooks_DropWeapon(client, weapon, NULL_VECTOR, NULL_VECTOR);
}
Im just not sure if this would cause a player to drop their single pistol if thats all they have (havent tested it). But yeah, that would get rid of an SDKCall entirely.
DarkSynergy 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 21:43.


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