UnderminersTeam / UndertaleModTool

The most complete tool for modding, decompiling and unpacking Undertale (and other GameMaker games!)
GNU General Public License v3.0
1.12k stars 213 forks source link

How can I add new characters to the game.win #8

Closed D3fau4 closed 5 years ago

D3fau4 commented 5 years ago

please, it would be great if you added support to the nintendo switch version

krzys-h commented 5 years ago

Actually, the Nintendo Switch release should be already able to load (or at least the Japanese release @NarryG was testing yesterday), just not save yet. I'm working on that though.

D3fau4 commented 5 years ago

Hi, I'm already here again to ask more questions XD (I'm sorry if you're upset)

I am trying (as you could imagine) to translate in Spanish but I have a problem and it is missing characters (áéíóú and Ñ ñ) and I would like to know how I can add the source correctly with your program. I tried to do a couple of things but they are failed attempts or they do not show the character jpeg_20180920_155655

or enlarge the letters img_20180920_155105_022

thanks for the help, if it were not for your program I could not translate the game

Mc-muffin commented 5 years ago

How are you trying to add them? Last time I checked they need to be placed according to their places in the UTF-8 chart (wich is ¡ ¿ Á É Í Ñ Ó Ú Ü á é í ñ ó ú ü )

D3fau4 commented 5 years ago

How are you trying to add them? Last time I checked they need to be placed according to their places in the UTF-8 chart (wich is ¡ ¿ Á É Í Ñ Ó Ú Ü á é í ñ ó ú ü )

but how?

D3fau4 commented 5 years ago

How are you trying to add them? Last time I checked they need to be placed according to their places in the UTF-8 chart (wich is ¡ ¿ Á É Í Ñ Ó Ú Ü á é í ñ ó ú ü )

We have modified the sprites by adding the characters and adding the coordinates of each letter to the character tables. But it does not work for anything.

Mc-muffin commented 5 years ago

That's weird, may I see a screenshot?

D3fau4 commented 5 years ago

That's weird, may I see a screenshot?

captura_de_pantalla_2018-09-20_a_las_14 00 23 captura_de_pantalla_2018-09-20_a_las_13 57 20-1 captura_de_pantalla_2018-09-20_a_las_15 14 00 captura_de_pantalla_2018-09-20_a_las_13 43 37 everything is made with Photoshop

D3fau4 commented 5 years ago

3213421325 tabla

that's how I put it in the program

Mc-muffin commented 5 years ago

Okay I did it! (It's the switch version, don't be fooled by the PC launcher)

image

Before you jump into conclusions, no those are not Kana characters (just look like them), I just used them to avoid doing image editing :P Here's proof:

image

In this case the accented characters were replaced with the Japanese syllabary, (あぁいぃえぇうぅ etc) but yours will be the correct accented characters from your edited texture.

The process: Well, just input the characters in ascending order! I took the liberty to add the (Ü/ü) to the listing, I don't know if you even use it in the translation but if you don't, simply skip it's character number. So, to fix it replace your previous ordering:

Your number order Character Correct number order Character
225 á 161 ¡
233 é 191 ¿
237 í 193 Á
243 ó 201 É
250 ú 205 Í
193 Á 209 Ñ
201 É 211 Ó
205 Í 218 Ú
211 Ó 220 Ü
218 Ú 225 á
241 ñ 233 é
191 ¿ 237 í
161 ¡ 241 ñ
209 Ñ 243 ó
N/A N/A 250 ú
N/A N/A 252 ü

NOTE: I think it's obvious, but it doesn't hurt to say it, you don't need to redo the texture, just input the characters and their coordinates in the correct order.

As I said it needed to be in the same order as they appear on the UTF-8 character table. And that would be it, if another problem arise just ask.

¡Espero que funcione!

D3fau4 commented 5 years ago

Okay I did it! (It's the switch version, don't be fooled by the PC launcher)

image

Before you jump into conclusions, no those are not Kana characters (just look like them), I just used them to avoid doing image editing :P Here's proof:

image

In this case the accented characters were replaced with the Japanese syllabary, (あぁいぃえぇうぅ etc) but yours will be the correct accented characters from your edited texture.

The process: Well, just input the characters in ascending order! I took the liberty to add the (Ü/ü) to the listing, I don't know if you even use it in the translation but if you don't, simply skip it's character number. So, to fix it replace your previous ordering:

Your number order Character Correct number order Character 225 á 161 ¡ 233 é 191 ¿ 237 í 193 Á 243 ó 201 É 250 ú 205 Í 193 Á 209 Ñ 201 É 211 Ó 205 Í 218 Ú 211 Ó 220 Ü 218 Ú 225 á 241 ñ 233 é 191 ¿ 237 í 161 ¡ 241 ñ 209 Ñ 243 ó N/A N/A 250 ú N/A N/A 252 ü NOTE: I think it's obvious, but it doesn't hurt to say it, you don't need to redo the texture, just input the characters and their coordinates in the correct order.

