_mu110_ Posted April 13, 2019 Posted April 13, 2019 Hi everyone, I'm currently working on a mod that makes the JTAC give the target location in Degrees Minutes Seconds so that you can bomb them precisely with the JDAM or just to find the targets in the first place to employ other weapons. All I'm doing is modifying the NATO.lua file in Sounds/Speech/. Part of my code that creates the JTAC's voice line looks like this. local strLat = base.string.format('%02d',latDeg) .. '.' .. base.string.format('%02d',latMin) .. '.' .. base.string.format('%02d',latSec) .. '.' .. base.string.format('%02d',latDec) local strLon = base.string.format('%02d',lonDeg) .. '.' .. base.string.format('%02d',lonMin) .. '.' .. base.string.format('%02d',lonSec) .. '.' .. base.string.format('%02d',lonDec) Currently the output coordinate will look something like this: 54.25.14.88 I would like to format it so that it is easier to understand, like this: 54°25'14.88" When I try to change the periods to apostrophes or quotation marks, it breaks the script and the radio won't work at all, and I'm unsure if it's possible to display the degrees symbol in the radio message. Any help would be greatly appreciated! mu110 Check out my skins and mods on the User Files.
fl0w Posted April 13, 2019 Posted April 13, 2019 My guess is that it's a text encoding issue. Have you tried UTF-8 or UTF-8-BOM?
_mu110_ Posted April 13, 2019 Author Posted April 13, 2019 My guess is that it's a text encoding issue. Have you tried UTF-8 or UTF-8-BOM? I had it set to UTF-8 and just tried it with UTF-8-BOM with no success. My guess was that it had something to do with the fact that I was enclosing an apostrophe with a pair of apostrophes, is there a way I can let the script know to treat it just as text? Check out my skins and mods on the User Files.
fl0w Posted April 13, 2019 Posted April 13, 2019 I know in some languages you can interpret it as " ' " or ' " '. Try flipping quotations around. There is ' \' ' and likewise to break it. (Forums won't let me type the other method, as it defaults to ".)
_mu110_ Posted April 13, 2019 Author Posted April 13, 2019 Just got it working uses the backslash like you suggested, many thanks! Do you have any idea how I could display the degrees symbol? I'm currently using the asterisk as a placeholder. Check out my skins and mods on the User Files.
fl0w Posted April 13, 2019 Posted April 13, 2019 Are you using the alt/decimal version of the degree symbol, or hexadecimal? https://www.degreesymbol.net/ <-- this may help. :)
_mu110_ Posted April 13, 2019 Author Posted April 13, 2019 I ended up just copy and pasting the degree symbol from the temperature in the briefing menu into the code and it works perfectly! Thanks again for all your help, I've put off fixing this for a while now so I'm real glad you were able to help me figure it out! Check out my skins and mods on the User Files.
Recommended Posts