Page 6 of 8 FirstFirst 12345678 LastLast
Results 101 to 120 of 160

Thread: Unit Editor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    It should work - this sounds like some unusual formatting issue with your files.










  2. #2

    Default Re: Unit Editor

    Hey this editor looks great but I can't get it to work. I did a fresh install of mtw and tatw and I keep getting an error. Possibly a unit attribute but it never adds it to the error log so I can see what the problem is. Also if I just let it sit I get this error.


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


    ************** Exception Text **************
    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at strcpy(SByte* , SByte* )
    at llstrcmp(SByte* str1, SByte* str2)
    at ParseSkeletons(BM* model, Int32 mC, DS* skeleton, Int32 sC)
    at LoadFiles(SByte* datapath)
    at UnitEditor.LoadForm.LoadData(Object sender, DoWorkEventArgs e)
    at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
    at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)




    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    UnitEditor
    Assembly Version: 1.1.4795.41823
    Win32 Version:
    CodeBase: file:///C:/Users/Shadow%20Spion/Desktop/UnitEditor.exe
    ----------------------------------------
    msvcm90
    Assembly Version: 9.0.30729.4940
    Win32 Version: 9.00.30729.4940
    CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_50916076bcb9a742/msvcm90.dll
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5491 (Win7SP1GDR.050727-5400)
    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.5485 (Win7SP1GDR.050727-5400)
    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.5492 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.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.





  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    Have you tried running it as admin? Right click the application, choose 'properties' and then in the 'Compatibilty' tab tick mark 'run as administrator'. Click 'apply' and 'ok' then run the app.










  4. #4

    Default Re: Unit Editor

    Quote Originally Posted by Gigantus View Post
    Have you tried running it as admin? Right click the application, choose 'properties' and then in the 'Compatibilty' tab tick mark 'run as administrator'. Click 'apply' and 'ok' then run the app.
    I just tried it, no good it gives me the same error.

  5. #5

    Default Re: Unit Editor

    In the error it mentions Microsoft .NET Framework and that "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
    Any ideas?

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    I am afraid, not. Not really a programmer.

    Did you try it on the default files or another mod? If it works then it would establish that it actually is the TATW files and not the set up of the app.










  7. #7

    Default Re: Unit Editor

    So, I am trying to get it to read the unpacked main data folder for the game, but it tells me it is unable to find an edu. Though there is one there, the same thing happens when I try to run the vanilla folder that came with the download.

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    You might be pointing to the wrong directory when loading the set up:

    In the app choose 'file\load' and click 'new'
    browse to your mod's folder and select\highlight it - eg M2TW\mods\mymod, click 'OK'
    now select your mod folder's name in the list and click 'load'

    For the unpacked main game select the M2TW folder (containing the executables)










  9. #9
    UndyingNephalim's Avatar Primicerius
    Patrician Artifex

    Join Date
    Jan 2011
    Posts
    3,967

    Default Re: Unit Editor

    I can't even seem to get this tool to run. It reads descr_cultures fine, then freezes on descr_sm_factions. Heres the error:
    Spoiler Alert, click show to read: 
    Code:
    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.
    
    
    ************** Exception Text **************
    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
       at fgets(SByte* , Int32 , _iobuf* )
       at ParseDSMF(DSMF* faction, SByte* fpath)
       at LoadFiles(SByte* datapath)
       at UnitEditor.LoadForm.LoadData(Object sender, DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
    
    
    
    
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    UnitEditor
        Assembly Version: 1.1.4795.41823
        Win32 Version: 
        CodeBase: file:///C:/Users/Zoral/Downloads/UnitEditor11/UnitEditor.exe
    ----------------------------------------
    msvcm90
        Assembly Version: 9.0.30729.6161
        Win32 Version: 9.00.30729.6161
        CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57/msvcm90.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5491 (Win7SP1GDR.050727-5400)
        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.8686 (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.5495 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.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.


    Maybe my formatting in the file is weird so I'll upload it.descr_sm_factions.txt

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    Don't see anything wrong in the file. Have you tried removing it to see if it is indeed the problem? Theoretically the tool should start without it.










  11. #11
    UndyingNephalim's Avatar Primicerius
    Patrician Artifex

    Join Date
    Jan 2011
    Posts
    3,967

    Default Re: Unit Editor

    Quote Originally Posted by Gigantus View Post
    Don't see anything wrong in the file. Have you tried removing it to see if it is indeed the problem? Theoretically the tool should start without it.
    After messing around a bit the problem is definitely my battle_models.modeldb file. I removed all entries except for mount_pony and the unit editor opened up just fine. I guess the formatting of all my units is just that messed up, so I decided to add them all back in using the Unit Editor 1 by 1.

    However another problem seems to be happening. I add in new units fine, but when I export the mdb.txt file and copy it into my modeldb file, the Unit Editor wont open again. Looking at mdb.txt and examining it... it's exporting really strange things. There's a "5 blank 0 0 0 0 0 0 0" model entry at the top and the counts are not matching the the total models.

  12. #12
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    Best to run your original modelDB through the checker. I have a tutorial page here that explains how to edit the checker to include custom factions. It also includes tools by Hex35, discussion about his tools start here.
    Running the checker this way helps greatly in chasing down undocumented errors.










  13. #13
    UndyingNephalim's Avatar Primicerius
    Patrician Artifex

    Join Date
    Jan 2011
    Posts
    3,967

    Default Re: Unit Editor

    Quote Originally Posted by Gigantus View Post
    Best to run your original modelDB through the checker. I have a tutorial page here that explains how to edit the checker to include custom factions. It also includes tools by Hex35, discussion about his tools start here.
    Running the checker this way helps greatly in chasing down undocumented errors.
    Well I'm an idiot. I needed to do run EOL conversion >Windows Format in notepad ++. Even though everything looked fine I didn't have CR-LF's at the end of each line like I should have. I guess the Unit Editor is more sensitive to that formatting then Medieval 2 itself is. My original modeldb file opens just fine now!

  14. #14
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    The latest version of Notepad++ always lists the format at the bottom right: Windows (CR LF). ANSI is the default for TXT files, UCS-2 LE BOM is reserved for the data\text TXT files. Before that I always had to check the EOL setting via the menu (Edit\EOL Conversion).










  15. #15
    UndyingNephalim's Avatar Primicerius
    Patrician Artifex

    Join Date
    Jan 2011
    Posts
    3,967

    Default Re: Unit Editor

    A small problem I've noticed with the editor, most of the time when I click on the faction list nothing seems to happen and the list of factions will not pop up. Occasionally it works and I can select factions for my models, but I would say 9 times out of 10 it just remains blank. It seems to fail to work more often on models that I've already finished and want to add a new faction entry for. Is this normal or have I perhaps done something to cause this problem?

  16. #16
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    I checked with the Bare Geomod files (You seem to have used the tool with your mod) and had no problem. I did however notice that you have to select a unit in the Units window before the faction drop down works in the Models window.










  17. #17
    UndyingNephalim's Avatar Primicerius
    Patrician Artifex

    Join Date
    Jan 2011
    Posts
    3,967

    Default Re: Unit Editor

    Quote Originally Posted by Gigantus View Post
    I checked with the Bare Geomod files (You seem to have used the tool with your mod) and had no problem. I did however notice that you have to select a unit in the Units window before the faction drop down works in the Models window.
    That seems to work, another problem I've run into though...

    Is there a limit to how many mounts the Unit Editor can load? If I go over 50 mounts in my descr_mount file, the Unit Editor will not start up. The hardcoded limit for mounts in Medieval 2 is 100, so I'm not sure what might be going on here.
    Last edited by UndyingNephalim; May 03, 2017 at 09:39 PM.

  18. #18
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    Yup, I ran into that limit when I tried to use the editor on Rage of dark Gods.










  19. #19
    UndyingNephalim's Avatar Primicerius
    Patrician Artifex

    Join Date
    Jan 2011
    Posts
    3,967

    Default Re: Unit Editor

    Quote Originally Posted by Gigantus View Post
    Yup, I ran into that limit when I tried to use the editor on Rage of dark Gods.
    Unfortunate. I suppose I won't be using this tool with my mod then.

    Thank you for all the help regardless, it's a handy tool if you don't have lots of mounts.

  20. #20
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: Unit Editor

    Indeed it is - it helped a lot with 1648 and Rise of three Kingdoms.

    And you're welcome










Page 6 of 8 FirstFirst 12345678 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •