Hi. Are there any forums dedicated to engine development, DarkPlaces specifically? I'm working on learning the DP code to try out some ideas I have.
Right now I'm stuck on filtering model names of entities to find out exactly who is a player, and whether that player is on my team- where can I find what model name characterizes a player, and how would I filter for this in C?
Having found these entities, it would then be possible to do a traceline check to see if they are behind any objects?
traceline(cl.entities[cl.playerentity].state_current.origin, e.origin, FALSE, world);
if (trace_ent == target); // this ought to do it?
VectorSubtract(cl.entities[cl.playerentity].state_current, e->state_current.origin, vekt);
sqrt(DotProduct(vekt, vekt)); //this should give me the distances between the two entities?
Now how would I find and pick the shortest distance, and make this all into a useable code (how would I write it out) for finding the nearest entity that is a player? Register a new variable, define it in a config or/and default parameters? Sorry I'm very new to coding, and a bit lost. (Seems like the documentation on DarkPlaces is quite scarce!)
Thanks for any help :)