PDA

View Full Version : disable playercollision Voron's libcod



Ni3ls
16th December 2018, 20:52
Hi all,

I have the latest version libcod made by Voron.

set g_playerCollision 0
set g_playerEject 0

If i use these commands there is no player collision but I cant see the playername above his head and I cant hit the player anymore.


set g_playerCollision 1
set g_playerEject 0
If I use these commands there is no player collision but I can see the playername above his head but I cant hit the player anymore.

What are the correct commands?

IzNoGoD
16th December 2018, 21:30
Try the final one, but with an added self setcontents(256|32); in the onspawn thingy

maxdamage99
17th December 2018, 15:53
g_playerCollision 0




spawnPlayer()
{
self setContents(288); // without collision
self setContents(33554432); // collision
}




g_playerEject 1/0

for glitch on/off

filthy_freak_
18th December 2018, 06:15
I don't think you can have player names + no collision. If someone figures it out, let us know.

voron00
18th December 2018, 09:10
Just make your own player names huds with setPlayerNameString() when using setContents(288)

filthy_freak_
18th December 2018, 21:40
Just make your own player names huds with setPlayerNameString() when using setContents(288)

I've already tried that. Imagine having 100+ ping and trying to track a player that is moving.

Also IsLookingAt() breaks with no collision.

filthy_freak_
18th December 2018, 22:16
To further add to my previous message, if you do "self setcontents(8320);" instead of 288, that fixes IsLookingAt(). I don't know why though. It gives me hope that a similar solution can be found to fix player names.

maxdamage99
19th December 2018, 11:14
To further add to my previous message, if you do "self setcontents(8320);" instead of 288, that fixes IsLookingAt(). I don't know why though. It gives me hope that a similar solution can be found to fix player names.

with


g_playerCollision 0

and


setContents(288);


bullettrace - work
isLookingAt() - idk

Ni3ls
21st December 2018, 11:30
How did you find out those numbers?

kung foo man
21st December 2018, 12:41
Should be these CONTENTS_ flags: https://github.com/iortcw/iortcw/blob/master/MP/code/qcommon/surfaceflags.h




#define CONTENTS_SOLID 1 // an eye is never valid in a solid

#define CONTENTS_LIGHTGRID 4 //----(SA) added

#define CONTENTS_LAVA 8
#define CONTENTS_SLIME 16
#define CONTENTS_WATER 32
#define CONTENTS_FOG 64


//----(SA) added
#define CONTENTS_MISSILECLIP 128 // 0x80
#define CONTENTS_ITEM 256 // 0x100
//----(SA) end
#define CONTENTS_MOVER 0x4000
#define CONTENTS_AREAPORTAL 0x8000

#define CONTENTS_PLAYERCLIP 0x10000
#define CONTENTS_MONSTERCLIP 0x20000

//bot specific contents types
#define CONTENTS_TELEPORTER 0x40000
#define CONTENTS_JUMPPAD 0x80000
#define CONTENTS_CLUSTERPORTAL 0x100000
#define CONTENTS_DONOTENTER 0x200000
#define CONTENTS_DONOTENTER_LARGE 0x400000


#define CONTENTS_ORIGIN 0x1000000 // removed before bsping an entity

#define CONTENTS_BODY 0x2000000 // should never be on a brush, only in game
#define CONTENTS_CORPSE 0x4000000
#define CONTENTS_DETAIL 0x8000000 // brushes not used for the bsp

#define CONTENTS_STRUCTURAL 0x10000000 // brushes used for the bsp
#define CONTENTS_TRANSLUCENT 0x20000000 // don't consume surface fragments inside
#define CONTENTS_TRIGGER 0x40000000
#define CONTENTS_NODROP 0x80000000 // don't leave bodies or items (death fog, lava)



E.g. 288 would be 256 + 32, which is CONTENTS_ITEM + CONTENTS_WATER


Or these ones? https://github.com/voron00/libcod/blob/86acac07acaf3bbb3e6f9b9805a819706a18194e/declarations.hpp#L2014-L2041



#define CONTENTS_SOLID 1
#define CONTENTS_NONCOLLIDING 4
#define CONTENTS_LAVA 8
#define CONTENTS_WATER 0x20
#define CONTENTS_CANSHOTCLIP 0x40
#define CONTENTS_MISSILECLIP 0x80
#define CONTENTS_VEHICLECLIP 0x200
#define CONTENTS_ITEMCLIP 0x400
#define CONTENTS_SKY 0x800
#define CONTENTS_AI_NOSIGHT 0x1000
#define CONTENTS_CLIPSHOT 0x2000
#define CONTENTS_MOVER 0x4000
#define CONTENTS_PLAYERCLIP 0x10000
#define CONTENTS_MONSTERCLIP 0x20000
#define CONTENTS_TELEPORTER 0x40000
#define CONTENTS_JUMPPAD 0x80000
#define CONTENTS_CLUSTERPORTAL 0x100000
#define CONTENTS_DONOTENTER 0x200000
#define CONTENTS_DONOTENTER_LARGE 0x400000

#define CONTENTS_MANTLE 0x1000000
#define CONTENTS_DETAIL 0x8000000
#define CONTENTS_STRUCTURAL 0x10000000
#define CONTENTS_TRANSPARENT 0x20000000
#define CONTENTS_NODROP 0x80000000

