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

Solved Disable collision on func_brush in map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NeoTheDev
Junior Member
Join Date: Feb 2022
Old 03-19-2022 , 04:44   Disable collision on func_brush in map
Reply With Quote #1

I have a map with a func_brush with clip texture that blocks player movement but I want to be able to disable it on demand using code in my sourcemod plugin.

I have tried changing render/solid type like this:

PHP Code:
char brush_name[32];
int index = -1;
while ((
index FindEntityByClassname(index"func_brush")) != -1) {
            if(
IsValidEntity(index)) {
                
GetEntPropString(indexProp_Data"m_iName"brush_namesizeof(brush_name));
                
                if (
StrEqual(brush_name"my_func_brush"false)) {

                        
SetEntityRenderMode(indexRENDER_NONE);
                        
SetEntProp(indexProp_Send"m_nSolidType"0);
                        
SetEntProp(indexProp_Send"m_CollisionGroup"0);
                        
SetEntProp(indexProp_Send"m_usSolidFlags"0x0004);

                }
                
            }
        } 
It finds my brush entity and makes it a bit broken because I can kinda walk into it but the player sometimes gets stuck in the brush and cant move anymore, glitchy AF.

Any ideas?

Last edited by NeoTheDev; 03-19-2022 at 05:28. Reason: Solved
NeoTheDev is offline
NeoTheDev
Junior Member
Join Date: Feb 2022
Old 03-19-2022 , 05:27   Re: Disable collision on func_brush in map
Reply With Quote #2

Solved it myself using AcceptEntityInput(index,"Disable"), working example:

PHP Code:
char brush_name[32];
int index = -1;
while ((
index FindEntityByClassname(index"func_brush")) != -1) {
            if(
IsValidEntity(index)) {
                
GetEntPropString(indexProp_Data"m_iName"brush_namesizeof(brush_name));
                
                if (
StrEqual(brush_name"my_func_brush"false)) {

                        
AcceptEntityInput(index,"Disable")

                }
                
            }
        } 
NeoTheDev is offline
stece
Junior Member
Join Date: May 2021
Old 03-19-2022 , 05:58   Re: Disable collision on func_brush in map
Reply With Quote #3

Hey Neo,

I found your post and I was trying to figure something simular out you maybe could help with. How did you set a clip brush on your entity?
stece is offline
NeoTheDev
Junior Member
Join Date: Feb 2022
Old 03-19-2022 , 07:54   Re: Disable collision on func_brush in map
Reply With Quote #4

Quote:
Originally Posted by stece View Post
Hey Neo,

I found your post and I was trying to figure something simular out you maybe could help with. How did you set a clip brush on your entity?
In my case the clip brush was part of the map itself and not generated with code. So in hammer the brush was added with clip texture and then my plugin would enable/disable it depending on the needs.
NeoTheDev is offline
NeoTheDev
Junior Member
Join Date: Feb 2022
Old 03-19-2022 , 07:59   Re: Disable collision on func_brush in map
Reply With Quote #5

Quote:
Originally Posted by stece View Post
Hey Neo,

I found your post and I was trying to figure something simular out you maybe could help with. How did you set a clip brush on your entity?
https://forums.alliedmods.net/showpo...8&postcount=65

Maybe this is what you need? This method can be used to create "fake walls" using a prop and not rendering its model.
NeoTheDev 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:53.


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