Author Topic: Question to fl#reload  (Read 690 times)

Offline jastey

  • Planewalker
  • *****
  • Posts: 1242
  • Gender: Female
Question to fl#reload
« on: May 07, 2018, 11:36:29 PM »
In bgqe v16 I use in the ALWAYS block:

Quote
ACTION_IF !FILE_EXISTS ~bgqe/backup/bgqeinstall.mrk~ BEGIN

(...)

ACTION_DEFINE_ARRAY fl#noconvert BEGIN setup.tra END

ACTION_DEFINE_ARRAY fl#reload BEGIN bgqe_game.tra END

  LAF HANDLE_CHARSETS
    INT_VAR
      infer_charset = 1
    STR_VAR
      tra_path = EVAL ~bgqe/Tra~
      noconvert_array = fl#noconvert
      reload_array = fl#reload
  END

      COPY_EXISTING sw1h01.itm ~bgqe/backup/bgqeinstall.mrk~

  END //bgqeinstall.mrk

with bgqe_game.tra being the tra containing the ingame texts used in the tp2 plus journal entries. The tra transformation is wrapped inside a marker file so it's not done every time one of the mod's components is de-/reinstalled.

Still, after installing all components in one go after starting the setup.exe, the first journal entry containing a symbol freezes the game.

1. Maybe I didn't understand how fl#reload works
2. I somehow tricked it by wrapping it into the marker install or something else
3. or maybe fl#reload doesn't work as intended?

I will add a manual reload anyway to make sure it's always refreshed for any de-/reinstalling of the mod, but I'd think this wouldn't be necessary if fl#reload works the way I think it is supposed to (reloading the specified tras directly after the conversion so after the conversion the correct utf-8 tras will be used for installation).

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 268
  • Gender: Male
Re: Question to fl#reload
« Reply #1 on: May 08, 2018, 01:22:37 PM »
Ascension also use such workaround. Why on earth original language files are also modified along with fl#utf8xxx files?
You cannot have progress without committing changes...A Basic Modder's Guide to Git and Github

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 993
Re: Question to fl#reload
« Reply #2 on: May 08, 2018, 01:31:09 PM »
In all arrays, the .tra file extension is implied. So in your case, WeiDU is trying to reload bgqe_game.tra.tra. I see the documentation of reload_array is not explicit on this point. Will fix. But the same applies to convert_array and noconvert_array.

Beyond that, HANDLE_CHARSETS is already non-cumulative and you couldn't have it covert your files twice even if you tried. It is also not necessary to use my prefix for the array names. You can call them whatever you like, since you are passing the name of the array to the function.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 993
Re: Question to fl#reload
« Reply #3 on: May 08, 2018, 01:43:19 PM »
Ascension also use such workaround. Why on earth original language files are also modified along with fl#utf8xxx files?
I'm not sure what your question is. I thought it would be self-evident why I can't overwrite an original mod file with no backup, and why the converted file can't have a different name than the original one.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 268
  • Gender: Male
Re: Question to fl#reload
« Reply #4 on: May 09, 2018, 04:22:01 AM »
1. Mod have /tra/Polish/example.tra as ANSI
2. HANDLE_CHARSET convert above file to UTF8 using 1250 codepage, the results file is /tra/Polish/fl#utf8_example.tra which has correct UTF8 encoding
3. But the source file /tra/Polish/example.tra is also changed/converted into UTF8, why ?

It causes major PITA if someone want's to correct translation and reinstall mod because he is forced to change encoding of the original file/extract mod again.
You cannot have progress without committing changes...A Basic Modder's Guide to Git and Github

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 993
Re: Question to fl#reload
« Reply #5 on: May 09, 2018, 11:47:31 AM »
4. The mod COMPILEs something USING ~/tra/Polish/example.tra~ and is expected to work on EE games.

It causes major PITA if someone want's to correct translation and reinstall mod because he is forced to change encoding of the original file/extract mod again.
Uninstall, make changes, reinstall. If you must work on a "live" copy of your mod, it's a good pattern to follow in other cases, as well.
« Last Edit: May 09, 2018, 11:51:44 AM by Wisp »

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 268
  • Gender: Male
Re: Question to fl#reload
« Reply #6 on: May 09, 2018, 02:57:03 PM »
If i converting all .tra files and I'm getting fl#utf8_xxx.tra files which contains converted codepage, why source files are converted also? Why weidu can't use fl#utf8_xxx.tra files as a source of the and leave original intact? In other words: if original files are converted, what is the point of coping them as separate copy?
You cannot have progress without committing changes...A Basic Modder's Guide to Git and Github

Offline jastey

  • Planewalker
  • *****
  • Posts: 1242
  • Gender: Female
Re: Question to fl#reload
« Reply #7 on: May 09, 2018, 04:05:42 PM »
In all arrays, the .tra file extension is implied. So in your case, WeiDU is trying to reload bgqe_game.tra.tra. I see the documentation of reload_array is not explicit on this point. Will fix. But the same applies to convert_array and noconvert_array.

Beyond that, HANDLE_CHARSETS is already non-cumulative and you couldn't have it covert your files twice even if you tried. It is also not necessary to use my prefix for the array names. You can call them whatever you like, since you are passing the name of the array to the function.
Literally everything you wrote in this post I didn't know yet. Thank you very much for the clearification!

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 993
Re: Question to fl#reload
« Reply #8 on: May 10, 2018, 05:07:59 AM »
If i converting all .tra files and I'm getting fl#utf8_xxx.tra files which contains converted codepage, why source files are converted also? Why weidu can't use fl#utf8_xxx.tra files as a source of the and leave original intact? In other words: if original files are converted, what is the point of coping them as separate copy?
fl#utf8_xxx.tra is the output from iconv, which is copied onto xxx.tra in order to have the mod work on EE games. There is no particular reason for why there has to be 2 different files (that I can think of now) but that's how it turned out.


 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: