Garry's Mod

Garry's Mod

1,328 ratings
Door Removal Areaportal Fix
2
3
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Realism
File Size
Posted
Updated
2.492 KB
26 Jul, 2021 @ 1:45pm
21 Feb @ 4:20pm
4 Change Notes ( view )

Subscribe to download
Door Removal Areaportal Fix

Description
Now works with door-destruction addons!

This quick-fix addon stops the visual oddity which sometimes occurs when a door is removed, where the door will appear to lead into the void. This works for double-doors as well if one of the side doors are removed. The strange effect will only appear for a second before the doorway returns to normal, as opposed to being a permanent fixture.

In reality, the "void" is just the result of the door leaving its linked areaportal, a mapping entity which is used in optimization, disabled without having the chance to re-enable it before it's removed. This addon just checks whenever a door is removed if it has a linked areaportal, and if it does, both makes the areaportal visible and leaves it active in the case of a double door. This should help prevent the odd visuals most of the time.

This starts working automatically, just subscribe to it for it to begin working. It should only act upon the removal of a viable door, this doesn't run in the background constantly. I hope this helps!

This should not impact performance in any significant way. In fact, it won't do anything at all if a door isn't removed. If a door is removed, it's the same as if the door is open.

All this addon does is check to see if any door being removed has a linked areaportal, and if it does, it makes sure to turn the linked areaportal on (stops the void effect) and also stops doors with the same name as the one removed from being able to re-disable it by opening/closing the door (like with double doors). There are ways to destroy a door which has the areaportal work nicely and re-enable itself, but the basic remove function is apparently not one of those, and so if anything this addon is just a small extra check to make sure the areaportal plays nicely when a door linked to it is removed for any reason.

Clickbait final image edit : IntellectualPotato (very nice)

maps : gm_york_remastered
rp_unioncity
138 Comments
Peekofwar 1 Jun @ 10:38am 
Strange. I deleted a door yesterday on GM_Construct_Vingret, and the area portal stuck around... I reconnected to my server today, found the same door with the areaportal still present, cleaned up the map and then deleted the door again... This time the area portal vanished after about a second. Not sure why that happened.
mansion gaming 7 Apr @ 5:30pm 
invisible Doors bruh
OnTheMatter  [author] 21 Feb @ 4:26pm 
Updated it, should be good, I stopped getting the double-spawn on my end. It seems like saving/loading is a little bugged on the beta branch currently regardless though (maybe main branch also, didn't check, idk), so be careful.
OnTheMatter  [author] 21 Feb @ 4:18pm 
No you're fine, I've got it isolated and fixed, just slightly worried about it throwing errors, let me know if it does!
Pinkolol16 21 Feb @ 4:10pm 
yeah i only had ragdolls enabled and i was loading a save specifically with that, and isolated all my legacy and other addons as well. literally just 5 packs of ragdolls and a save and this addon and it caused that weird stuff.
i don't download server-related things and i spent several hours whittling it down to just this addon so yeah
OnTheMatter  [author] 21 Feb @ 1:58pm 
It seems like loading saves is a little broken/jank on this current branch even with the addon disabled, the functionality seems weird, like when you cleanup the map, it treats it as though you are reloading the save. Potentially may be intentional, but is still weird and janky. The double spawning is definitely something relating to my addon though, hopefully it is only a more recent bug caused by whatever update made the save loading jank LOL, I'll figure it out
OnTheMatter  [author] 21 Feb @ 9:42am 
Yeah, that is omega-jank, I'll fix it tonight, thanks again for the heads up @Pinkolol16!
OnTheMatter  [author] 21 Feb @ 9:28am 
Shit, yeah you're right! I'll mess around with it some more in a bit and see what could be the issue, thanks for letting me know!
OnTheMatter  [author] 21 Feb @ 9:26am 
HMM, I am getting the bug in my testing as well after tweaking the code, although it only seems to happen when I make a save and then load that same save after, not any other times I load it, interesting, I'll look into it some more
OnTheMatter  [author] 21 Feb @ 9:12am 
It could theoretically be a conflict with something editing the entity meta table in a sloppy way; I'll update it real quick to make that possible conflict pretty much impossible. If it is still jank, then I'd recommend clearing your server downloads as there might be some funky script(s), etc in there interacting fuckishly with it.