Author Topic: Using %MOD_FOLDER% in LANGUAGE declarations doesn't work properly  (Read 178 times)

Offline Angel

  • Planewalker
  • *****
  • Posts: 119
If I make a language declaration like this:

Code: [Select]
LANGUAGE "American English" "%MOD_FOLDER%/tra/english" "%MOD_FOLDER%/tra/english/setup-mih.tra"
Then this command will fail to find proper translation strings:

Code: [Select]
EXTEND_BOTTOM "baldur.bcs" "%MOD_FOLDER%/item_pack/bgt/scripts/planar_sword.baf" USING "%LANGUAGE%/item_pack/bgt/scripts/planar_sword.tra"
If I replace the %MOD_FOLDER% in the language declaration with a hard-coded path, things work normally.

Further testing reveals that the LANGUAGE directive does not properly resolve the variables; "%MOD_FOLDER%" gets copied verbatim into the %LANGUAGE% variable instead of being evaluated, and then the EXTEND_BOTTOM command fails to find the translation file.

« Last Edit: September 12, 2017, 03:37:08 PM by Angel »

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 899
Re: Using %MOD_FOLDER% in LANGUAGE declarations doesn't work properly
« Reply #1 on: October 08, 2017, 02:56:26 PM »
The second parameter to language should only be "english" in your case. It's only the subdirectory (see readme).

Offline jastey

  • Planewalker
  • *****
  • Posts: 1182
  • Gender: Female
Re: Using %MOD_FOLDER% in LANGUAGE declarations doesn't work properly
« Reply #2 on: October 27, 2017, 03:13:33 AM »
How is %MOD_FOLDER% supposed to work? EDIT: using v242, is that the problem?
in my case (bg1npc), these fail and have to be replaced by the mod folder name (bg1npc):

Code: [Select]
README ~%MOD_FOLDER%/readme-bg1npc-%LANGUAGE%.html~ ~%MOD_FOLDER%/readme-bg1npc.html~
Code: [Select]
ALWAYS
INCLUDE ~%MOD_FOLDER%/lib/bg1npc_always.tpa~
END /* ALWAYS */

Code: [Select]
LANGUAGE ~English~ ~english~ ~%MOD_FOLDER%/tra/english/setup.tra~
And also this and all other instances after BEGIN for calling a file:
Code: [Select]
BEGIN @1005 DESIGNATED 0
/* Tells other mods BG1NPC Core is installed */
COPY ~%MOD_FOLDER%/Core/X#component.xx~ ~override/X#BG1NPCCore.G3~
("ERROR: error loading [%MOD_FOLDER%/Core/X#component.xx]")

This created a folder %MOD_FOLDER% in my game folder and put the backup there:
Code: [Select]
BACKUP ~%MOD_FOLDER%/backup~
So, basically, it's not working. Is the error on my side somewhere?
« Last Edit: October 27, 2017, 03:23:37 AM by jastey »

Offline Argent77

  • Planewalker
  • *****
  • Posts: 145
Re: Using %MOD_FOLDER% in LANGUAGE declarations doesn't work properly
« Reply #3 on: October 27, 2017, 07:12:50 AM »
BACKUP requires the real folder name to make %MOD_FOLDER% work everywhere else in the code. I guess WeiDU sets %MOD_FOLDER% to the folder name specified in the BACKUP directive.

 

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.

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)?: