Posted: 16th Jun 2007 19:25
Edited at: 16th Jun 2007 19:27
I have an enemy AI walking a Path.<Dark AI>
I have several crates((cubes)dynamic)).<Dark Physics>
The crates can be shot at and knocked around.Now they are in the AI path.How can I get the AI to avoid them? Static Obstacle(AI) will not work? ,because they will always fall in different positions.
This is the basic code I am working with
for i = 21 to 31
load object "crate.x",i
scale object i,6,6,6
position object i, -10, y#, 0
y# = y# + 2
phy make rigid body dynamic box i
next i
load object "H-GI-Move.x",33
yrotate object 33, 180
scale object 33, 500,500,500
set object speed 33, 50
loop object 33,5,25
fix object pivot 33
position object 33,0,1,0
AI Add Enemy 33
for I =21 to 31
AI Add static Obstacle i
Next i
AI Complete Obstacles
AI Make Path 2
AI Entity Assign Patrol Path 33,2
AI Path Add Point 2, -25, 0
AI Path Add Point 2,-40,40
AI Set Radius 5