Forum

Bot problem after adding DP extension

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Bot problem after adding DP extension

Postby Cobalt » Sat Apr 23, 2011 1:25 am

Trying to use the darkplaces botclient built-in to resolve a scoreboard problem in my ctfbot+ mod. Was able to get them to spawn in the game via impulse by hacking up the old code a bit, but they seemed to be thinking incorrectly. I was told that since we are calling clientconnect() and putclientinserver() the bot entities will essentially be using playerprethink() and playerpostthink() and wont use the assigned think functions in the initial spawn...is that correct?

I tried pasting the think routines directly into those routines and using the clienttype floats to seperate bot from player, but after I did that, the bots wont even spawn into the map, and if I track them on the camera they are always at location ' 0 0 0 ' in the map....which is usually part of the solid bsp.
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Postby Spike » Sat Apr 23, 2011 4:22 am

you need to call clientconnect and putclientinserver yourself.
the builtin does not recurse back in to QC code.
however, bots WILL progate from one map to the next, in which case then the engine will call clientconnect/putclientinserver for you at the start of the *next* map.

botclients have no AI.

bots will move around like a player only if you set the .movement field on them, to the same values that would be readable from a player, otherwise they're effectively AFK.

you don't have to treat them identically to players if you're willing to make the various player functions ignore them. You could just spawn them as team scoreboard placeholders (assuming you clean them up on map changes). :)
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Cobalt » Sat Apr 23, 2011 10:56 pm

Thanks for the reply, I set the movetype to movetype_walk, did not help. I guess you are saying that when those 2 calls are made, we are using playerprethink() and playerpostthink() as the default think routines then? Its confusing, because my original hack got the bots thinking somewhat with their original botthink routine, but for sure there were some calls made as if it were a real live player, and I guess thats why it would stop thinking until attacked. So are we locked into the thinks being in those routines, or can work by re-assigning thinks outside those paramaters?
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest