Export Messages to Text (.txt)

Discussion in 'JS Plugin Releases (RMMV)' started by mogwai, Jan 30, 2017.

  1. mogwai

    mogwai 1984 Veteran

    Messages:
    876
    Likes Received:
    568
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    This is thanks to the guy who made this Youtube tutorial video
    (by @SumRndmDde; not sure if he is on this forum; I found him!)

    This taught me how to use the node.js function to write files.

    I recently wrote one plugin and another online tool for the purpose of spellchecking games, but this is a different (better) way to do it. (Spellchecking has been my major task lately) The reason that other one is in the "still in development" forum is because it only works in browsers which defeats the purpose of using it. This one worked as soon as I wrote it. (after about 500 failed trials because I write that way)

    So I saw a script that does this for VX Ace; that's where i got the idea. There may be one for MV already too; I didn't look it up. All this does is exports all the game messages to a text file; perhaps for searching and spellchecking? (Spellchecking has been my major task lately.)

    I preferred to make mine all in one text file anyway rather than multiple text files. The map001+ . jsons are already broken up into separate files and can already be spellchecked through there via text editor that way. Just back it up and do it when MV is closed, but this is not a tutorial for that. This is a script that exports all of those game messages into a text file for easier reference, search, and spellcheck.

    This also uses alert, confirm, and prompt popups so you remember the thing is still on. Turn it off when done with it. Delete it when done altogether.

    Screenshots
    Screen Shot 2017-01-29 at 10.10.13 PM.png
    Screen Shot 2017-01-29 at 10.12.15 PM.png
    Screen Shot 2017-01-29 at 10.12.25 PM.png
    Screen Shot 2017-01-29 at 10.26.45 PM.png Screen Shot 2017-01-29 at 10.12.56 PM.png Screen Shot 2017-01-29 at 10.28.44 PM.png

    @Andar EDIT: Ok. I checked out the new download link in the post and inserted it. I'm not sure if it's the same one from before, but it seems to work for me. EDIT: I fixed the old the broken @ tag at the top.

    download link (this forum): ExportMessagesToText.js.zip should say version 0.3 - .zip because the new forum won't attach js

    download link (my wordpress): http://jakeis.com/rpg_maker_scripts/ExportMessagesToText.js EDIT: should be version 0.3

    About the commercial use rules. This won't actually be distributed with a game because it's only to create the text file(s) to reference and then the plugin gets turned off. The popups would be annoying. You are free to modify this I guess. I don't really care about licenses, I mean it's plain javascript and node.js and I own neither codes conceptually.
     

    Attached Files:

    Last edited: Feb 18, 2017
    #1
    Pine Towers, Punamaagi, Val and 5 others like this.
  2. JoePie

    JoePie of Art/Game Veteran

    Messages:
    170
    Likes Received:
    225
    Location:
    Way of Infinite Learning
    First Language:
    Not English
    Hi @mogwai, for some reason it can't allocate my folder properly. Is this script work for Mac only?
    Bow to your kindness though. This could save me so much time in proof reading!
    [​IMG]
     
    Last edited: Feb 12, 2017
    #2
  3. Soulnet

    Soulnet Veteran Veteran

    Messages:
    198
    Likes Received:
    95
    First Language:
    English
    I get this as well Win 10 64 bit only my game is installed on c:\ and my game is on e:\
     
    #3
  4. mogwai

    mogwai 1984 Veteran

    Messages:
    876
    Likes Received:
    568
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    Ah. I used node.js path because node fs relative paths didn't work on my Mac like in the fs tutorial.

    It seems to be doubling the path at the volume address protocol.

    I just downloaded the Windows version in Steam on my laptop and I will investigate this.

    Ok. I learned why it was doing this. Windows does not use file:/// so it seems in RPG Maker. I added one line to use a relative path if on windows. I also learned in the windows version I need to add what I think is called a carriage return \r to my newlines in order for newlines to render in the txt. So I've made two corrections in this version.

    I should have tested in Windows before submitting. I'm sorry for this. Next time I release a completed plugin, I'll make sure to test in Windows first.

    I've updated the files in the original post.
     
    Last edited: Feb 18, 2017
    #4
    Roguedeus likes this.
  5. Soulnet

    Soulnet Veteran Veteran

    Messages:
    198
    Likes Received:
    95
    First Language:
    English
    Hi! Thanks for the update. I'm still getting a similar error file. It seems to want to save it to the root directory c:\ but my data files for my game lives on my e:\ drive. It's got rid of the extra c:\c:\ though if that makes sense.
     
    #5
  6. mogwai

    mogwai 1984 Veteran

    Messages:
    876
    Likes Received:
    568
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Soulnet My understanding of the double c:/ was incorrect. I just learned that instead of removing /c:/, all I have to do is remove the / at the beginning and it still works. In theory this version 0.3 with 2 removed regex characters from version 0.2 should correct the incorrect volume, but I can't be 100% certain with only one volume machines to test on. I'm 99% certain this will work.
     
    #6
    Soulnet likes this.
  7. Soulnet

    Soulnet Veteran Veteran

    Messages:
    198
    Likes Received:
    95
    First Language:
    English
    Perfect! Thanks a bunch!
     
    #7
  8. mogwai

    mogwai 1984 Veteran

    Messages:
    876
    Likes Received:
    568
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    But really I should be the one to thank you for helping me fix my sloppy javascript. Thanks!
     
    #8
  9. JoePie

    JoePie of Art/Game Veteran

    Messages:
    170
    Likes Received:
    225
    Location:
    Way of Infinite Learning
    First Language:
    Not English
    @mogwai , just tried the export, perfect! Thanks a bunch for the script and support!
     
    #9
    mogwai likes this.
  10. Val

    Val Veteran Veteran

    Messages:
    270
    Likes Received:
    153
    First Language:
    Fran├žais
    You are my hero :) Waited a long time to have something to help a lot for spellchecking.

    I have a question for you? Do you could upgrade this plugin to go the other way ?
    I mean people do correction in the .txt file and you get all the fix in the event in the game?

    So it could become a great way to fix the game, or to rewrite some text directly with the auto generated .txt

    I hope you will continue working on your export :)

    Thanks!!
     
    #10
  11. Trihan

    Trihan Speedy Scripter Veteran

    Messages:
    1,404
    Likes Received:
    909
    Location:
    Buckie, Scotland
    First Language:
    English
    Val: I'll be working on an MV port of my Dialogue From File plugin which will do that, assuming mogwai doesn't already have plans to add this.
     
    #11
    Val likes this.
  12. mogwai

    mogwai 1984 Veteran

    Messages:
    876
    Likes Received:
    568
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    @Val
    With my luck with this script so far it would be scary to try to write to the game JSONs. I fear I would break something.

    Actually, my plugin is a bit worthless compared to the VXAce equivelent if you think about it, because the JSONs are already decompressed.

    You can make a copy of your Map000.json to back it up and make an editable "beautified" version with this thing http://jsbeautifier.com/

    Then it's only a matter of using a code editor that does spellcheck on the strings. Textwrangler does this for me on Mac.

    You can pack it back up with http://closure-compiler.appspot.com/home even though I think the beautified version still works.

    Just reopen the game after making edits.
     
    #12
    Val likes this.
  13. Val

    Val Veteran Veteran

    Messages:
    270
    Likes Received:
    153
    First Language:
    Fran├žais
    Thanks for the info, I hope I will get new from you when you will get your plugin up and running. Anything that can help all project to be better and having the chance to edit the text of the game in a single file for correction and improvement is welcome!

    Thanks all for your hard work and continue to live the rpg dream :)
     
    #13
  14. Tuomo L

    Tuomo L Oldbie Veteran

    Messages:
    2,135
    Likes Received:
    1,079
    Location:
    Finland!
    First Language:
    Finnish
    Primarily Uses:
    RMMV
    @mogwai

    When I try and export text it says failed to load map.json
     
    #14
  15. Rhino

    Rhino ~Inactive~ Veteran

    Messages:
    482
    Likes Received:
    749
    First Language:
    English
    Primarily Uses:
    RMMV
    @Tuomo L Mogwai got banned from the forums, you're not going to get a response from him :(

    If you're looking for a plugin to use external text files then maybe Zalerinian's External Text might still work? He's no longer working on it either though. I think Iavra's Localization also works using an external file (.json)

    I didn't manage to find anything else that was specifically for exporting already existing text.
     
    #15
  16. Tuomo L

    Tuomo L Oldbie Veteran

    Messages:
    2,135
    Likes Received:
    1,079
    Location:
    Finland!
    First Language:
    Finnish
    Primarily Uses:
    RMMV
    What, banned? But why doesn't his title say Banned instead of Veteran then?


    I'm mostly looking ways to export all the text from my game to text file to easier pass them to trasnlators.
     
    #16
  17. Rhino

    Rhino ~Inactive~ Veteran

    Messages:
    482
    Likes Received:
    749
    First Language:
    English
    Primarily Uses:
    RMMV
    @Tuomo L I don't think that there is a banned title? E.g Kaus' account still says he's a Veteran, but if you try to go to their profile pages it just gives you an error. I don't know the details, but it was a temporary ban that got made permanent.

    You should be able to contact him via one of the sites in his signature though.

    I've tested the plugin in my 1.5.0 project and it still works, so it's not a case of it becoming outdated. I don't really know enough to guess why it's not working for you. Do you have any plugins modifying maps? Have you got any old backups of the project to try it with?
     
    #17

Share This Page