Printing special charactersaccents with papyrus

Post » Wed Mar 11, 2015 3:13 am

Hello, newbie coding question but how do I print special characters on screen with papyrus? Where do I find the code and how's the input?

Basically, what I'm trying to do is use debug.Notification to print characters like "ó" and "ú" and show like that on screen, I know coding doesn't accept special characters and uses workarounds (I used to code in html, but I don't know the equivalent code in papyrus) so if anyone knows and helps me would be appreciated.

Thanks.

User avatar
sally coker
 
Posts: 3349
Joined: Wed Jul 26, 2006 7:51 pm

Post » Tue Mar 10, 2015 10:11 pm

The official position is to avoid Debug.Notification and use Messages where ever possible. (Notice that Notification is part of the Debug script not the Game script.)For those cases where you really need a notification should just be able to include those characters directly into the strings, but the game uses Window's old language scheme so things may not always work like you expect. You need to have the system language settings set for a codepage that has the characters you want, and anyone playing the game in another codepage will likely see something entirely different if you get out of the basic ASCII range. And note that game's fonts are also somewhat limited, so you have to test and make sure the character you want even exists. (Basic accents do though.)
User avatar
Kaylee Campbell
 
Posts: 3463
Joined: Mon Mar 05, 2007 11:17 am

Post » Wed Mar 11, 2015 12:29 am

That's weird, because I definately have my OS language settings set like you said, and while trying to print accents ("ó" and "ú" like I said) it shows just gibberish instead. In-game accents show fine, so I guess there's somewhere in the compiling process that messes up, and doesn't recognize those characters;so I'm not sure what to do now.

User avatar
Joie Perez
 
Posts: 3410
Joined: Fri Sep 15, 2006 3:25 pm

Post » Wed Mar 11, 2015 12:05 am

Papyrus does not understand non-English characters. That's one of the reasons it is not recommended to use any of the Debug functions to display text to the user, and instead use Message forms, which can be localized into a variety of languages.
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am

Post » Wed Mar 11, 2015 11:28 am

Had no problems myself when I had to display Japanese text (UTF-8 string, hardcoded). And Message is okay for static texts only. Ensure your psc file encoded in UTF-8

User avatar
Maddy Paul
 
Posts: 3430
Joined: Wed Feb 14, 2007 4:20 pm

Post » Wed Mar 11, 2015 2:32 am

Alright, I got it. I found out that Skyrim is using many different encondings depending on the localization, making it a mess for us to find out :/

For what I've read, it seems chinese and japanese versions of Skyrim are encoded in UTF-8, so that's why it worked for you, silverice. But turns out my Skyrim version is encoded using Western (windows 1252), changing the script to that worked for me.

So after all, better check which encoding is your Skyrim using before scripting, it'll save you a lot of headaches.

Thank you all for your responses and help! Much appreciated.

User avatar
josh evans
 
Posts: 3471
Joined: Mon Jun 04, 2007 1:37 am

Post » Wed Mar 11, 2015 3:19 am

... Except that now your script is going to break on any other localized version of Skyrim.

Seriously. Use Messages :tongue:

Papyrus is not designed to show text to the user for a reason :smile:
User avatar
Dan Wright
 
Posts: 3308
Joined: Mon Jul 16, 2007 8:40 am

Post » Tue Mar 10, 2015 11:08 pm

If you are using SKSE there's one more option. You can set up language translation files for your mod. The instructions for that are on the documentation page for SkyUI's https://github.com/schlangster/skyui/wiki/MCM-Advanced-Features. You can then use the dreaded $ strings in your scripts and SKSE will use the appropriate language file for the player's system settings.
User avatar
Rusty Billiot
 
Posts: 3431
Joined: Sat Sep 22, 2007 10:22 pm

Post » Wed Mar 11, 2015 12:16 am

The script is only for personal use (at least for now) and it's an immersive one, so I would rather not use messages for now. It's unlikely that someone with another localized copy of Skyrim would want to use my localized translation anyway. As long as it's only for me, I'm fine with it (;

If I'm ever going to release it, I'm probably using this. I will check it anyway and play a bit with the features anyway so thanks for sharing. (:

User avatar
Benito Martinez
 
Posts: 3470
Joined: Thu Aug 30, 2007 6:33 am

Post » Wed Mar 11, 2015 6:58 am

My Skyrim installation is also western encoded.

User avatar
Anthony Diaz
 
Posts: 3474
Joined: Thu Aug 09, 2007 11:24 pm


Return to V - Skyrim