My Renderman AI code keeps messing up and thinking that the area 2 TUs in front of it is actually in mid-air; this causes constant death from above.
Here's all the relevant code:
function AIPlayer::getPosInFrontOfRenderman(%this,%dist)
{
return vectorAdd(%this.getEyePoint(),vectorScale(%this.getEyeVector(),%dist));
//TRIES to get the area in front of the bot at normal ground level through the eyevector
}
%mf = %this.getPosInFrontOfRenderman(2); // the bot support in BL is terrible, so we'll slowly tp the bot towards the player instead, effectively allowing him to walk through some walls
%this.setTransform(%mf);
if(getRandom(1,46) == 5) { // teleport?
%pPos = %this.RendermanTarget.getPosition();
%tPos = vectorAdd(%pPos, getRandom(-40,40) SPC getRandom(-40,40) SPC 0 ); // this also allows the renderman to jump RIGHT in front of the player - caution
%this.setTransform(%tPos);
I'm trying to get the bot to just jump forwards a set number of TUs, without sinking through the ground, flying or walking normally. Can anyone help?
Edit: Nevermind, got it working with a vectorSub