Raised This Month: $32 Target: $400
 8% 

Fake touch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 12-20-2017 , 13:23   Fake touch
Reply With Quote #1

Is such thing possible? May I have an example code of how to "lie" to the engine that two entities are touching?
eyal282 is offline
neatek
AlliedModders Donor
Join Date: Jul 2010
Location: Russia
Old 12-20-2017 , 13:28   Re: Fake touch
Reply With Quote #2

Teleport one entity to another and back for 0.001 sec

__________________

Last edited by neatek; 12-20-2017 at 13:29.
neatek is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 12-20-2017 , 13:40   Re: Fake touch
Reply With Quote #3

Quote:
Originally Posted by neatek View Post
Teleport one entity to another and back for 0.001 sec

https://www.youtube.com/watch?v=Gmyv13Avmfs

I have no clue how to use a signature that forces pounce. So asking for a fake touch increases the chance I get help since it's not limited to Left 4 Dead 2.
eyal282 is offline
neatek
AlliedModders Donor
Join Date: Jul 2010
Location: Russia
Old 12-20-2017 , 13:52   Re: Fake touch
Reply With Quote #4

Nice (video*) words from russian prezident
nah, i'm not strong in signatures, maybe @bailopan or @peace-maker will help you.

Sounds good, no action. *Donald
__________________

Last edited by neatek; 12-20-2017 at 13:54.
neatek is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 01-13-2018 , 18:06   Re: Fake touch
Reply With Quote #5

You can try creating an SDKCall for CBaseEntity::Touch( CBaseEntity* pOther ) which (I think) gets called when 2 entities touch each other.

Here is some code that should do that:

PHP Code:
Handle g_hSDK_Touch;

public 
void OnPluginStart()
{
    
Handle hGameConf LoadGameConfigFile("sdkhooks.games");
    if(
hGameConf == INVALID_HANDLE)
    {
        
SetFailState("GameConfigFile sdkhooks.games was not found");
        return;
    }
    
    
StartPrepSDKCall(SDKCall_Entity);
    
PrepSDKCall_SetFromConf(hGameConfSDKConf_Virtual"Touch");
    
PrepSDKCall_AddParameter(SDKType_CBaseEntitySDKPass_Pointer);
    
g_hSDK_Touch EndPrepSDKCall();
    
CloseHandle(hGameConf);

    if(
g_hSDK_Touch == INVALID_HANDLE)
    {
        
SetFailState("Unable to prepare virtual function CBaseEntity::Touch");
        return;
    }
}

// later when you want to call it
SDKCall(g_hSDK_Touchentity1entity2); 
This will just call the Touch function for the 2 entities which should simulate them "touching" (or at least the code that runs when they do), but it might not necessarily work the way you expect to or give you the effect you're looking for.

Last edited by hmmmmm; 01-13-2018 at 18:07.
hmmmmm is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 01-16-2018 , 18:59   Re: Fake touch
Reply With Quote #6

Quote:
Originally Posted by hmmmmm View Post
You can try creating an SDKCall for CBaseEntity::Touch( CBaseEntity* pOther ) which (I think) gets called when 2 entities touch each other.

Here is some code that should do that:

PHP Code:
Handle g_hSDK_Touch;

public 
void OnPluginStart()
{
    
Handle hGameConf LoadGameConfigFile("sdkhooks.games");
    if(
hGameConf == INVALID_HANDLE)
    {
        
SetFailState("GameConfigFile sdkhooks.games was not found");
        return;
    }
    
    
StartPrepSDKCall(SDKCall_Entity);
    
PrepSDKCall_SetFromConf(hGameConfSDKConf_Virtual"Touch");
    
PrepSDKCall_AddParameter(SDKType_CBaseEntitySDKPass_Pointer);
    
g_hSDK_Touch EndPrepSDKCall();
    
CloseHandle(hGameConf);

    if(
g_hSDK_Touch == INVALID_HANDLE)
    {
        
SetFailState("Unable to prepare virtual function CBaseEntity::Touch");
        return;
    }
}

// later when you want to call it
SDKCall(g_hSDK_Touchentity1entity2); 
This will just call the Touch function for the 2 entities which should simulate them "touching" (or at least the code that runs when they do), but it might not necessarily work the way you expect to or give you the effect you're looking for.
Doesn't work... Any method to trick the game further? Combine touch with think ETC? I don't understand the core of how these things work.
eyal282 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 01-17-2018 , 04:11   Re: Fake touch
Reply With Quote #7

Can we see how you're calling the function? Also you said you're doing this to "force pounce", can you give more details about that. There's prob a better way of doing this.
hmmmmm is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 01-18-2018 , 09:33   Re: Fake touch
Reply With Quote #8

Quote:
Originally Posted by eyal282 View Post
Doesn't work... Any method to trick the game further? Combine touch with think ETC? I don't understand the core of how these things work.
It works for some results, maybe you should give more details about what you are trying todo.
For example: If I like to fake a player touching a trigger_teleport it works, but if you try to have positive feedbacks on collisionhooks this won't work.
__________________
zipcore 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 08:21.


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