Game Development Community

AIPlayer lies down on the job, can any one please help?

by Svengali · in Torque 3D Professional · 05/24/2011 (6:40 pm) · 5 replies

Alright, after working on this for about 24 hrs I must be missing something. Im running T3d beta3 with AFX any time control is passed to any object other than the player, the player then lies down prone. Ive pulled it all apart and I cant figure out why. It began happening when I upgraded to beta3, does anyone know why this is or how to fix it? Thanks in advance.

About the author

Creator of SvengaliGames, and developing the once up coming title NightLife: The MMORPG Of Dark Horror. Now named ATROX NOCTIS: Daemons Cradle- www.svengaligames.com


#1
05/24/2011 (9:44 pm)
it has a prone animation?
if so, remove the animation.
if that helps (it is/was an issue before), then I suggest you report it as a known bug.
#2
05/24/2011 (10:11 pm)
Yeah, that works thanks! I posted it as a beta 3 bug. I guess there will be no crawling on the ground for now, lol.
#3
05/25/2011 (2:08 am)
There is an issue with AIPlayers with a prone animation. For some reason they will go in prone position immediately after spawning, because the trigger[4] of the AIPlayer was set to 1 and hereby setting the prone position. I wasn't able to find the cause of this however.

Because removing the prone animation was not an option for me I have made a change to AIPlayer::getAIMove function in AIPlayer.cpp

Somewhere around line 355 in the AIPlayer::getAIMove(..) function in AIPlayer.cpp you have to add a line of code (T3D 1.1 Preview).

// Replicate the trigger state into the move so that
   // triggers can be controlled from scripts.
   for( int i = 0; i < MaxTriggerKeys; i++ )
      movePtr->trigger[i] = getImageTriggerState(i);
   movePtr->trigger[4] = false; // Add this line to prevent prone

   mLastLocation = location;


#4
05/25/2011 (6:03 am)
Actually I thought 1.1beta3 fixed this issue ...

Anyhow, if you're going to have Ai that use poses, you'll need to add the code for it.
#5
05/25/2011 (6:04 am)
Ah, an even better solution, after tracing around all the setControlObject code, I did not look there. I'll give that a shot, thanks again!

Also if it was fixed in beta 3, maybe it slipped through the cracks in the AFX port, but that seems odd. Jeff is very thorough.