Using Models

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

Moderator: Vic

Post Reply
User avatar
Ormand
Posts: 752
Joined: Tue Feb 17, 2009 1:31 am

Using Models

Post by Ormand »

I was wondering if anyone has experience with using models, and can help me figure out what I have missed. I am trying to put tank models into my divisions and regiments mod. TOE was easy, and works great. But, models is not trivial and a different kettle of fish. Especially since there are several more SFT types, thus a simple merge into the newdawn file won't work (I also got a crash just trying this).

I started with TOE working and started with just the light tank model. I imported the stringlists and model event (in this case they have the same locations as in newdawn). I then set rulevars 344, 531, 532, and 539 = 1. Then added the eight research levels for Tank combat, Tank Anti-Infantry, and Tank Mobility. I then added the Light Tank SFT base model, reproducing the stats in the Models 1 and Models 2 slots as in the newdawn file. I also caught the CheckOriginalModel in the new model or upgrade event to check the actual Light Tank SFT number.

When I try to create a new model, I get a crash with an array out of bounds with the following message:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
at WindowsApplication1.DataClass.AddSFType()
at WindowsApplication1.ProcessingClass.MakeNewSFTypeModel(Int32 sftypenr)
at WindowsApplication1.SFDesignWindowClass.HandleMouseClick(Int32 x, Int32 y, Int32 b)
at WindowsApplication1.PlayScreenClass.HandleMouseClick(Int32 x, Int32 y, Int32 b)
at WindowsApplication1.Form1.Form1_Mousedown(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8662 (QFE.050727-8600)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
WindowsApplication1
Assembly Version: 1.0.5672.31795
Win32 Version: 1.0.5672.31795
CodeBase: file:///C:/Matrix%20Games/Advanced%20Tactics%20Gold/AdvancedTacticsGold.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8662 (QFE.050727-8600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8662 (QFE.050727-8600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8662 (QFE.050727-8600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.8662 (QFE.050727-8600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
ICSharpCode.SharpZipLib
Assembly Version: 0.84.0.0
Win32 Version: 0.84.0.0
CodeBase: file:///C:/Matrix%20Games/Advanced%20Tactics%20Gold/ICSharpCode.SharpZipLib.DLL
----------------------------------------
irrKlang.NET
Assembly Version: 1.3.0.0
Win32 Version: 1, 1, 0, 0
CodeBase: file:///C:/Matrix%20Games/Advanced%20Tactics%20Gold/irrKlang.NET.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


I am guessing that I am missing a step. Any ideas? I have only gotten to the point of trying to create a new model, not upgrading it, obviously.

In addition, I assume that the button executes the AddSFType and passes TEMPVAR9 (current model or SFT), TEMPVAR1 (attach type), and TEMPVAR7 (level) into the event. A few other things: 1) the Models 1 and Models 2 stats for non base models are meaningless (some are set in newdawn, but make no sense); 2) the costs for the Tank Combat, Tank Anti-Infantry, and Tank Mobility are also not used. In the newdawn file, they are inconsistent for each people type. Namely they cost more for Germans.
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
User avatar
Ormand
Posts: 752
Joined: Tue Feb 17, 2009 1:31 am

RE: Using Models

Post by Ormand »

I take it that there is no step-by-step guide to adding the tank models (or others for that matter)?
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
User avatar
ernieschwitz
Posts: 4240
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Using Models

Post by ernieschwitz »

I think I saw a step by step guide... let me see if i can find it (or the best guide available)...

EDIT: This is what i could find:

http://www.vrdesigns.nl/atwiki/doku.php ... ype_models
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
Ormand
Posts: 752
Joined: Tue Feb 17, 2009 1:31 am

RE: Using Models

Post by Ormand »

Thanks. I did remember seeing that but had trouble finding it. Good job tracking it down. It is at least a start for me. But, it looks tricky.
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
Post Reply

Return to “Advanced Tactics Support”