Page 1 of 1

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

Posted: Thu May 22, 2014 8:13 am
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?

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

Posted: Thu May 22, 2014 9:01 pm
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?

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

Posted: Thu May 22, 2014 10:06 pm
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.

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

Posted: Fri May 23, 2014 2:44 am
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.

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

Posted: Fri May 23, 2014 3:16 am
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?

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

Posted: Fri May 30, 2014 2:25 am
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.

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

Posted: Fri May 30, 2014 2:43 pm
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.

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

Posted: Fri May 30, 2014 6:07 pm
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.