well here's one problem I can't solve since I barely know any math...
and here's the reason....
This image shows the 2 tracelines sent to try and search for the breakable..
as you can see.. they are going the wrong direction..
here's the code..
Code:
bool BotFindBreakable (bot_t *pBot)
{
// Checks if Bot is blocked by a Shootable Breakable in his moving direction
TraceResult tr;
edict_t *pEdict = pBot->pEdict;
Vector v_src = pEdict->v.origin;
Vector vecDirection = (pBot->pShootBreakable->v.origin - v_src).Normalize ();
Vector v_dest = v_src + vecDirection * 50;
TRACE_LINE (v_src, v_dest, dont_ignore_monsters, pEdict, &tr);
if ((tr.flFraction != 1.0)
&& (FStrEq ("func_breakable", STRING (tr.pHit->v.classname))
|| FStrEq ("func_pushable", STRING (tr.pHit->v.classname)))
&& IsShootableBreakable (tr.pHit))
{
pBot->vecBreakable = tr.vecEndPos;
return (TRUE);
}
v_src = GetGunPosition (pEdict);
vecDirection = (pBot->pShootBreakable->v.origin - v_src).Normalize ();
v_dest = v_src + vecDirection * 50;
TRACE_LINE (v_src, v_dest, dont_ignore_monsters, pEdict, &tr);
if ((tr.flFraction != 1.0)
&& (FStrEq ("func_breakable", STRING (tr.pHit->v.classname))
|| FStrEq ("func_pushable", STRING (tr.pHit->v.classname)))
&& IsShootableBreakable (tr.pHit))
{
pBot->vecBreakable = tr.vecEndPos;
return (TRUE);
}
pBot->pShootBreakable = NULL;
pBot->vecBreakable = g_vecZero;
return (FALSE);
}
All we need is a math wiz that knows how to figure out what direction a point is from another point...
anyone know how?
[edit]
Me are reading pages that teach this stuff
[/edit]