As I said it needed to be in the same order as they appear on the UTF-8 character table. And that would be it, if another problem arise just ask.

¡Espero que funcione!

ahora el problemas que las letras se ponen gigantes no se porque

krzys-h commented 5 years ago

Thanks for your research! I will add that to the wiki soon, I'm not sure this fits with all the format docs but it needs to be written down somewhere.

I may add a "font wizard" later which would take care of all of this for you, including rendering the characters into the texture so you don't have to edit it yourself. I was even thinking about making a mod that would make creationof user-contributed translations easier (you would have an online editor with preview, the game would auto-update from that and handle all font stuff for you, since I'm pretty sure you CAN add fonts at runtime in GML)

krzys-h commented 5 years ago

Thanks for your research! I will add that to the wiki soon, I'm not sure this fits with all the format docs but it needs to be written down somewhere.

I may add a "font wizard" later which would take care of all of this for you, including rendering the characters into the texture so you don't have to edit it yourself. I was even thinking about making a mod that would make creationof user-contributed translations easier (you would have an online editor with preview, the game would auto-update from that and handle all font stuff for you, since I'm pretty sure you CAN add fonts at runtime in GML)

krzys-h commented 5 years ago

https://docs.yoyogames.com/source/dadiospice/002_reference/game%20assets/fonts/font_add.html Wait, you can even load a standard .ttf file?! Yeah, I'm definitely going to try implementing that soon, would make your life so much easier

krzys-h commented 5 years ago

I promised so I made it: this script will make the game load fonts from TTF files in the current directory instead of using the embedded textures.

You will have to find all the fonts yourself as I cannot host them here for licensing reasons. Especially DotumChe is questionable, as online you can find it only as a paid font. You can get it for free though by downloading the Korean font pack which is an optional feature of Windows 10. You will need a tool that can extract the ttf file from a ttc package too, FontForge should do.

Note that some of these fonts don't have accented characters anyway so it may be not as useful as I thought... but the main game font 8bitoperator_jve seems to have some! And Comic Sans and Papyrus are likely to have a bunch for many languages too. Other fonts are not really used that much, so you could probably live without accented charecters in them.

D3fau4 commented 5 years ago

thank you very much, thanks to you I can continue with the translation into Spanish

costelabr17 commented 4 years ago

hi i have same issue a @D3fau4 i need to add this charectes on my portuguese brazilian translate ÁáÂâÀàÅåÃãÄäÆæÉéÊêÈèËëÍíÎîÌìÏïÓóÔôÒòÕõÖöÚúÛûùÙÜüÇçÑñÝý¿ but i don't know how someone please can help me to finish my work? i don't have much experience is my first work in translation

Mc-muffin commented 4 years ago

@costelabr17 Did you figured it out already or do you still need help?

costelabr17 commented 4 years ago

No, i'm at same point, no have ideia to make it works

@costelabr17 Did you figured it out already or do you still need help?

Mc-muffin commented 4 years ago

~Okay, I'll make you a tutorial!~

I ended up making an easier method that the one depicted originally in the tutorial, so I'll save you the work: I assume you are translating Deltarune, so download this: Export_fonts.zip (extract it anywhere easy to spot) and this: fontScripts.zip extract this one inside [UTMT folder]/SampleScripts

Now open Deltarune's data.win and run the fntimport script, a window will pop-out asking you to select a folder, select the Export_fonts folder you extracted earlier, enjoy!

How-To

If you want to know how I did this here's the aforementioned tutorial, it's a little involved

