Build 244 changes that will affect mods

MaxMax Technical Director, Unknown Worlds Entertainment Join Date: 2002-03-15 Member: 318Super Administrators, Retired Developer, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, Subnautica Developer, Pistachionauts, Future Perfect Developer
We generally try pretty hard to make sure the API between game code and the engine remains backwards compatible whenever we make an update. However, in the upcoming Build 244 there are two changes where this is not true.

The first is we have removed support for TrueType fonts. TrueType fonts were something that we have been phasing out, and the need to support this secondary method of drawing fonts is problematic for our future plans. The only way to use a font now will be using the BMFont tool to generate a bitmapped font. If you are still trying to using TrueType fonts, an error message will be logged and the text won't appear.

The second is the way music cues are specified when calling Client.PlayMusic. In the past you would just specify the cue name. Now you need to specify the full path to the project where the cue is located such as Client.PlayMusic("sounds/NS2.fev/Main Menu") instead of Client.PlayMusic("Main Menu"). This change was part of building a simplified method for playing sounds without using the FMOD designer tool. In addition to the old method, you can now just directly play WAV files from disk.

Comments

  • KamamuraKamamura Join Date: 2013-03-06 Member: 183736Members, Reinforced - Gold
    244? Shouldn't it be 245? 244 was the one with lemon trees... y'know.
  • SquishpokePOOPFACESquishpokePOOPFACE -21,248 posts (ignore below) Join Date: 2012-10-31 Member: 165262Members, Reinforced - Shadow
    Kamamura wrote: »
    244? Shouldn't it be 245? 244 was the one with lemon trees... y'know.

    We don't talk about that build anymore...
  • IronsoulIronsoul Join Date: 2011-03-12 Member: 86048Members
    We don't talk about the [REDACTED] anymore.
  • Rich_Rich_ Join Date: 2012-11-05 Member: 167152Members
    Kamamura wrote: »
    244? Shouldn't it be 245? 244 was the one with lemon trees... y'know.

    You know... I always figured lemons grew in a bush or in the ground like potatoes pumpkins or strawberries, or something. Then i saw lemon trees in farmville 2 and thought maybe they had no idea what lemons grow on.. Then i read this post. And i think maybe it's true they do grow on trees after all, like apples and oranges I've never seen a lemon tree, not yet, but the day i do, i'll say to myself "thank you kamamura, you prepared me for this moment".

  • lwflwf Join Date: 2006-11-03 Member: 58311Members, Constellation
    Thanks, any and all announcements like these are much appreciated.
  • MzMzMzMz Join Date: 2006-10-23 Member: 58087Members, Constellation, Reinforced - Supporter
    Max wrote: »
    The first is we have removed support for TrueType fonts. TrueType fonts were something that we have been phasing out, and the need to support this secondary method of drawing fonts is problematic for our future plans. The only way to use a font now will be using the BMFont tool to generate a bitmapped font. If you are still trying to using TrueType fonts, an error message will be logged and the text won't appear.

    If this is going to be (or is) implemented, could you also add support for unicode in game? We (koreans) created a mod that replaces all bitmap fonts to TrueType fonts since current bitmap font system converts UTF-8 symbols to single-byte encoding. This causes Korean characters to be displayed incorrectly. After some extensive testing, we have found a workaround using TrueType font and began distributing to other Koreans last week.

    This news just saddens us. :(

    I know that there is a PT working on a new font now but I guess newly added characters do not go beyond those displayed here http://www.ascii-code.com/



  • MaxMax Technical Director, Unknown Worlds Entertainment Join Date: 2002-03-15 Member: 318Super Administrators, Retired Developer, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, Subnautica Developer, Pistachionauts, Future Perfect Developer
    edited April 2013
    MzMz wrote: »
    If this is going to be (or is) implemented, could you also add support for unicode in game? We (koreans) created a mod that replaces all bitmap fonts to TrueType fonts since current bitmap font system converts UTF-8 symbols to single-byte encoding. This causes Korean characters to be displayed incorrectly. After some extensive testing, we have found a workaround using TrueType font and began distributing to other Koreans last week.
    I'm sorry this will be a step backwards for your efforts, but I'll work on fixing the bitmap font system so that it can render full UTF-8 encoded strings. Can you send me the TTF you are using so I can use it for testing?
  • MzMzMzMz Join Date: 2006-10-23 Member: 58087Members, Constellation, Reinforced - Supporter
    edited April 2013
    Max wrote: »
    Can you send me the TTF you are using so I can use it for testing?

    we aren't using a modified TTF; we are actually using given TTF file Cablibri (for scoreboard) in the game to display korean characters by changing a few LUA codes. To be more specific, we can't directly use korean characters in chat box. Hence, the workaround is to change chat font from bitmap to TTF and pre-define a set of alphabets in korean translation file (koKR.txt) that translates into korean if typed in that order. Then, we search that specific order of alphabets in the chat message and replace them with Korean characters.

    For example, in GUIChat.LUA

    we redefined
    local kFontName = { marine = "fonts/AgencyFB_small.fnt", alien = "fonts/AgencyFB_small.fnt" }
    local kFontName = { marine = "Calibri", alien = "Calibri" }

    then added
    words = { }

    if string.find(messageText, "//") ~= nil then

    for w in string.gmatch(messageText, "%a+") do
    words[#words + 1] = w
    end

    text = ""

    for m = 1, #words do
    text = text .. Locale.ResolveString(words[m])
    end

    insertMessage["Message"]:SetText(text)
    else
    insertMessage["Message"]:SetText(messageText)
    end

    local playerTextWidth = insertMessage["Player"]:GetTextWidth(playerName)
    local messageTextWidth = insertMessage["Message"]:GetTextWidth(messageText)
    if string.find(messageText, "//") ~= nil then
    messageTextWidth = #words * 18
    end

    in addition, koKR.txt file has following set of alphabets defined,
    rk = "가"
    rkr = "각"
    rks = "간"
    rke = "갇"
    rkf = "갈"
    rkfr = "갉"
    rkfa = "갊"
    rka = "감"
    rkq = "갑"
    rkqt = "값"
    rkt = "갓"
    .....

    so, writing "//dks sud gk tp dy" would return 안녕하세요 in game.

    If you are asking for FNT file with .png that contains korean characters, I will make one over the weekend and post it here.


  • MzMzMzMz Join Date: 2006-10-23 Member: 58087Members, Constellation, Reinforced - Supporter
    the attached file contains following

    AGENCYFB.ttf - agencyfb.ttf file that I downloaded
    AGENCYFB_KR.ttf - agencyfb.ttf with korean characters added by me
    AgencyFB_medium.fnt - FNT file using AGENCYFB_KR.ttf using BMFont with provided configuration
    AgencyFB_medium_0.png - png file for AgencyFB_medium.fnt
    koKR.txt - Korean Translation file with pre-defined alphabet sets

    I hope this helps
  • 2d0x2d0x Join Date: 2013-03-16 Member: 184030Members, Reinforced - Supporter
    edited May 2013
    Max wrote: »
    The second is the way music cues are specified when calling Client.PlayMusic. In the past you would just specify the cue name. Now you need to specify the full path to the project where the cue is located such as Client.PlayMusic("sounds/NS2.fev/Main Menu") instead of Client.PlayMusic("Main Menu"). This change was part of building a simplified method for playing sounds without using the FMOD designer tool. In addition to the old method, you can now just directly play WAV files from disk.
    sorry for necroposting but i need help :( i don't have any experience in lua so this is very hard for me to understand
    i want to change game menu music in my mod by this method, so if i understand correctly, i need MainMenu.lua and these lines:

    /**
    * Plays background music in the main menu. The music will be automatically stopped
    * when the menu is left.
    */
    function MenuMenu_PlayMusic(fileName)

    if mainMenuMusic ~= nil then
    Client.StopMusic(mainMenuMusic)
    end

    mainMenuMusic = fileName

    if mainMenuMusic ~= nil then
    Client.PlayMusic(mainMenuMusic)
    end

    end

    also i have music file: ThirstyOnosCut.wav (or maybe i can use .mp3?), i need to put it at mymod\source\soundsrc right?
    which lines in MainMenu.lua and how i should change with my music file name? somebody can show me an example please :)
  • 2d0x2d0x Join Date: 2013-03-16 Member: 184030Members, Reinforced - Supporter
Sign In or Register to comment.