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

[TF2] Prevent round end in arena mode?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 01-27-2012 , 18:20   [TF2] Prevent round end in arena mode?
Reply With Quote #1

Is it possible to prevent the round from ending in TF2 arena mode when one entire team dies? I'm trying to write a plugin that will respawn players who die in arena mode unless a certain condition is met, and if it's down to one on a team, I'd like to be able to respawn them without the game ending.

More clarity:

BLU has > 1 player alive. RED has 1 player alive. Someone kills said RED player. Now RED has 0 players alive, and the round would normally end here. I want the round to not end, and I will manually respawn said RED player after a few seconds.

I was thinking about putting a bot on each team, setting their movetype to MOVETYPE_NONE, stripping all of their weapons, making them invisible, and giving them godmode. Then I could manually slay them when a team is down to only the bot and I want the round to end, but there must be a better way?
__________________
Dr. McKay is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 01-28-2012 , 00:45   Re: [TF2] Prevent round end in arena mode?
Reply With Quote #2

Hook the round end event and return Plugin_Handled maybe?
__________________
napalm00 is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 01-28-2012 , 12:38   Re: [TF2] Prevent round end in arena mode?
Reply With Quote #3

Quote:
Originally Posted by napalm00 View Post
Hook the round end event and return Plugin_Handled maybe?
It's possible, I'll try it.

Otherwise, this would probably require an extension, wouldn't it?
__________________
Dr. McKay is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 01-28-2012 , 14:52   Re: [TF2] Prevent round end in arena mode?
Reply With Quote #4

It most likely does require an extension. Events are just notifications so that most likely wont do anything.
Dr!fter is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 01-28-2012 , 16:01   Re: [TF2] Prevent round end in arena mode?
Reply With Quote #5

Quote:
Originally Posted by Dr!fter View Post
It most likely does require an extension. Events are just notifications so that most likely wont do anything.
Yeah, I figured. Would someone mind doing this? I'm clueless when it comes to C. Otherwise, I'll just have to use my bot idea (which I really don't want to...)
__________________
Dr. McKay is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 01-28-2012 , 18:23   Re: [TF2] Prevent round end in arena mode?
Reply With Quote #6

You could file a bug. Or hope someone makes it. It could be a good learning process though Its not a really hard extension you can go off a very simple on that detours something.

Actually, just thinking about it you can probably use MemPatch. Do you just want the round to be blocked at certain times? If so you'd need to patch and un patch memory constantly (Where as a detour would just forward when it is called). But it can most likely be done with MemPatch
Dr!fter is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 01-30-2012 , 10:42   Re: [TF2] Prevent round end in arena mode?
Reply With Quote #7

I decided to give this a shot since I hadn't used SourceHook in such a long time It would be a good refresher and also learned a bit more about SourceHook heh.

The source for the extension is in the zip.

Note I gave this a very quick test. Also it seems that SetWinningTeam is called every game frame after a round should end (I assume if you spawn a player it will stop spamming it)

Currently I only compiled it for windows. If you need it for Linux let me know. Ill post it in the extension forum after you test it further

Include file
Attached Files
File Type: zip tf2-roundend.zip (59.8 KB, 263 views)

Last edited by Dr!fter; 01-31-2012 at 17:45.
Dr!fter is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 01-30-2012 , 11:26   Re: [TF2] Prevent round end in arena mode?
Reply With Quote #8



Looks amazing! I'll be developing a gamemode using this!

I'll test it when I get a chance.
__________________
Dr. McKay is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 01-30-2012 , 15:02   Re: [TF2] Prevent round end in arena mode?
Reply With Quote #9

I just realized i left a hardcoded true for one of the param's in the forward (bSwitchTeams). Ill fix this when I get home.
Dr!fter is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 01-30-2012 , 18:12   Re: [TF2] Prevent round end in arena mode?
Reply With Quote #10

Updated the zip to fix for the hardcoded true.
Dr!fter 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 00:05.


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