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

[TF2] Making owner of buildings able to pass through buildings


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
heavyisgps
Member
Join Date: Aug 2018
Old 09-22-2021 , 05:44   [TF2] Making owner of buildings able to pass through buildings
Reply With Quote #1

I'm trying to add the tf_bot engineer behaviour to players, where they can walk through their own buildings as if they were teammates.

So far I've tried to use SDKHook_ShouldCollide to false, as well as true, and that only changes whether or not the wrench can hit the sentry.

I've looked in to the prop m_CollisionGroup but not entirely sure what this can accomplish.

I am able to hook the sentry under the correct circumstance, I just can't make it behave like a friendly building without changing the owner, which is not an optimal solution.

Snippet:
PHP Code:

SDKHook
(clientSDKHook_TouchOnTouch);

    if (
StrEqual(entname"obj_sentrygun") || StrEqual(entname"obj_dispenser"))
    {
        
int iBuilder GetEntPropEnt(entProp_Send"m_hBuilder");

        if (
client == iBuilder){
            
            
//Here I need to somehow set the logic so the iBuilder can walk through these two ent names on touch.

            
SetEntProp(entProp_Send"m_CollisionGroup"18);
            
            
SDKHook(clientSDKHook_ShouldCollideShouldCollide);
            
        }
    }

public 
bool ShouldCollide(entitycollisiongroupcontentmaskbool result)
{    
    return 
false;

__________________
Creator of the Hi GPS Balance mod for TF2.

www.higps.no
heavyisgps is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 09-23-2021 , 00:35   Re: [TF2] Making owner of buildings able to pass through buildings
Reply With Quote #2

It appears there are changes to setcollisiongroup with the development version of SourceMod. Link: https://github.com/alliedmodders/sourcemod/pull/1507
PC Gamer 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 02:18.


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