AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved FM_ShouldCollide is never called. (https://forums.alliedmods.net/showthread.php?t=343314)

Natsheh 07-11-2023 20:09

FM_ShouldCollide is never called.
 
I want to disable collision for NPCs but engfunc ShouldCollide is never called even though i tried moving the NPCs using Engfunc_MoveToOrigin to call it from SV_movestep which calls SV_Move and SV_Move calls ClipToLink which calls ShouldCollide, but no luck at all.

Natsheh 07-14-2023 23:28

Re: FM_ShouldCollide is never called.
 
BUMp

JusTGo 07-15-2023 03:19

Re: FM_ShouldCollide is never called.
 
Is your NPC solid? If I remember correctly not all SOLID types gets called in pfnShouldCollide

Natsheh 07-15-2023 06:07

Re: FM_ShouldCollide is never called.
 
Quote:

Originally Posted by JusTGo (Post 2807210)
Is your NPC solid? If I remember correctly not all SOLID types gets called in pfnShouldCollide

Yea its solid slidebox

JusTGo 07-15-2023 15:05

Re: FM_ShouldCollide is never called.
 
Quote:

Originally Posted by Natsheh (Post 2807216)
Yea its solid slidebox

Are using ReHLDS? also show your code so we can reproduce it

Natsheh 07-15-2023 15:36

Re: FM_ShouldCollide is never called.
 
Quote:

Originally Posted by JusTGo (Post 2807243)
Are using ReHLDS? also show your code so we can reproduce it

Yeah,

PHP Code:

public plugin_init()
register_forward(FM_ShouldCollide"pfnShouldCollide", ._post false);

public 
pfnShouldCollide(const touched, const passedict)
{
    
cprint_chat(0_"Colliding %d >< %d"touchedpassedict);

    if(
pev(touchedNPC_ID) == pev(passedictNPC_ID))
    {
        
//forward_return(FMV_CELL, 0);
    
}


This is never called, and yesi am using rehlds and regamedll

Natsheh 07-15-2023 18:54

Re: FM_ShouldCollide is never called.
 
Solved thanks to JustGo for revealing that if you disable/comment out the gamemod from liblist.gam the forward will work some how.

Btw if you want to hook FM_ShouldCollide you better do it outside plugin_init and delay the hooking so it doesn't increase map load time.

SHIELD755 08-05-2023 21:21

Re: FM_ShouldCollide is never called.
 
Quote:

Originally Posted by Natsheh (Post 2807248)
Solved thanks to JustGo for revealing that if you disable/comment out the gamemod from liblist.gam the forward will work some how.

Btw if you want to hook FM_ShouldCollide you better do it outside plugin_init and delay the hooking so it doesn't increase map load time.

sorry for reviving this again , disabling the gamemode will not cause any issue to server ? i wanna know

Natsheh 08-06-2023 00:15

Re: FM_ShouldCollide is never called.
 
Quote:

Originally Posted by SHIELD755 (Post 2808267)
sorry for reviving this again , disabling the gamemode will not cause any issue to server ? i wanna know

As far as i know, no issues will be created


All times are GMT -4. The time now is 14:14.

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