Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Enemy AI Help @ Models

This topic is 5200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, i dont know so mutch about AI and i need some help with this problem take a look. //Player posX PlayerX = (cast.pc->ai.basic.posX)+1.0f; //Player posZ PlayerZ = (cast.pc->ai.basic.posZ); for ( int loop=0; loop < cast.numenemys; loop++ ) { //Enemy posX PosX = cast.enemy[loop].ai.basic.posX; //Enemy posZ PosZ = cast.enemy[loop].ai.basic.posZ; if ( CollisionModels(PosX, PosZ, cast.enemy[loop].ai.vision->rangeSqr )) { cast.enemy[loop].animationChange=true; cast.enemy[loop].animation=RUN; //Run cast.enemy[loop].ai.basic.MoveNew(PlayerX, PlayerZ); } else if ( CollisionModels(PosX, PosZ, cast.enemy[loop].ai.fighter->attackRange )) { cast.enemy[loop].animationChange=true; cast.enemy[loop].animation=SHOT_STAND; //Attack } } all this is looped so the enemy attack the player all the time they are in the range. But the problem is that the animationChange and animation set is looped also so the model change to the first frame all the time. how can i do so the change and set only change 1 time? äh, im dizzy now but i hope you know what i meen ^^

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!