Discussion:
[hlcoders] Goldsrc pev->solid
rimischonie
2015-06-05 20:41:06 UTC
Permalink
Hi guys, i have a question related pev->solid


so with pev->solid i can change the collision of the entity but i want to
change it for the player on by collision basis.

Like if you hit another player change the collision to something else that
you can pass thru.

if i do it into the spawn it stays forever.

But i dont have a clue on how to check the collision to the other player.

Am i using the UTIL_FindEntityInSphere function to check for radius and if
something is in range entity->solid? Or is there another easier way to do
it?

Greetings
James Marchant
2015-06-05 21:48:18 UTC
Permalink
Hi.
I'm not 100% sure what you're asking, but I think you mean making it so players don't collide with each other? I've come across this problem myself, and never really resolved it in a satisfactory way.
The most recent method was setting pev->groupinfo to 1 in prethink on players, and using UTIL_SetGroupTrace( pev->groupinfo, GROUP_OP_NAND ); straight after. Then in postthink, use UTIL_SetGroupTrace( pev->groupinfo, GROUP_OP_AND );
I can't remember off the top of my head why this works as it's been a long time, I just know that it probably should work. I'll leave it up to you to do the research on grouptrace, as I cannot for the life of me remember anything about it. Therefore, I cannot guarantee what side effects or issues this may cause.

One other thing you can do that I remember better, is perform a UTIL_EntitiesInBox check (with a FL_CLIENT filter) to find all clients colliding in the player's bounding box. Do this every frame. This should fire when players touch (but there is a small latency where they touch each other for a short while before it fires) and at that point you can set the player to be non-solid with pev->solid = SOLID_NOT. Don't forget to check that the player is not colliding with himself. UTIL_EntitiesInBox is better as it only search within the player's collision, whereas UTIL_FindEntityInSphere will be really rough and inaccurate. Don't forget to set the player back to solid if he is not colliding with another player. However, this method is less than ideal as a non-solid player cannot be attacked by monsters, and they cannot trigger triggers. I believe there are also some issues with prediction if a player is not as SOLID_SLIDEBOX too? Expect problems.
There is also "ShouldCollide" but as far as I know, that does not apply to players.
Hope this helps.
James

Date: Fri, 5 Jun 2015 22:41:06 +0200
From: ***@googlemail.com
To: ***@list.valvesoftware.com
Subject: [hlcoders] Goldsrc pev->solid

Hi guys, i have a question related pev->solid


so with pev->solid i can change the collision of the entity but i want to change it for the player on by collision basis.

Like if you hit another player change the collision to something else that you can pass thru.

if i do it into the spawn it stays forever.

But i dont have a clue on how to check the collision to the other player.

Am i using the UTIL_FindEntityInSphere function to check for radius and if something is in range entity->solid? Or is there another easier way to do it?

Greetings


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
Tony "omega" Sergi
2015-06-06 02:06:03 UTC
Permalink
you have to modify pm_shared to do anything with player collision.
changing the solid will just change interaction of the player with
non-world/player entities.
all player collision is handled via the movement traces/hulls.

i don't have anything infront of me anymore, but it's all there.
Post by James Marchant
Hi.
I'm not 100% sure what you're asking, but I think you mean making it so
players don't collide with each other? I've come across this problem
myself, and never really resolved it in a satisfactory way.
The most recent method was setting pev->groupinfo to 1 in prethink on
players, and using UTIL_SetGroupTrace( pev->groupinfo, GROUP_OP_NAND );
straight after. Then in postthink, use UTIL_SetGroupTrace( pev->groupinfo,
GROUP_OP_AND );
I can't remember off the top of my head why this works as it's been a long
time, I just know that it probably should work. I'll leave it up to you to
do the research on grouptrace, as I cannot for the life of me remember
anything about it. Therefore, I cannot guarantee what side effects or
issues this may cause.
One other thing you can do that I remember better, is perform
a UTIL_EntitiesInBox check (with a FL_CLIENT filter) to find all clients
colliding in the player's bounding box. Do this every frame. This should
fire when players touch (but there is a small latency where they touch each
other for a short while before it fires) and at that point you can set the
player to be non-solid with pev->solid = SOLID_NOT. Don't forget to check
that the player is not colliding with himself. UTIL_EntitiesInBox is better
as it only search within the player's collision,
whereas UTIL_FindEntityInSphere will be really rough and inaccurate. Don't
forget to set the player back to solid if he is not colliding with another
player. However, this method is less than ideal as a non-solid player
cannot be attacked by monsters, and they cannot trigger triggers. I believe
there are also some issues with prediction if a player is not as
SOLID_SLIDEBOX too? Expect problems.
There is also "ShouldCollide" but as far as I know, that does not apply to players.
Hope this helps.
James
------------------------------
Date: Fri, 5 Jun 2015 22:41:06 +0200
Subject: [hlcoders] Goldsrc pev->solid
Hi guys, i have a question related pev->solid
so with pev->solid i can change the collision of the entity but i want to
change it for the player on by collision basis.
Like if you hit another player change the collision to something else that
you can pass thru.
if i do it into the spawn it stays forever.
But i dont have a clue on how to check the collision to the other player.
Am i using the UTIL_FindEntityInSphere function to check for radius and
if something is in range entity->solid? Or is there another easier way to
do it?
Greetings
_______________________________________________ To unsubscribe, edit your
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
--
-Tony
rimischonie
2015-06-06 07:47:37 UTC
Permalink
Thanks for the information that sounds quite better for my understanding
with the inBox function.
For a better understanding i am trying to create a semiclip feature in to
it. I have the problem atm, when the semiclip is active the traceline of
the tripmine is not working e.g its not exploiding.

I think will research further into it since modding is really new for me.

Greetings.
rimischonie
2015-06-06 07:54:32 UTC
Permalink
Thanks omega, yours and james way seems better. since its new to me its
hard to read code.
But i should take a deeper look in both ways in the pm_shared and in james
method.

Loading...