Raised This Month: $299 Target: $400
 74% 

[TF2] Forcing doors open/removing them entirely?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SephirothSG
SourceMod Donor
Join Date: Jun 2013
Old 01-11-2014 , 02:30   [TF2] Forcing doors open/removing them entirely?
Reply With Quote #1

So I've been struggling to get this to work how I want it, I originally tried the following
PHP Code:
{
        if (
g_bOpenDoors)
        {
                new 
ent MAXPLAYERS+1;
                while((
ent FindEntityByClassname(ent"func_door"))!=-1
                {
                        if (
IsValidEdict(ent))
                        {
                                
AcceptEntityInput(ent"unlock", -1);
                                
AcceptEntityInput(ent"open", -1);
                        }
                }
                
                
ent MAXPLAYERS+1;
                while((
ent FindEntityByClassname(ent"prop_dynamic"))!=-1
                {
                        if (
IsValidEdict(ent))
                        {
                                new 
String:tName[64];
                                
GetEntPropString(entProp_Data"m_iName"tNamesizeof(tName));
                                if ((
StrContains(tName,"door",false)!=-1) || (StrContains(tName,"gate",false)!=-1))
                                {
                                        
AcceptEntityInput(ent"unlock", -1);
                                        
AcceptEntityInput(ent"open", -1);
                                }
                        }
                }
        }

While this appears to work, the doors close if a player walks through the trigger that is meant to open the door.

I then attempted to use Stripper:Source to simply remove all func_doors, while this does remove the doors it also leaves the texture of the doors there (This causes no issues as you can just pass straight through them, however it confuses players), I figured the following in Stripper would remove those annoying textures however it did not
PHP Code:
modify:
{
    
match:
    {
    
"model" "models/props_gameplay/door_slide_large_door.mdl"
    "classname" "prop_dynamic"
    
}
    
delete:
    {
    
"model" "models/props_gameplay/door_slide_large_door.mdl"
    
}

Am I missing something extremely obvious here?

Last edited by SephirothSG; 01-11-2014 at 02:57.
SephirothSG is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 01-11-2014 , 07:29   Re: [TF2] Forcing doors open/removing them entirely?
Reply With Quote #2

How about this?
PHP Code:
if (g_bOpenDoors) {
    new 
ent MAXPLAYERS+1;
    while((
ent FindEntityByClassname(ent"func_door"))!=-1) {
        if (
IsValidEdict(ent)) {
            
AcceptEntityInput(ent"KillHierarchy");
        }
    }

xf117 is offline
Send a message via ICQ to xf117
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 01-11-2014 , 09:45   Re: [TF2] Forcing doors open/removing them entirely?
Reply With Quote #3

You use the inputs unlock and open, but have you tried locking it open? I don't know if it will work, but it is worth a try.
Marcus_Brown001 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-11-2014 , 10:02   Re: [TF2] Forcing doors open/removing them entirely?
Reply With Quote #4

Killing doors is a problem simply because well-optimized maps have func_areaportals inside doors... and their open/close state is directly tied to the door's.

I'd recommend trying what Marcus_Brown001 suggested.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 01-11-2014 , 10:24   Re: [TF2] Forcing doors open/removing them entirely?
Reply With Quote #5

I have never tested it on func_door's, but on a rotating door I remember being able to open it, and lock it open. Then whenever someone tried to close it, it would do the locked animation.
Marcus_Brown001 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-11-2014 , 21:53   Re: [TF2] Forcing doors open/removing them entirely?
Reply With Quote #6

Ive some methods off forcing doors here: https://forums.alliedmods.net/showthread.php?p=1863390
Basically you have 4 options:
1) Delete them, and force areaportsls open (preferably just those associated with given doors)
2) Force them open, and disable their associated trigger_multiple by either deleting it, or by hooking its start touch and returning plugin_handled
3) take freak fortress 2's approach, and constantly send inputs to open them on a timer.
4) use stripper source to set them up, so they are how you want them before the map runs.

And yes, killing doors will generally nuke their parented models, which will reveal nodraw.
Generally best to force them open and nuke the triggers that is used to close them. Also make sure to disable the auto close.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 01-11-2014 at 21:55.
friagram is offline
SephirothSG
SourceMod Donor
Join Date: Jun 2013
Old 01-12-2014 , 00:26   Re: [TF2] Forcing doors open/removing them entirely?
Reply With Quote #7

Quote:
Originally Posted by Marcus_Brown001 View Post
You use the inputs unlock and open, but have you tried locking it open? I don't know if it will work, but it is worth a try.
Quote:
Originally Posted by Marcus_Brown001 View Post
I have never tested it on func_door's, but on a rotating door I remember being able to open it, and lock it open. Then whenever someone tried to close it, it would do the locked animation.
Quote:
Originally Posted by Powerlord View Post
Killing doors is a problem simply because well-optimized maps have func_areaportals inside doors... and their open/close state is directly tied to the door's.

I'd recommend trying what Marcus_Brown001 suggested.
I hate to be a pain, could you provide some example code?
SephirothSG is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-12-2014 , 01:08   Re: [TF2] Forcing doors open/removing them entirely?
Reply With Quote #8

Locking will do nothing if a trigger sends an input to force the door...
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
SephirothSG
SourceMod Donor
Join Date: Jun 2013
Old 01-12-2014 , 01:52   Re: [TF2] Forcing doors open/removing them entirely?
Reply With Quote #9

Quote:
Originally Posted by friagram View Post
Ive some methods off forcing doors here: https://forums.alliedmods.net/showthread.php?p=1863390
Basically you have 4 options:
1) Delete them, and force areaportsls open (preferably just those associated with given doors)
2) Force them open, and disable their associated trigger_multiple by either deleting it, or by hooking its start touch and returning plugin_handled
3) take freak fortress 2's approach, and constantly send inputs to open them on a timer.
4) use stripper source to set them up, so they are how you want them before the map runs.

And yes, killing doors will generally nuke their parented models, which will reveal nodraw.
Generally best to force them open and nuke the triggers that is used to close them. Also make sure to disable the auto close.
Suggestion on how to remove only the triggers for the doors and not every trigger?
SephirothSG is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-12-2014 , 02:36   Re: [TF2] Forcing doors open/removing them entirely?
Reply With Quote #10

Well, you could try modifying tf_filter_team entities, so the filters always fail, pretty much only doors/buttons use them. Likewise, you could just disable the trigger multiples multiples since mostly just doors use them. Its likely the origins of the triggers will be within say, 20-50 units of the door origins they are responsible for too. Unfortunately you cannot easily read inputs/outputs of entities in game.

Honestly, the easiest way would just be to throw them all in an adt array, and just send them open inputs every 0.1 seconds. Its hacky, but its always going to work, on any map... Just find them all on round start.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 00:29.


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