[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - DarkPlaces Engine Dev?

DarkPlaces Engine Dev?

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

DarkPlaces Engine Dev?

Postby marie » Sat Apr 12, 2008 1:22 am

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 :)
marie
 
Posts: 4
Joined: Fri Apr 11, 2008 2:01 am

Postby Baker » Sat Apr 12, 2008 3:58 am

User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Lardarse » Sat Apr 12, 2008 6:38 am

There isn't really a forum as such, but if LordHavoc notices this (and I think that there's a good chacne that he might), then he will be able to respond. The main place to discuss DarkPlaces development is

Regarding your question, is it not easier to find players by looking for entity.classname == "player" ?

As for finding the nearest teammate... if all you're doing is comparing distances, then the square root is unnecessary. There was a thread around here a while ago that discussed nearest entities. I'll edit it into this post if I find it.
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Re: DarkPlaces Engine Dev?

Postby LordHavoc » Sat Apr 12, 2008 7:44 am

LordHavoc
 
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA

Postby LordHavoc » Sat Apr 12, 2008 7:45 am

LordHavoc
 
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA

Postby marie » Sun Apr 13, 2008 8:56 pm

I often babysit three little boys (ages 11, 9, and 6) who are absolutely terrible at aiming, so I was hoping to make a handicap much like in Goldeneye 007 that helps with finding targets. They tend to aim at the sky, or their feet unwittingly, though they do love the idea of firstpersonshooters and blowing stuff up. They have an N64 and a Gamecube at their dad's, but I sit for their mom who has nothing but laptops. I owe much of my video game interest/prowess to playing with them :)

Ideally, I'd be able to set their aim somewhere in the general vicinity of opponent bots. (This handicapping is for our LAN parties and not for use on public servers of any sort).

I have tried a few other things such as limiting the bounds of the vertical pitch, but this doesn't seem to help much, they really have a hard time finding opponents and proper targets.

I was doing the same thing Lardarse was, mistakenly mixing QuakeC and C.

Again, any help would be greatly appreciated!
marie
 
Posts: 4
Joined: Fri Apr 11, 2008 2:01 am

Postby LordHavoc » Sun Apr 13, 2008 9:12 pm

LordHavoc
 
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA

Postby marie » Sun Apr 13, 2008 9:35 pm

marie
 
Posts: 4
Joined: Fri Apr 11, 2008 2:01 am

Postby LordHavoc » Sun Apr 13, 2008 10:11 pm

LordHavoc
 
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA

Postby marie » Mon Apr 14, 2008 10:24 am

I'm still having trouble filtering for player entities.
I initially considered doing find(world, classname, "player"), which won't work, and I suppose fl_client won't help either.
Would a mere IF statement work here? if( ... ) What exactly would this be incorporating cl.scores?

Edit: I confused myself.

Also, what are the necessary parameters and output for CL_Move(); ?

I think I know where to go as soon as I've found & selected the nearest player entity. I'd use AnglesFromVectors with the entity's vector and set the cl.viewangles[PITCH] & cl.viewangles[YAW] with that?

Thanks again! :)
marie
 
Posts: 4
Joined: Fri Apr 11, 2008 2:01 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 2 guests