[Summer Competition] My AI!

  • Lunar Engine v0.2.6 is out now! Download and check it out here. The map editor is also now fixed!

Lea

Member
Member
May 28, 2006
1,669
0
0
www.valkoria.com
Gold
0
#30
NV = (MAX_MAPX + 1) * (MAX_MAPY + 1) - 1

what are MAX_MAPX and MAX_MAPY?
I'd be willing to bet 11 million dollars they are 15 and 11.

which makes NV 191

Which makes UBOUND(Path) 191

using subscript start = 192 is out of range for array path which is has 191 elements.
 

El_Dindonnier

Member
Member
Nov 4, 2007
40
0
0
Gold
0
#31
Lea said:
NV = (MAX_MAPX + 1) * (MAX_MAPY + 1) - 1

what are MAX_MAPX and MAX_MAPY?
I'd be willing to bet 11 million dollars they are 15 and 11.

which makes NV 191

Which makes UBOUND(Path) 191

using subscript start = 192 is out of range for array path which is has 191 elements.
Yes my map is 15 and 11. :p

but how to fix the bug please ?


EDIT :
My bug is fixed :p
I have lost to add :
Code:
                                        o = MapNpc(y, x).y * (MAX_MAPX + 1) + MapNpc(y, x).x
                                        d = GetPlayerY(Target) * (MAX_MAPX + 1) + GetPlayerX(Target)
                                            For I = 0 To NV
                                            Marked(I) = 0
                                            PathLine(I) = -1
                                            Path(I) = -1
                                        Next I
                                    
                                                                            For I = 0 To NV
                                            VY = Int(I / (MAX_MAPX + 1))
                                            VX = I Mod (MAX_MAPX + 1)
                                           
                                            If VX >= 0 And VX < MAX_MAPX Then Mat(I, I + 1) = 1
                                            If VX > 0 And VX <= MAX_MAPX Then Mat(I, I - 1) = 1
                                            If VY >= 0 And VY < MAX_MAPY Then Mat(I, I + MAX_MAPX + 1) = 1
                                            If VY > 0 And VY <= MAX_MAPY Then Mat(I, I - MAX_MAPX - 1) = 1
                                        Next I
Now it's work :D