Mirage Source http://miragesource.net/forums/ |
|
[Summer Competition] My AI! http://miragesource.net/forums/viewtopic.php?f=210&t=2305 |
Page 2 of 3 |
Author: | El_Dindonnier [ Wed Oct 21, 2009 4:45 pm ] |
Post subject: | Re: [Summer Competition] My AI! |
When I add all the code on a blank ms3.0.3. I have a runtime error 9 : Code: Runtime-error 9 While (PathLine(Start) <> -1 And Flag = 0) Help me please Thanks you in advance. |
Author: | Lea [ Wed Oct 21, 2009 5:51 pm ] |
Post subject: | Re: [Summer Competition] My AI! |
What value is start when it crashes? |
Author: | GIAKEN [ Wed Oct 21, 2009 7:50 pm ] |
Post subject: | Re: [Summer Competition] My AI! |
It's obvious start is either < lbound or > ubound. |
Author: | El_Dindonnier [ Wed Oct 21, 2009 8:53 pm ] |
Post subject: | Re: [Summer Competition] My AI! |
Lea wrote: What value is start when it crashes? Start = 192 What is the problem ? |
Author: | Lea [ Wed Oct 21, 2009 9:17 pm ] |
Post subject: | Re: [Summer Competition] My AI! |
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. |
Author: | El_Dindonnier [ Wed Oct 21, 2009 10:15 pm ] |
Post subject: | Re: [Summer Competition] My AI! |
Lea wrote: 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. but how to fix the bug please ? EDIT : My bug is fixed 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 |
Page 2 of 3 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |