AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   is there any topic explain how collision works in game? (https://forums.alliedmods.net/showthread.php?t=336949)

LinLinLin 03-18-2022 10:09

is there any topic explain how collision works in game?
 
I am a L4D2 player and i am very confused about how collision works in game.
In L4D2 survivor will not collide with each other,but collides with special infected.And i use SDKHook_StartTouch to hook survivor touch each other,nothing happen.
I try to get the prop of survivor and infected,but they are the same.
Code:

    m_nSolidType == 2
    m_CollisionGroup == 5

I also test SDKHook_ShouldCollide in plugins ,but the game crash immediately with those error.
(i just start hook in "player_first_spawn" event and return true in ShouldCollide).
Code:

L 03/18/2022 - 05:58:14: SourceMod error session started
L 03/18/2022 - 05:58:14: Info (map "c2m2_fairgrounds") (file "F:\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\logs\errors_20220318.log")
L 03/18/2022 - 05:58:14: [SM] Exception reported: Stack leak detected: sp:21804 should be 21768!
L 03/18/2022 - 05:58:14: [SM] Exception reported: Not enough space on the stack

Maybe CollisionHook extension is the best way to avoid those question,but i would like to know more about collision in souce script.
Can someone explain what is collision group ,solid type and how to use ShouldCollide?
And if i want survivor in L4D2 can collide with each other,how can i get the target?
Thanks for your help.

Paimon 01-25-2024 04:05

Re: is there any topic explain how collision works in game?
 
emmm...
I dont know if you still need these but I will put them here...
https://developer.valvesoftware.com/...llision_groups
https://developer.valvesoftware.com/...lisionProperty


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

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