Clientside traces not returning serverside entities on dedicated servers?

Whenever running traces from the client on a dedicated server, the only values they will return are that they’ve hit the world, and that they’ve touched worldspawn. This is quite the roadblock for me.

Is QuickTrace working as intended? Is there a way to efficiently trace on the server based on a client’s screen information?


local trace, results = {
start=Vector(0,0,0), // Where ever you want to start the trace from
endpos=Vector(0,0,0), // Where ever you want to end the trace at
filter = {}, // An optional list of filtered entities
mask = MASK_SHOT

results = util.TraceLine(trace);

results should look something like this :

HitBox	=	16
HitNonWorld	=	true
HitGroup	=	2
HitPos	=	277.608459 -712.124451 -12747.788086
FractionLeftSolid	=	0
StartSolid	=	false
Hit	=	true
HitWorld	=	false
SurfaceProps	=	39
Normal	=	0.951839 0.263815 -0.156220
HitBoxBone	=	3
HitSky	=	false
MatType	=	70
PhysicsBone	=	1
HitTexture	=	**studio**
HitNormal	=	-0.991717 0.066177 -0.110082
Entity	=	NPC [88][npc_kleiner]
Fraction	=	0.0023089025635272
StartPos	=	205.594147 -732.084167 -12735.968750
HitNoDraw	=	false

I yield similar results when using singleplayer and listen servers. Was that trace done on a dedicated server?

What are you trying to achieve actually?

This is for a WoW/Dota hybrid RPG gamemode I’m currently working on.

It’s essentially part of a targeting system that gets the casting state of the player, spell id of the cast, and entity of the trace and then sends it through a networked var system where its interpreted from the server, then set on both the server and the client so that I can use its entity to make it take serverside damage/spell effects.

In addition to this problem, another is that none of my nwvars set on the client can be read or initialized from the server, no matter how I set things up. Gmod just isn’t built for this kind of thing, it would seem.

This would probably interest you. Essentially, it lets you call functions from the client to the server and receive an input on what has been done. I also just added Table support so you can send any type of information through it.

Although, I’ve been working on an gamemode like yours for some time now and the easiest way to send the information you need is through net.SendToServer()

Amazing. I just came back to glua and haven’t heard of such a library. Is it fairly new?

Yes, I’ll release it tonight if I can.


Well all of the problems in this thread are solved. The trace problem was incompatibility with sharpEye and your net library solved my other issues.