[FTEQW]checkclient(); bulitin returns player only sometimes

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
jjsullivan5196
Posts: 21
Joined: Sun Apr 21, 2013 10:50 pm

[FTEQW]checkclient(); bulitin returns player only sometimes

Post by jjsullivan5196 »

Hey people, and Spike, if you're reading this, sorry for the annoying questions.

I'm running into problems withe the checkclient(); builtin on a particular map. It has to do with the enemy AI, in which checkclient returns world when it should return the player entity. Even when I stand in front of the enemy, right next to them, they do not attack. Specifically filtering for the player with a find(); loop does not help either, client in FindTarget still yields world, which means the enemies still stand still. This only happens in my custom map, which is just a simple enclosed skybox with one info_player_start and one monster_army. All other Id1 maps work as expected.

With the find loop not working, this leads me to believe that the player almost doesn't exist(Which it certainly does, when I fire at the monster, he attacks and has the player set as the enemy). The map itself is compiled with q3map2 and made in netradiant, although I'm not sure how that could affect anything. To note, the map does work as expected in darkplaces, and the monster attacks, same progs and all. Anyone know what to do?
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: [FTEQW]checkclient(); bulitin returns player only someti

Post by Cobalt »

All I can figure is maybe the spawned world has a bug compiled into it that somehow factors into the equasion. I think that builtin looks for the FL_CLIENT flag, but I am not sure. So maybe if you built a map, and assigned the .flags field to have that bitflag present, it would cause this problem?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: [FTEQW]checkclient(); bulitin returns player only someti

Post by Spike »

I think its a problem with q2/q3 bsps and pvs.

checkclient only checks client slots (FL_CLIENT makes no difference). the more players you have, the longer it'll take for monsters to notice. players need health and not notarget.

edit: the current build on triptohell should fix this issue, hopefully.
Last edited by Spike on Fri May 23, 2014 3:00 am, edited 1 time in total.
jjsullivan5196
Posts: 21
Joined: Sun Apr 21, 2013 10:50 pm

Re: [FTEQW]checkclient(); bulitin returns player only someti

Post by jjsullivan5196 »

Spike wrote:I think its a problem with q2/q3 bsps and pvs.
I'm guessing that's what it is, since darkplaces loads the map and PVS seems to be working as intended.

I'm not sure if there could be a glitch that's causing self.flags to include FL_NOTARGET, is there some way I could see if it's set? I know how to use the QC debugger to check entities, it's just that I'm not sure what to make of it from there as far as the .flags field.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: [FTEQW]checkclient(); bulitin returns player only someti

Post by Spike »

give self.flags
if the second nibble from the right is 8,c,d,e,f, then notarget is set. either way its unlikely to be that - tried the new build?
jjsullivan5196
Posts: 21
Joined: Sun Apr 21, 2013 10:50 pm

Re: [FTEQW]checkclient(); bulitin returns player only someti

Post by jjsullivan5196 »

Hey Spike, sorry I took a while to get back to this. I have revision 4669 working, PVS is functioning in q3 maps, but now the enemies are invisible. No idea why.
goldenboy
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel
Contact:

Re: [FTEQW]checkclient(); bulitin returns player only someti

Post by goldenboy »

jjsullivan5196 wrote:Hey Spike, sorry I took a while to get back to this. I have revision 4669 working, PVS is functioning in q3 maps, but now the enemies are invisible. No idea why.
iqm models invisible here too.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: [FTEQW]checkclient(); bulitin returns player only someti

Post by Spike »

invisible iqms *should* be fixed in revision 4675. here's hoping something else doesn't break. :s
thanks go to gb who pointed me to a map that actully had the problem. hurrah.
Post Reply