There are two ways of adding fonts, the "automated" one or the manual way (I won't describe the manual way here):

The "automated" way:

Currently the easiest and quickest way to add missing glyphs

You'll need:

for GameMaker 1.4

Step 1 - Set-Up:

Create a new project image The name (2) is optional, can be anything

Now create a new room, for that right click the Rooms folder at the left and click on Create Room image A new window will pop-up, close it we don't need it

Step 2 - Font creation & addin Characters:

The same way you created a new Room, create a new font image

You'll be presented with this window image

To add characters click on the + at the bottom image

Upon clicking+ you'll be presented this window image

Here you put the characters you need in the box (1) and then click on Ok (2) image

You know you did it correctly if you see the added characters in the previous window image

Now, for the info on the left: image You can source it from Undertale Mod Tool: image

Result: image In the Font field all your system fonts will be displayed, so make sure you have the fonts that you need installed! (Always Un-tick "High-Quality" to get pixellated fonts) After that just click Ok to save the changes (you can repeat this step to add the remainig fonts now)

Step 3 - Getting the fonts:

Now run the project: image A blank game window should open, close it, we don't need it

Now go the GameMaker temp, directory (you can check where it is by checking File>Preferences>Temp Directory) and open the .win file with UndertaleModTool and checking the fonts that it has image Success!

Now use the fntexport script from earlier image the files will be in the same folder of the data.win, inside a folder called Export_fonts

Step 4 - Replacing the fonts:

Open the data.win in which you are going to apply the modified fonts (Deltarune in this example) and now select the fntimport script image a window will pop-up asking you to select a folder, select the Export_fonts folder that the fntexport script created earlier

You are done! Now repeat the process with the remaining fonts.

costelabr17 commented 4 years ago

Thank you so much for this amazing tutorial, this steps works with Deltarune too?

BreakinBenny commented 4 years ago

I'm willing to bet this can also be done without GMS.

costelabr17 commented 4 years ago

Strange is font import and export scripts shows errors to me, maybe have diff with game win from switch version to The PC version, i am working with nx version

Mc-muffin commented 4 years ago

@costelabr17 Show me the errors and I'll see if I can fix them, also this should work with everything, you just need to get the fonts xd the pre-done ones I left at the start are for Deltarune actually :p

Mc-muffin commented 4 years ago

@BreakinBenny Actually, it can be done without it, but it would have to be completely manual (right now at least) so for adding many characters to a font (for example Korean characters) it would take waaaay too long. if you want an automated version the scripts from my answer are almost that it just need a rasterizer for the fonts and then the definition generator.

costelabr17 commented 4 years ago

20191209_181811

20191209_181845

costelabr17 commented 4 years ago

first error shows when i try EXPORT fonts from game.win Deltarune or Undertale:

TextureWorkes not contain definition to "Cleanup" and is not possible find any method of extension "Cleanup" who acept the first argument of "TextureWorker" type. ( you are forgetting to use a directive or assembly reference )

second erro when try use IMPORT:

The name "PromptChooseDirectory" does not exist in the current context

Mc-muffin commented 4 years ago

I think you are using an outdated version of UTMT, try with this one: UndertaleModTool-bac5a61587.zip

costelabr17 commented 4 years ago

I think you are using an outdated version of UTMT, try with this one: UndertaleModTool-bac5a61587.zip

Same error with this version too

Grossley commented 4 years ago

You probably did not actually load the new version, rather instead clicking on the data.win, which would be aliased to the old version. The new version would work with at least one of the directories. @costelabr17 I would love to help you more in a more immediate fashion. If you come to our Discord server I will be able to help you much more immediately. Could you do that?

Mc-muffin commented 4 years ago

@costelabr17 Yeah, try opening the new Undertale Mod Tool first, and then loading the data.win

costelabr17 commented 4 years ago

@Mc-muffin same error

costelabr17 commented 4 years ago

if you need i can uploded game.win files from switch Undertale and Deltarune

Mc-muffin commented 4 years ago

The problem seems to be within your installation of UTMT tho, anyways you can't share them here, do you have Discord? That way I can add the modified fonts for you if you still have the error message poping out

costelabr17 commented 4 years ago

The problem seems to be within your installation of UTMT tho, anyways you can't share them here, do you have Discord? That way I can add the modified fonts for you if you still have the error message poping out

Of course bro, i can send to you in discord my discord Nick is Costelabr#0829 add me or send me your nick please. And again thank you so much for the help, now i can finalize my translation

Archie-osu commented 2 years ago

@Mc-muffin how I can do it now in game maker 2?

Please make a new issue. This is a very old one on top of being solved.

ericasof commented 2 years ago

@Mc-muffin Hello! I'm translating the introduction of deltarune into Portuguese for a uni project and used the method you said about using UndertaleModTool and I added the fonts and it was working fine, but when I get to the Dark World for some reason it stops working? When I'm in the closet scene it's still working but as soon as I interact with something in the Dark World blank spaces start appearing again instead of the new characters... Do you think you could help me with this? Because I really have no idea why this would happen. Thank you in advance!

Jacky720 commented 2 years ago

Since the Dark World runs at a higher resolution than the Light World (makes combat appear smoother), I believe it uses a separate font file.

ericasof commented 2 years ago

Since the Dark World runs at a higher resolution than the Light World (makes combat appear smoother), I believe it uses a separate font file.

Thank you! So how would I go about resolving this?

ericasof commented 2 years ago

@Mc-muffin Hello! I'm translating the introduction of deltarune into Portuguese for a uni project and used the method you said about using UndertaleModTool and I added the fonts and it was working fine, but when I get to the Dark World for some reason it stops working? When I'm in the closet scene it's still working but as soon as I interact with something in the Dark World blank spaces start appearing again instead of the new characters... Do you think you could help me with this? Because I really have no idea why this would happen. Thank you in advance!

@Mc-muffin I figured out what the problem is, in the files you asked us to download, you didn't include the font mainbig! However when I try doing your step-by-step of how you did it it does not work.

kamnanrock commented 2 years ago

I finished change in-game font. But, when I run my game with my language (Thai language), it show my homeland language like this. How can I fixed it??? ภาพหน้าจอ (321)