Custom scenario AI turn exception

Post bug reports and ask for tech support here. Post any Community Site Requests here as well.

Moderator: Vic

Post Reply
User avatar
Arkady
Posts: 1261
Joined: Fri May 31, 2002 1:37 pm
Location: 27th Penal Battalion
Contact:

Custom scenario AI turn exception

Post by Arkady »

I start testing my custom scenario, during first AI turn all initial phases progress well, when AI steps count begin I got "Index was outside the bounds of the array" exception

see text:

ee the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at WindowsApplication1.HandyFunctionsclass.MoveApCostPreview2(Int32 byregnr, Int32 movetype, Int32 theater, Int32 x1, Int32 y1, Int32 x2, Int32 y2, Boolean dontenterenemy, Boolean AllowShoreDrop, Boolean NoAPPenalties, Boolean SeaBlock, Boolean BlockAllSea, Boolean istransfer, Boolean EngineerTest, Boolean EnemyPenalty, Boolean IsForSupplyLayer, Int32 redux)
at WindowsApplication1.HandyFunctionsclass.MakeMovePrediction2(Int32 byregnr, Int32 movetype, Int32 theater, Int32 ap, Int32 x, Int32 y, Boolean checkairfield, Boolean dontenterenemy, Boolean allowshoredrop, Boolean muststartonairfield, Boolean NoAPPenalties, Boolean SeaBlock, Boolean BlockAllSea, Boolean istransfer, Boolean EngineerTest, Boolean EnemyPenalty, Boolean IsForSupplyLayer, Int32 redux)
at WindowsApplication1.AIClass.InitLandReserves()
at WindowsApplication1.AIClass.InitAI()
at WindowsApplication1.GameLoopMainWindowClass.handleTimer()
at WindowsApplication1.ScreenClass.HandleTimer()
at WindowsApplication1.Form1.Timer1_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


any idea what can be wrong ?

thanks for help
Image
User avatar
Vic
Posts: 9967
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Custom scenario AI turn exception

Post by Vic »

I was expecting some of these errors to turn up when more people started making their own rules and sftypes.
 
please mail the scenario to vic@xs4all.nl and i'll get back to you on whats wrong.
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
User avatar
Arkady
Posts: 1261
Joined: Fri May 31, 2002 1:37 pm
Location: 27th Penal Battalion
Contact:

RE: Custom scenario AI turn exception

Post by Arkady »

I probably solved the problem, it was error in rulevar about bridge/road building, I set it to -1 (no construction of bridge/roads), now I reenable bridge construciton and it is working [:)]
Image
User avatar
Vic
Posts: 9967
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Custom scenario AI turn exception

Post by Vic »

yes but still thanks for mailing the file. It helps me make the code more robust for dealing with mistakes in custom scenarios in future versions.
 
you can set rulevar(32)=-1 , but then you also have to set the AI to not using engineers.
 
thanks for reporting!
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
Post Reply

Return to “Advanced Tactics Support”