Garry's Mod

Garry's Mod

Undertale Dialog Box
N  [开发者] 7 月 3 日 下午 1:34
How to add fonts and sounds
How to add sounds


1: open dialog_box.lua and go to line 68 local Sounds = {

add your sound underneath local sounds:

["alphys"] = "db/snd_txtal.wav", (this is an example, you can change it to whatever the characters name is here), save and your done!


How to add fonts


2: go to line 82 local Fonts = {

add your font underneath local fonts:

["alphys"] = "alphys" (this is an example, you can change the font name to whatever the character's name is here)

3: next goes to line 101 local resource_fonts = { (this is the adding the resource font in game)


4: to add the font itself under local resource_fonts = {, follow these steps

5: put your font in this path: resource\fonts

6: now copy the font name (it should usally be like .ttf)

7: underneath local resource_fonts = {, add this: "8bitoperator jve.ttf", (change this to your custom font name), you are done with this step, next one

8: go down to line 363, now underneath line 369 copy this entire code here:


surface.CreateFont("alphys", {
font = "Alphys",
size = 34 * (ScrW() / 1920),
weight = 500,
antialias = true,
shadow = true
})


rename it to your custom font name (the first name is the character name), the font name, here is how to get it, go to this path in the addon: resource\fonts

open the .ttf itself, and find Font Name:

where it says font = in the code, call it that exact name, as for the font size, change it to whatever you'd like, sometimes it may be small in the dialog box, after you are done with that, you are done!, congratulations, save and you are done
最后由 N 编辑于; 7 月 4 日 下午 7:31