Hey, darkAI is working out great for me, and its very powerful but I'm having some issues.
Initially my game included only one model type (the enemies and allies both used the marine object). I now added a new class of enemy called ogres, and altered my animation function to account for the differing animation sets. THe thing is, my marines work fine, and the ogres are ok when they are patrolling, but as soon as the go into "aggressive mode" they stop animating, and only play the first frame of the specified loop object command.
here's the code:
function animations()
`this first bit identifies whether the entity is a marine or an ogre, and calls the `appropriate function
for i = 2 to lastenemy
if AI Entity Exist(i)=1
set object speed i,35
marineanimations(i)
endif
next i
for i = 14 to lastogre
if AI Entity Exist(i)=1
set object speed i,35
ogreanimations(i)
endif
next i
for i = 20 to lastally
if AI Entity Exist(i)=1
set object speed i,35
marineanimations(i)
endif
next i
endfunction
function marineanimations(i)
if AI Get Entity Is Ducking ( i )=1 then loop object i,142,145
if AI Get Entity Is Ducking ( i )=0
if AI Get Entity Is Moving ( i )=0 then set object frame i,75
if AI Get Entity Action$ (i)="stopped" then loop object i,74,75 : hide object i+1100
if AI Get Entity Action$ (i)="Moving Forwards" then loop object i,55,72 : hide object i+1100
if AI Get Entity Action$ (i)="Strafing Left" then loop object i,35,54 : hide object i+1100
if AI Get Entity Action$ (i)="Strafing Right" then loop object i,15,34 : hide object i+1100
if AI Get Entity Action$ (i)="Stopped And Attacking" then loop object i,74,75 : shooting(i)
if AI Get Entity Action$ (i)="Moving Forwards And Attacking" then loop object i,55,72 : shooting(i)
if AI Get Entity Action$ (i)="Moving Backwards And Attacking" then loop object i,55,72 : shooting(i)
if AI Get Entity Action$ (i)="Strafing Left And Attacking" then loop object i,55,72 : shooting(i)
if AI Get Entity Action$ (i)="Strafing Right And Attacking" then loop object i,55,72 : shooting(i)
endif
endfunction
function ogreanimations(i)
if AI Get Entity Is Ducking ( i )=1 then loop object i,472,473
if AI Get Entity Is Ducking ( i )=0
if AI Get Entity Is Moving ( i )=0 then set object frame i,472
if AI Get Entity Action$ (i)="stopped" then hide object i+1100 : loop object i,472,474
if AI Get Entity Action$ (i)="Moving Forwards" then loop object i,62,112 : hide object i+1100
if AI Get Entity Action$ (i)="Strafing Left" then loop object i,62,112 : hide object i+1100
if AI Get Entity Action$ (i)="Strafing Right" then loop object i,62,112 : hide object i+1100
[i]if AI Get Entity Action$ (i)="Stopped And Attacking" then loop object i,472,474 : shooting(i)
if AI Get Entity Action$ (i)="Moving Forwards And Attacking" then loop object i,388,412 : shooting(i)
if AI Get Entity Action$ (i)="Moving Backwards And Attacking" then loop object i,388,412 : shooting(i)
if AI Get Entity Action$ (i)="Strafing Left And Attacking" then loop object i,62,112 : shooting(i)
if AI Get Entity Action$ (i)="Strafing Right And Attacking" then loop object i,388,412 : shooting(i)
endif
endfun[/i]ction
the section in italics is the bit where the animation won't play. I've tested the ogre model in a simpler darkbasic app, and it loops all 500 frames fine, they're all there, which leads me to believe the problem is here (there are no other parts of the code that control their animation).
Any help would be greatly appreciated.
Peas
Butters