Raised This Month: $51 Target: $400
 12% 

[L4D] L4D Tank announce and lock door (v1.1.7, 2022-01-02)


Post New Thread Reply   
 
Thread Tools Display Modes
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 12-16-2021 , 12:51   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #41

Quote:
Originally Posted by Psyk0tik View Post
I'm here if you ever need help with gamedata stuff.
Thank you, have to read into that bc I never messed around with gamedata tbh.

@ZBzibing

Please try this version now, I added a 6 seconds cooldown for the open message.
__________________

Last edited by finishlast; 12-18-2021 at 14:06.
finishlast is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 12-17-2021 , 11:50   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #42

Quote:
Originally Posted by finishlast View Post
Thank you, have to read into that bc I never messed around with gamedata tbh.

@ZBzibing

Please try this version now, I added a 6 seconds cooldown for the open message.

Applause, cheers! This program is already very good. At least I didn't find any more problems. I will update to the server to let more players experience it.

Code:
I hope the author has time and can solve the map problem alone
map:l4d_smalltown03_ranchhouse
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 12-18-2021 , 08:51   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #43

I think that map is fixed by itself, since when you rush there alone and start the event you get killed anyway by the event.

I have no idea how to fix that.
I simply don't know how to disable the church event on tank spawn and re-enable it after the tank dies.

So if the rest is OK now, I will put that version on the main page.
__________________

Last edited by finishlast; 12-18-2021 at 08:54.
finishlast is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 12-18-2021 , 12:32   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #44

Quote:
Originally Posted by finishlast View Post
I think that map is fixed by itself, since when you rush there alone and start the event you get killed anyway by the event.

I have no idea how to fix that.
I simply don't know how to disable the church event on tank spawn and re-enable it after the tank dies.

So if the rest is OK now, I will put that version on the main page.
As a veteran and old player, we already have a strong strength. We have a unique side, even if our teammates are sacrificed, we can complete the game alone. So the tank is still alive, starting to open the church event, can only make our game more fun, not Increase the difficulty. So we found this problem in the test.

In fact, this plugin can already be published on the homepage. Thank you for your update

-----------12.27----------
Found a small problem
After the tank dies, if a player repeatedly operates the safety door, it will still be prompted that the tank is still alive and the door is locked, but the door does not have any function.He gave the player an error message


Code:
		else
		{
			cooldown = true;
			if(g_bAliveTank = true)
			{
				CPrintToChatAll("[SM] You can't open the door while a tank is alive.");
			}
			CreateTimer(6.0, cool);
		}
I added a judgment in line 227-235. I don't know if the program is written correctly, but I have temporarily solved this problem and wait for the author to fix it by his own method.
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:

Last edited by ZBzibing; 12-27-2021 at 05:07.
ZBzibing is offline
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 12-30-2021 , 04:09   Re: [L4D] L4D Tank announce and lock door (v1.1.6, 2021-12-18)
Reply With Quote #45

I cannot reproduce the problem.
The player_use hook should only be hooked when the tanks are alive (1 time) and unhooked when all tanks are dead (1 time).

PHP Code:
        case LOCK:
        {    
        if(
isusehooked==false){
           
HookEvent("player_use"OnPlayerUsePreEventHookMode_Pre);
        
isusehooked=true;
        } 
PHP Code:
         case UNLOCK:
        {
        if(
isusehooked == true){
           
UnhookEvent("player_use"OnPlayerUsePreEventHookMode_Pre);
        
isusehooked=false;
        } 
So it should not reach the point where you check for living tanks, because when all tanks are dead the hook should be gone.

PHP Code:
        else
        {
            
cooldown true;
            if(
g_bAliveTank true)
            {
                
CPrintToChatAll("[SM] You can't open the door while a tank is alive.");
            }
            
CreateTimer(6.0cool);
        } 
__________________
finishlast is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 12-30-2021 , 08:00   Re: [L4D] L4D Tank announce and lock door (v1.1.6, 2021-12-18)
Reply With Quote #46

It's better to avoid using a timer for the cooldown. You can store the current GetGameTime() in a global float with + 6.0 added when you set cooldown to true, then check if g_fCooldown > GetGameTime() the cooldown is active. Reset the g_fCooldown time to 0.0 on round end/map end. Avoid timers where possible for things like this because timers are checked/fired at the same time, so if many timers are being used at once across all plugins there could be potential for lag skips.

In OnPlayerUsePre its more sensible to check "cooldown == true" first before "char sEntityClass[64];" and "GetEdictClassname(used, sEntityClass, sizeof(sEntityClass));" since those use more CPU cycles to check. You want to order if statements/checks to what uses less CPU and then check more complicated things after to avoid checking complicated/more cpu resourceful stuff when something simple will end the statement.

I'm not sure if the hook needs to be "EventHookMode_Pre", I guess not since you're not modifying the event or blocking it. Although that is really negligible.
__________________

Last edited by Silvers; 12-30-2021 at 08:00.
Silvers is offline
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 01-02-2022 , 10:44   Re: [L4D] L4D Tank announce and lock door (v1.1.7, 2022-01-02)
Reply With Quote #47

Thank you once again Silvers, I replaced the timer with the GetGameTime() + 6.0 and fut cooldown check first.

ZBzibing I updated first page. 1.1.7
__________________
finishlast is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 01-14-2022 , 22:52   Re: [L4D] L4D Tank announce and lock door (v1.1.7, 2022-01-02)
Reply With Quote #48

Quote:
Originally Posted by finishlast View Post
Thank you once again Silvers, I replaced the timer with the GetGameTime() + 6.0 and fut cooldown check first.

ZBzibing I updated first page. 1.1.7
I have been suffering from pain for a long time, I went to the hospital for surgery not long ago, I will recover for a while before I can test the function of the program. Thank you for the update.

---------2022/1/17---------
1.2021.12.27 [SM] You can't open the door while a tank is alive.
The error message still exists(This problem is not a functional error, but a prompt error.)
trigger condition:after the tank dies,If the player repeatedly opens and closes the safety door, this prompt will always be triggered, and it will always be displayed according to the cooling time interval.

2.After the player is killed by a tank, the game restarts
In a new round of the game, you will be prompted:[SM] The Tank is dead! The safehouse is open!
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:

Last edited by ZBzibing; 01-16-2022 at 13:23.
ZBzibing is offline
Reply



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:30.


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