#define CONTENTS_BODY 0x2000000
#define CONTENTS_TRIGGER 0x40000000


IDK, whatever makes most sense, somebody can test it

In Vorons list I don't see any number for `Number(256).toString(16)` which would be hex 0x100

`Number(8320).toString(16)` would be 0x2080, which is CONTENTS_CLIPSHOT + CONTENTS_MISSILECLIP, I would guess you just need to add CONTENTS_PLAYERCLIP 0x10000


0x10000 + 0x2000 + 0x80 == 73856 (clipshot + missleclip + playerclip, might work..)

You can calculate these numbers easily in every browser F12/devtools console... JavaScript supports everything you might need to calculate that stuff

PatmanSan
22nd December 2018, 20:43
These are extracted from the asset manager:


Surface Surface Surface
Unknown Type Flags Extra flag
------------------------------------------------------------
0x00000000 0x00000000 0x00000000 0x00000000 NoLightMap
0x00000000 0x00000000 0x00000000 0x00000001 Occluder
0x00000000 0x00000000 0x00000000 0x00000002 DrawToggle
0x00000001 0x00000000 0x00000000 0x00000004 Origin
0x00000000 0x00000000 0x00000000 0x00000008 RadialNormals
0x00000001 0x00000000 0x00000004 0x00000000 NonColliding
0x00000000 0x00000000 0x00000040 0x00000000 CanShootClip
0x00000001 0x00000000 0x00000080 0x00000000 MissileClip
0x00000001 0x00000000 0x00000200 0x00000000 VehicleClip
0x00000001 0x00000000 0x00000400 0x00000000 ItemClip
0x00000001 0x00000000 0x00001000 0x00000000 AISightClip
0x00000001 0x00000000 0x00002000 0x00000000 BulletClip
0x00000001 0x00000000 0x00010000 0x00000000 PlayerClip
0x00000001 0x00000000 0x00020000 0x00000000 AIClip
0x00000000 0x00000000 0x08000000 0x00000000 Detail
0x00000000 0x00000000 0x10000000 0x00000000 Structural
0x00000000 0x00000000 0x20000000 0x00000000 Tranparent
0x00000001 0x00000000 0x80000000 0x00000000 NoDrop
0x00000000 0x00000001 0x00000000 0x00000000 NoFallDamage
0x00000000 0x00000002 0x00000000 0x00000000 Slick
0x00000001 0x00000004 0x00000800 0x00000000 Sky
0x00000000 0x00000008 0x00000000 0x00000000 Ladder
0x00000000 0x00000010 0x00000000 0x00000000 NoImpact
0x00000000 0x00000020 0x00000000 0x00000000 NoMarks
0x00000000 0x00000080 0x00000000 0x00000000 NoDraw
0x00000000 0x00002000 0x00000000 0x00000000 NoSteps
0x00000001 0x00004000 0x00000000 0x00000000 NonSolid
0x00000000 0x00020000 0x00000000 0x00000000 NoDynamicLight
0x00000000 0x00040000 0x00000000 0x00000000 NoCastShadow
0x00000000 0x00100000 0x00000000 0x00000000 Bark
0x00000000 0x00200000 0x00000000 0x00000000 Brick
0x00000000 0x00300000 0x00000000 0x00000000 Carpet
0x00000000 0x00400000 0x00000000 0x00000000 Cloth
0x00000000 0x00500000 0x00000000 0x00000000 Concrete
0x00000000 0x00600000 0x00000000 0x00000000 Dirt
0x00000000 0x00700000 0x00000000 0x00000000 Flesh
0x00000001 0x00800000 0x00000002 0x00000000 Foliage
0x00000001 0x00900000 0x00000010 0x00000000 Glass
0x00000000 0x00A00000 0x00000000 0x00000000 Grass
0x00000000 0x00B00000 0x00000000 0x00000000 Gravel
0x00000000 0x00C00000 0x00000000 0x00000000 Ice
0x00000000 0x00D00000 0x00000000 0x00000000 Metal
0x00000000 0x00E00000 0x00000000 0x00000000 Mud
0x00000000 0x00F00000 0x00000000 0x00000000 Paper
0x00000000 0x01000000 0x00000000 0x00000000 Plaster
0x00000000 0x01100000 0x00000000 0x00000000 Rock
0x00000000 0x01200000 0x00000000 0x00000000 Sand
0x00000000 0x01300000 0x00000000 0x00000000 Snow
0x00000001 0x01400000 0x00000020 0x00000000 Water
0x00000000 0x01500000 0x00000000 0x00000000 Wood
0x00000000 0x01600000 0x00000000 0x00000000 Asphalt
0x00000000 0x02000000 0x01000000 0x00000000 MantleOn
0x00000000 0x04000000 0x01000000 0x00000000 MantleOver
0x00000001 0x80000000 0x00000000 0x00000000 Portal


Flag and extra flag are added when put in material files.

filthy_freak_
23rd December 2018, 00:35
Thanks everyone for the information.

I played around and it looks like CONTENTS_BODY is responsible for displaying the player names, unfortunately enabling it forces collision on so I don't think no collision + player names will be possible.

I did some further digging and found that you can also disable collision by hooking SV_ClipMoveToEntity but it is server-side so there is a delay due to your ping and it will take an extra second before it will allow you to walk through a player.

So unfortunately it looks like proper no collision + player names is not possible.