[Help Needed] Creating a mods menu for a fonts mod
Sort of a modding noob here.
(First time I'm trying to create a mods using a mods menu)
I am trying to create a small mod that allows me to change the in-game font with a menu. (Options Slider)
I'll explain how I'm trying to do this.
First
1) I located the file responsible for the game font: \gameplay\gui_new\swf\witcher3\fonts.en.redswf
2) I edited this file with JPEXS Flash Decompiler, and embedded the new font: http://www.fonts2u.com/malefic-font.font
3) As a test I ran this on its own as a replacement. (I packed the edited file with the same name under \gameplay\gui_new\swf\witcher3\)
Worked fine, the font showed up in game.
I have no problem changing the game font, as long as i package the edited .redswf file as a direct replacement for the vanilla one.
Second
Now I am trying to create a mod menu that allows me (at least for now) to switch the font from the Default one to this one.
Later on, I'd like to add more and more.
This is the XML file:
The one under \The Witcher 3\bin\config\r4game\user_config_matrix\pc
This works fine. The menu appears in game, and i am able to use it to change the value output of "FontSelection"
Third
Now I'm trying to get to grips with the w3strings file, and this is where i am most confused.
Here is what i have so far:
1) What is the key(hex)? How do i find out what one i need for my files?
2) How do I find out what ID i need?
3) "Text"is fairly self explanatory.
I have found very little in the way of documentation.
These threads helped a bit, but didn't fully explain.
http://forums.cdprojektred.com/foru...new-ids-and-keys-as-standalone-w3strings-file
https://forums.nexusmods.com/index....-one-make-a-mod-that-uses-the-gams-mods-menu/
Forth
Ok, so now i need to actually get the game to read the corresponding file based on user selection.
I planed to swap the font by having multiple .redswf files under \gameplay\gui_new\swf\witcher3\ each with various names
\gameplay\gui_new\swf\witcher3\[Default]fonts_en.redswf
\gameplay\gui_new\swf\witcher3\[Malefic]fonts_en.redswf
etc...
for example
I then would edit this file: \gameplay\gui_new\fonts.xml
I want the code to check which font is selected from the menu (user.settings file) and then tell it to reference a particular file.
The vanilla code:
However i have run into a problem.
As a quick test to see if it would work I changed the directory of the font file to
And packed that edited version and the fonts file.
so this:
\gameplay\gui_new\swf\witcher3\[Malefic]fonts_en.redswf
gameplay\gui_new\fonts.xml
The game launches, but gets stuck on a black screen. (I'm guessing the game is trying to find [Malefic]fonts_en.redswf in the vanilla files, not my modded one, and it can't)
So, how do i fix this? (tell it to reference my new file?)
Finally
These are the question i have:
What are the hex values in the w3strings file?
How do I find out these hex values?
What are the ID values in the w3strings file?
How do i link the w3strings file and the the xml files together?
How do i get the edited fonts XML file reference my new packed files?
Sort of a modding noob here.
(First time I'm trying to create a mods using a mods menu)
I am trying to create a small mod that allows me to change the in-game font with a menu. (Options Slider)
I'll explain how I'm trying to do this.
First
1) I located the file responsible for the game font: \gameplay\gui_new\swf\witcher3\fonts.en.redswf
2) I edited this file with JPEXS Flash Decompiler, and embedded the new font: http://www.fonts2u.com/malefic-font.font
3) As a test I ran this on its own as a replacement. (I packed the edited file with the same name under \gameplay\gui_new\swf\witcher3\)
Worked fine, the font showed up in game.
I have no problem changing the game font, as long as i package the edited .redswf file as a direct replacement for the vanilla one.
Second
Now I am trying to create a mod menu that allows me (at least for now) to switch the font from the Default one to this one.
Later on, I'd like to add more and more.
This is the XML file:
The one under \The Witcher 3\bin\config\r4game\user_config_matrix\pc
Code:
<?xml version="1.0" encoding="UTF-16"?>
<UserConfig>
<Group id="FontSettings" displayName="Mods.Miscellaneous">
<VisibleVars>
<Var id="FontSelection" displayName="Font" displayType="OPTIONS" tags="customNames;customDisplayName">
<OptionsArray>
<Option id="0" displayName="font_Default">
<Entry varId="FontSelection" value="0"/>
</Option>
<Option id="1" displayName="font_Malefic">
<Entry varId="FontSelection" value="1"/>
</Option>
</OptionsArray>
</Var>
</VisibleVars>
</Group>
</UserConfig>
Code:
[FontSettings]
FontSelection=1
This works fine. The menu appears in game, and i am able to use it to change the value output of "FontSelection"
Third
Now I'm trying to get to grips with the w3strings file, and this is where i am most confused.
Here is what i have so far:
Code:
;meta[language=en]
; id |key(hex)|key(str)| text
2119999100|4d5f8b0c||Mods
2119999101|xxxxxxxx||Font
1) What is the key(hex)? How do i find out what one i need for my files?
2) How do I find out what ID i need?
3) "Text"is fairly self explanatory.
I have found very little in the way of documentation.
These threads helped a bit, but didn't fully explain.
http://forums.cdprojektred.com/foru...new-ids-and-keys-as-standalone-w3strings-file
https://forums.nexusmods.com/index....-one-make-a-mod-that-uses-the-gams-mods-menu/
Forth
Ok, so now i need to actually get the game to read the corresponding file based on user selection.
I planed to swap the font by having multiple .redswf files under \gameplay\gui_new\swf\witcher3\ each with various names
\gameplay\gui_new\swf\witcher3\[Default]fonts_en.redswf
\gameplay\gui_new\swf\witcher3\[Malefic]fonts_en.redswf
etc...
for example
I then would edit this file: \gameplay\gui_new\fonts.xml
I want the code to check which font is selected from the menu (user.settings file) and then tell it to reference a particular file.
The vanilla code:
Code:
<?xml version="1.0" encoding="UTF-16"?>
<fonts fontlib="gfxfontlib">
<lang name="EN" fontlib="gameplay/gui_new/swf/witcher3/fonts_en.redswf">
<NormalFont font="PF Din Text Cond Pro"/>
<ItalicFont font="PF Din Text Cond Pro" italic="1"/>
<BoldFont font="PF Din Text Cond Pro" bold="1"/>
<CreditsFont font="PF Din Text Cond Pro"/>
</lang>
<lang name="RU" fontlib="gameplay/gui_new/swf/witcher3/fonts_ru.redswf">
<NormalFont font="PF Din Text Cond Pro"/>
<ItalicFont font="PF Din Text Cond Pro" italic="1"/>
<BoldFont font="PF Din Text Cond Pro" bold="1"/>
<CreditsFont font="PF Din Text Cond Pro"/>
</lang>
<lang name="AR" fontlib="gameplay/gui_new/swf/witcher3/fonts_ar.redswf">
<NormalFont font="Arial"/>
<ItalicFont font="Arial"/>
<BoldFont font="Arial" bold="1"/>
<CreditsFont font="PF Din Text Cond Pro"/>
</lang>
<lang name="ZH" glyphcache="1" fontlib="gameplay/gui_new/swf/witcher3/fonts_zh.redswf">
<NormalFont font="PMingLiU"/>
<ItalicFont font="PMingLiU"/>
<BoldFont font="PMingLiU"/>
<CreditsFont font="PF Din Text Cond Pro"/>
</lang>
<lang name="CN" glyphcache="1" fontlib="gameplay/gui_new/swf/witcher3/fonts_zh.redswf">
<NormalFont font="PMingLiU"/>
<ItalicFont font="DPMingLiU"/>
<BoldFont font="PMingLiU"/>
<CreditsFont font="PF Din Text Cond Pro"/>
</lang>
<lang name="JP" glyphcache="1" fontlib="gameplay/gui_new/swf/witcher3/fonts_jp.redswf">
<NormalFont font="DFMinchoP-W5"/>
<ItalicFont font="DFMinchoP-W5" />
<BoldFont font="DFMinchoP-W5"/>
<CreditsFont font="PF Din Text Cond Pro"/>
</lang>
<lang name="KR" fontlib="gameplay/gui_new/swf/witcher3/fonts_kr.redswf">
<NormalFont font="NanumMyeongjo"/>
<ItalicFont font="NanumMyeongjo"/>
<BoldFont font="NanumMyeongjo Bold"/>
<CreditsFont font="PF Din Text Cond Pro"/>
</lang>
<lang name="PL" ref="EN"/>
<lang name="DE" ref="EN"/>
<lang name="FR" ref="EN"/>
<lang name="IT" ref="EN"/>
<lang name="ES" ref="EN"/>
<lang name="BR" ref="EN"/>
<lang name="ESMX" ref="EN"/>
<lang name="CZ" ref="EN"/>
<lang name="HU" ref="EN"/>
<lang name="TR" ref="EN"/>
<lang name="DEBUG" ref="EN"/>
</fonts>
However i have run into a problem.
As a quick test to see if it would work I changed the directory of the font file to
Code:
<lang name="EN" fontlib="gameplay/gui_new/swf/witcher3/[Malefic]fonts_en.redswf">
And packed that edited version and the fonts file.
so this:
\gameplay\gui_new\swf\witcher3\[Malefic]fonts_en.redswf
gameplay\gui_new\fonts.xml
The game launches, but gets stuck on a black screen. (I'm guessing the game is trying to find [Malefic]fonts_en.redswf in the vanilla files, not my modded one, and it can't)
So, how do i fix this? (tell it to reference my new file?)
Finally
These are the question i have:
What are the hex values in the w3strings file?
How do I find out these hex values?
What are the ID values in the w3strings file?
How do i link the w3strings file and the the xml files together?
How do i get the edited fonts XML file reference my new packed files?