Skip to content

PostString

DrekiSlayerDrekiSlayer Member Posts: 5
edited March 2021 in Builders - Scripting
Has anyone had any luck getting this function to work with anything other than the default font?

https://nwnlexicon.com/index.php?title=PostString
Some one has a picture on the Lexicon of some larger looking fonts but no example of how to properly use the sFont parameter.

No documentation not sure how to use other fonts. I was able to override the default but I want to do more would also love this to support larger fonts to add major benefit to cutscenes.


Here is some sample code :


object oPC = GetLastUsedBy();
int nColourRed = 0xFF0000FF;
int nFadeOut = 0x00000000;

PostString(oPC, "Test", 0, -20, SCREEN_ANCHOR_CENTER, 20.0, nColourRed, nFadeOut, 0, "Bitter");
PostString(oPC, "Test", 0, 0, SCREEN_ANCHOR_CENTER, 20.0, nColourRed, nFadeOut, 0, "Mordred Bold");
PostString(oPC, "Test", 0, 20, SCREEN_ANCHOR_CENTER, 20.0, nColourRed, nFadeOut, 0, "Brawler");


It compiles and puts some text on the screen at different locations but is exactly the same as this:

object oPC = GetLastUsedBy();
int nColourRed = 0xFF0000FF;
int nFadeOut = 0x00000000;

PostString(oPC, "Test", 0, -20, SCREEN_ANCHOR_CENTER, 20.0, nColourRed, nFadeOut, 0, "");
PostString(oPC, "Test", 0, 0, SCREEN_ANCHOR_CENTER, 20.0, nColourRed, nFadeOut, 0, "");
PostString(oPC, "Test", 0, 20, SCREEN_ANCHOR_CENTER, 20.0, nColourRed, nFadeOut, 0, "");


Any help would be greatly appreciated.

Comments

  • KamirynKamiryn Member Posts: 74
    edited March 2021
    I think PostString() does not work with truetype fonts but with the fonts loaded from tga files.

    See https://nwn.wiki/display/NWN1/Fonts#Fonts-NWN:EETrueTypeFonts for more information.

    I was able to get it work with some of the fonts mentioned there.
  • DrekiSlayerDrekiSlayer Member Posts: 5
    Thanks Kamiryn I did get it working with the other fonts unfortunately even the largest is too small and has little graphical garbage artifacts.
  • KamirynKamiryn Member Posts: 74
    Have you tried NWN Font Maker? It should allow you to create the TGA/TXI files from existing true type fonts.
  • DrekiSlayerDrekiSlayer Member Posts: 5
    Thanks again Kamiryn I had tried that out but a few bigger issues that I am not dealing with at this time going that route...I had to go in to the game options and then under ui disable high resolution fonts before it would work (this is kind of a show stopper) and then also place files in the override folder; my module at this time isn't having any other hak packs or going away from base game other than CEP.
Sign In or Register to comment.