Page 3 of 4 FirstFirst 1234 LastLast
Results 41 to 60 of 67

Thread: Naval models editing

  1. #41
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Naval models editing

    Quote Originally Posted by wangrin View Post
    First, I've ran console as user, but after getting this error, I run it as administrator.
    But I still have the same issue.

    jruby -v result :
    Code:
    D:\TAW_models_naval_converter>jruby -v
    jruby 1.7.19 (1.9.3p551) 2015-01-29 20786bd on Java HotSpot(TM) 64-Bit Server VM 1.8.0_45-b14 +jit [Windows 7-amd64]
    The jruby version looks fine. I'm really bad at figuring out Windows permissions problems. I just run W7 box with full admin rights and all UAC stuff turned off so I never get any such problems. (and 90% of the timey I use OSX laptop for software and W7 box just for gaming)

    Anyway, some bad news. Naval model autodecoder went so smoothly that I decided to get UI files (Version0XX) and try to run similar autodecoder on them. I can now convincingly say that this approach leads absolutely nowhere. :-/

    It's possible that much smarter autodecoder would be able to figure out UI files (the one I used for naval models was much smarter than one I wrote for other DB tables), but complexity gap between UI files and everything else is huge. Even information from ETW/NTW (for which we have UI decoder) doesn't agree all that well with what little autodecoder managed to guess.

    I wish they'd just release UI files support in mod kit.

  2. #42
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: Naval models editing

    I wish they'd just release UI files support in mod kit.
    Yeah, they have "forgotten" a lot sadly :/

    Oh, I was also experimenting with the models_building (since here you also have cannons on the coastal forts) but it seems your current converter can only convert "version 1" ?

    Could you take a quick look? I uploaded the actual models_table and the example xml

    https://www.dropbox.com/s/0szzosqouj..._building?dl=0
    https://www.dropbox.com/s/617kepvswt..._tech.xml?dl=0

  3. #43
    wangrin's Avatar Unguibus et Rostro
    Patrician Artifex

    Join Date
    Feb 2005
    Location
    France
    Posts
    4,397

    Default Re: Naval models editing

    I though artillery information for buildings was in cs2.parsed files.


    « Le courage, c’est de ne pas subir la loi du mensonge triomphant qui passe, et de ne pas faire écho de notre âme, de notre bouche et de nos mains aux applaudissements imbéciles et aux huées fanatiques.. » Jean JAURES

  4. #44
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Naval models editing

    Quote Originally Posted by Primergy View Post
    Yeah, they have "forgotten" a lot sadly :/

    Oh, I was also experimenting with the models_building (since here you also have cannons on the coastal forts) but it seems your current converter can only convert "version 1" ?

    Could you take a quick look? I uploaded the actual models_table and the example xml

    https://www.dropbox.com/s/0szzosqouj..._building?dl=0
    https://www.dropbox.com/s/617kepvswt..._tech.xml?dl=0
    Sure, once I get my laptop back from repairs
    It shouldn't be too hard unless they changed drastically since Empire.

  5. #45

    Icon5 Re: Naval models editing

    This is a modding breakthrough I want to try, but so far I haven't been successful at using the tool.

    I always get this if I put the models_naval in a folder
    Code:
    D:\taw models_naval converter\models_naval>jruby models_naval_unpack models_naval_db models_naval_dir
    io/console not supported; tty will not be manipulated
    Errno::EACCES: Permission denied - D:/taw models_naval converter/models_naval/models_naval_db
      initialize at org/jruby/RubyFile.java:362
            open at org/jruby/RubyIO.java:1177
            open at org/jruby/RubyKernel.java:349
      initialize at models_naval_unpack:35
          (root) at models_naval_unpack:477
    Like wangrin in the previous page.
    And this, if not inside a folder of its own:
    Code:
    D:\taw models_naval converter\models_naval>jruby models_naval_unpack models_naval models_naval_dir
    io/console not supported; tty will not be manipulated
    NoMethodError: undefined method `b' for "\xFD\xFE\xFC\xFF":String
      parse_db_header! at models_naval_unpack:93
                parse! at models_naval_unpack:282
                  run! at models_naval_unpack:309
                (root) at models_naval_unpack:479
    Also, this is the results of the jruby checks:
    Code:
    jruby -v
    jruby 1.7.19 (1.9.3p551) 2015-01-29 20786bd on Java HotSpot(TM) Client VM 1.8.0_
    45-b15 +jit [Windows 7-x86]
    
    jruby -e 'puts RUBY_VERSION'
    io/console not supported; tty will not be manipulated
    1.9.3
    
    jruby --2.0 -e 'puts RUBY_VERSION'
    io/console not supported; tty will not be manipulated
    2.0.0
    I use Windows 7 Home Basic 32-bit (6.1, Build 7600)

    Thank you in advance

  6. #46
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Naval models editing

    Same advice, uninstall all previous versions of JRuby (double check no leftover files somehow), grab and install latest version (JRuby 9.0.0.0.pre2), restart computer just in case, run terminal as administrator.

    Something on this list should work :-)


    "Permission denied" usually is Windows UAC problem solvable by running as admin. Or that you're passing in directory when it's expecting a file (script expects path to actual db file, not its folder).

    "undefined method b" means you're not running in Ruby 2.0+ mode.

    This is default mode for most recent JRuby, if you use older one you can try <pre>jruby --2.0 models_naval_unpack models_naval models_naval_dir</pre>.

  7. #47
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Naval models editing

    I changed the script so it now has much better error messages. If you had troubles with the script before, now it should tell you what the problem is.

  8. #48
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Naval models editing

    Models buildings script now support both version 1 (Empire, Napoleon, Shogun 2) as well as version 4 (Rome 2).
    Format of generated text files tweaked a bit to fit that data better, so if you had a script that used it, you might need to tweak it.
    (it should probably be JSON or XML or something like that, I guess, if it bothers anyone I can update it)

    Enjoy.
    Last edited by taw; May 14, 2015 at 08:09 AM. Reason: typo

  9. #49
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: Naval models editing

    Yep, script works, converts the new model dbs nicely

    Regarding cannon placement for coastal batteries i can say, that it seems to be quite easy. Just four ef-lines (or more, depending on size of the battery). What I don't understand is, why they don't align with the "arrow slits", but this could be understood with some tests.


  10. #50

    Default Re: Naval models editing

    I have installed the latest Jruby, so the db->xml works perfectly without a hitch.
    Now, how to pack xml to db again? Is it packs a directory, or not?

    If I pack the directory where the xml were unpacked, this is what I get:
    Code:
    C:/jruby-9.0.0.0.pre2/lib/ruby/stdlib/rexml/parsers/baseparser.rb:201: warning:
    Comparable#== will no more rescue exceptions of #<=> in the next release.
    C:/jruby-9.0.0.0.pre2/lib/ruby/stdlib/rexml/parsers/baseparser.rb:201: warning:
    Return nil in #<=> if the comparison is inappropriate or avoid such comparison.
    Repeatedly, ad nauseam. So, what did I do wrongly, and how to do it properly?

  11. #51
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Naval models editing

    What's the context here? Is it working and you just get this annoying warning a lot, or is it not working?

  12. #52
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: Naval models editing

    I get this warning too, but it seems like it converts the table correctly back though

  13. #53
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Naval models editing

    If it works, I'll just leave it for now, too much other stuff to do :-)

  14. #54

    Default Re: Naval models editing

    Quote Originally Posted by taw View Post
    What's the context here? Is it working and you just get this annoying warning a lot, or is it not working?
    Yeah, its not working for some reason.
    I'm not on my PC right now, so I can't post the result, sorry; but what I remember is after the warnings it goes " ...undefined method [] for..."

    When I get home I'll copy and post the result, but I'll leave this for now, perhaps its enough of a clue.

  15. #55

    Default Re: Naval models editing

    Pardon for the doublepost, for the reason of a new member I haven't got the permission to edit post.
    So, I tried to pack the unpacked xml,

    jruby models_naval_pack models_naval_dir models_naval_db

    resulted in the end:

    Code:
    C:/jruby-9.0.0.0.pre2/lib/ruby/stdlib/rexml/parsers/baseparser.rb:201: warning:
    Comparable#== will no more rescue exceptions of #<=> in the next release.
    C:/jruby-9.0.0.0.pre2/lib/ruby/stdlib/rexml/parsers/baseparser.rb:201: warning:
    Return nil in #<=> if the comparison is inappropriate or avoid such comparison.
    NoMethodError: undefined method `[]' for #<ModelsNavalXmlDir:0x3708b3>
      put_db_header at models_naval_pack:42
             put_db at models_naval_pack:136
              <top> at models_naval_pack:182
    No packed dbtable or directory produced.

    This time, I tried to pack a freshly-unpacked xml in the models_naval_dir directory. Just like I've mentioned, the unpack is working perfectly.

  16. #56
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: Naval models editing

    Have you edit something? Can you unpack/repack one of the single ship tables (like bob_chiydogagyxyz)?

    The regular models_naval table with dozens of ships is quite large and takes a lot of time to be packed again

  17. #57

    Default Re: Naval models editing

    Quote Originally Posted by Primergy View Post
    Have you edit something?
    No, This is straight from the unpacked model.

    Quote Originally Posted by Primergy View Post
    Can you unpack/repack one of the single ship tables (like bob_chiydogagyxyz)?
    I can unpack the bob ship tables. But packing still results in error.
    Apparently bob_ship_models naval lacks camera. this is evident in their filesize. for example, bob_kanko_maru us only 273KB, compared to the ship_kanko_maru unpacked from models_naval's 275KB size.
    Code:
    NoMethodError: undefined method `put_navalcams' for #<ModelsNavalDbTable:0x1ca90
    1e>
       put_model_s2tw at models_naval_pack:104
      block in put_db at models_naval_pack:139
                 each at org/jruby/RubyArray.java:1571
               put_db at models_naval_pack:138
                <top> at models_naval_pack:182
    Interestingly, this is also what happens if I try to pack NTW ship xml as provided in this thread (not having NTW)

    Quote Originally Posted by Primergy View Post
    The regular models_naval table with dozens of ships is quite large and takes a lot of time to be packed again
    Oh yes, that why I tried packing single ship models in a different directory of its own. Of course I've set the dbtable.xml path accordingly so its only points to a single path of the ship model I want to pack.

  18. #58
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Naval models editing

    Quote Originally Posted by You_Guess_Who View Post
    Code:
    NoMethodError: undefined method `put_navalcams' for #<ModelsNavalDbTable:0x1ca90
    1e>
       put_model_s2tw at models_naval_pack:104
      block in put_db at models_naval_pack:139
                 each at org/jruby/RubyArray.java:1571
               put_db at models_naval_pack:138
                <top> at models_naval_pack:182
    Line numbers here don't seem to match line numbers in most recent code.
    Are you sure you have the most recent version?

  19. #59

    Default Re: Naval models editing

    Quote Originally Posted by taw View Post
    Line numbers here don't seem to match line numbers in most recent code.
    Are you sure you have the most recent version?
    That code you quoted isn't from the main models_naval table, but some stand-alone bob_ship models_naval tables.
    I just replying to Primergy's question, well, who knows it would be different.
    Quote Originally Posted by Primergy View Post
    Can you unpack/repack one of the single ship tables (like bob_chiydogagyxyz)?
    The code from the packing of the main models_naval table is in this post:
    Quote Originally Posted by You_Guess_Who View Post
    Code:
    C:/jruby-9.0.0.0.pre2/lib/ruby/stdlib/rexml/parsers/baseparser.rb:201: warning:
    Comparable#== will no more rescue exceptions of #<=> in the next release.
    C:/jruby-9.0.0.0.pre2/lib/ruby/stdlib/rexml/parsers/baseparser.rb:201: warning:
    Return nil in #<=> if the comparison is inappropriate or avoid such comparison.
    NoMethodError: undefined method `[]' for #<ModelsNavalXmlDir:0x3708b3>
      put_db_header at models_naval_pack:42
             put_db at models_naval_pack:136
              <top> at models_naval_pack:182
    I'm quite sure the table that I use come from up-to-date data.pack. After all in addition to that, I tried to pack the s2-models_naval_dir provided by you in the zip attached at post #19. Same Result.

  20. #60
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Naval models editing

    I fixed that nasty Comparable#== warning spam.

    If anybody can't get newest version to run, please try it on some small file like this:


    $ jruby -v
    jruby 9.0.0.0.pre2 (2.2.2) 2015-04-28 2755ae0 Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]
    $ jruby models_naval_unpack data/s2-bob_ship_kaiyo_maru_models_naval s2-bob_ship_kaiyo_maru_models_naval_unpacked
    $ jruby models_naval_pack s2-bob_ship_kaiyo_maru_models_naval_unpacked s2-bob_ship_kaiyo_maru_models_naval_repack


    And copypaste or screenshot any error messages.

Page 3 of 4 FirstFirst 1234 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
  •