Momento
?关于 ?
Momento 是一款整合包制作工具,能让你在游戏中创建音频日志!
右键点击玩家物品或触发 /dialogue 命令将播放音频,
并显示与音频同步的字幕。
?使用方法(Wiki)?
每个对话至少包含两个组成部分:
- 一个
.srt 文件,用作对话字幕
- 一个
.json 文件,用于定义对话的外观和声音
该模组的所有内容均可包含在资源包中,因为配置文件完全位于客户端。
注意:虽然对话文件是客户端的,但模组本身仍需安装在客户端和服务端!
SubRip 字幕文件 (.srt)
.srt 文件易于制作,你可以使用 Descript 等工具录制对话音频并同时生成字幕。
(教程视频即将推出)
如果你想支持我们并简化你的工作,可以使用我们的链接开始
Descript 免费试用。
我们将在项目中使用此工具,并强烈推荐!
在你的资源包中,这个 .srt 文件需要放置在 /assets/{id}/momento/srt/{lang}
注意:Momento 支持多语言字幕!将 {lang} 替换为你希望字幕支持的语言标识符,
例如 en_us 代表英语。(这些标识符与资源包中 .json 文件的命名方式相同)
对话文件
[dialogue_name].json 文件应放置在 /assets/{modid}/momento/dialogue
默认情况下,配置所需的最少内容包括名称、对声音文件的引用、音量以及对我们刚才提到的 .srt 文件的引用。
看起来大致如下:
{
"name": "Demonstration - by CodexAdrian",
"sound": "momento:demo",
"volume": 1,
"srt": "momento:demo"
}
注意,这里使用的声音引用对于典型的声音来说有点短。你的可能会像
example:example.dialogues.dialogue_intro。
引用将是你在 sounds.json 文件中命名的内容,前面加上资源包的 ID。
然而,除此之外还有很多可配置项。让我们逐一查看。
名称
这里的名称实际上遵循 Minecraft 文本组件的标准格式,因此可以以标题命令通常允许的所有方式进行配置。你可以使用 此 Wiki 学习如何进一步配置对话的名称
图标
这决定了物品纹理的外观。它是一个字符串,用于从我们内置的 5 个选项中选择一个。选项包括:
"BRASS_TAPE_RECORDER"
"HAND_HELD_SPEAKER"
"TEAL_PHONOGRAPH"
"WOODEN_RADIO"
"PURPLE_PHONOGRAPH"
如果留空,默认选项为 "BRASS_TAPE_RECORDER"
显示
你有两种类型的显示可用于字幕,影响字幕文本在屏幕上的渲染方式。
画布
画布显示是默认的,它在文本后面渲染一个单色方框。默认情况下看起来像这样:
{
"display": {
"color": "black",
"alpha": 128,
"width": 50,
"padding": 10,
"margin": {
"top": 0,
"bottom": -80,
"left": 0,
"right": 0
}
}
}
大多数值都是不言自明的。内边距和外边距都使用相同的配置类型,因此有效的内边距和外边距配置可以是这样的
{
"margin": {
"top": 10,
"bottom": 10,
"left": 0,
"right": 0
}
}
或者这样的
{
"margin": 0
}
单个数字的外边距/内边距将对所有四个边应用该数量的外边距或内边距。
事实证明 Resourceful Lib 中的颜色系统非常复杂,并且具有大量可配置选项。它非常漂亮且灵活,适合那些想要尽情使用漂亮颜色的用户。我建议使用预配置的选项
这里。
如果你想要更多关于颜色的解释,加入我们的 Discord 并骚扰 ThatGravyBoat,据说有多种不同的方式来配置颜色。也许还有彩虹选项?我不知道,加入并发现吧 ;)。
纹理
或者,如果你想要不同的风格,可以用渲染的纹理替换画布。这有点复杂,请继续跟随。
对话的纹理需要三个组件。把它想象成一个三明治。顶部面包 "top",即渲染在最上面的部分,肉 "background",即堆叠多次以填充方框高度的部分,以及底部面包 "bottom",即渲染在最底部的部分。这些组件共同提供了非常灵活的文本框体验。看起来大致如下:
{
"display": {
"top": {
"texture": "{modid}:guis/momento.png",
"x": 0,
"y": 0,
"u": 0,
"v": 0,
"width": 256,
"height": 256,
"textureWidth": 256,
"textureHeight": 256
},
"background": {
// 与 top 相同,但略有不同
},
"bottom": {
// 与 top 相同,但略有不同
}
},
...
}
让我们逐个解释这些值
"x" 和 "y"
- 想象你有一个选择框,你正在拖动它以在绘画中选择一组像素。这些坐标是开始选择的位置。
"u" 和 "v"
- 说实话,这是渲染相关的设置,除非你清楚自己在做什么,否则不建议修改这些值。它们的默认值均为
0,你可以省略这些字段,系统会自动填入默认值。
"width" 和 "height"
- 还记得我之前说的从 x 和 y 开始绘制选择框吗?这里定义的就是该选择框的大小。
"textureWidth" 和 "textureHeight"
- 这是
"texture" 所引用的整张图像的维度。建议留空这些值,因为 Minecraft 中的所有 GUI 文件通常大小均为 256x256。
对于纹理艺术家,推荐的做法是:将文本框绘制在单个文件中,使顶部、背景和底部都引用同一文件,并更改“选择框”以封装纹理中对应顶部、底部和背景区域的不同部分。你的选择框可以相互接触,因此完全可以将纹理制作成看起来像 1 个连接的整体,然后将选择框堆叠在一起覆盖其上。
✨社交媒体✨
Momento
?About ?
Momento is a pack maker tool that enables you to create audio logs in game!
Right clicking on the player item or triggering the /dialogue command will playback audio
alongside subtitiles that will match the audio.
? How to Use (Wiki) ?
Every dialogue has at least 2 components:
- A
.srt file that will server as the subtitle for your dialogue
- A
.json file that will dictate how your dialogue will look and sound
Everything for this mod can be contained with a Resourcepack as the config files are completely clientside.
Note: While the files for the dialogues are client side, the mod itself is still required on both client and server!
SubRip Subtitle Files (.srt)
.srt files are easy to make, you can use a tool like Descript to record your audio for your dialogue and create the
subtitles at the same time.
(Video coming soon on how to explain)
If you want to support us and make your life easier at the same time, you can use our link to start
a free trial with Descript.
We're going to be using this tool in our projects, and we highly recommend it!
In your resourcepack, this .srt file needs to be placed in /assets/{id}/momento/srt/{lang}
Note: Momento supports multi-language subtitles! replace {lang} with the identifier for whatever language you'd like
your subtitiles
to support, like en_us for English. (These identifiers are the same as what you would name the .json file for
langs in resourece packs)
Dialogue Files
[dialogue_name].json files should be placed in /assets/{modid}/momento/dialogue
By default, the minimum needed to configure it is a name, a reference to a sound file, the volume, and the reference to
the .srt file we just talked about.
That will look something like this:
{
"name": "Demonstration - by CodexAdrian",
"sound": "momento:demo",
"volume": 1,
"srt": "momento:demo"
}
Note, the sound reference I used here is kinda short for a typical sound. Yours might look something
like example:example.dialogues.dialogue_intro.
The reference will be whatever you called it in your sounds.json file prefixed with the id of your resourcepack.
Much more beyond this is configurable however. Lets go down the list.
Name
The name here actually follows the standard format for Text Components in minecraft, so they are configurable in all the
ways that
the title command typically is. You can use this wiki to learn
how to further
configure the name of your dialogue
Icon
This dictates what the texture of the item will look like. Its a string to chose between one of our 5 built in options.
The options are:
"BRASS_TAPE_RECORDER"
"HAND_HELD_SPEAKER"
"TEAL_PHONOGRAPH"
"WOODEN_RADIO"
"PURPLE_PHONOGRAPH"
The default option if left blank is "BRASS_TAPE_RECORDER"
Display
There are 2 types of displays you can use for your subtitiles that affect how the subtitile text is rendered on screen.
Canvas
Canvas display is the default, it renders a box of a single color behind the text. By default it looks like this:
{
"display": {
"color": "black",
"alpha": 128,
"width": 50,
"padding": 10,
"margin": {
"top": 0,
"bottom": -80,
"left": 0,
"right": 0
}
}
}
Most of these values are self-explanatory. Padding and margin both use the same type of config, so a valid padding and
margin config can either look like this
{
"margin": {
"top": 10,
"bottom": 10,
"left": 0,
"right": 0
}
}
or this
{
"margin": 0
}
The single number margin/padding will apply that number of margin or padding to all 4 sides.
Turns out the color system in Resourceful Lib is really complicated, and has ALOT of configurable options. Its very nice and flexible for those of you
who want to go crazy with pretty colors. I recommend using one of the preconfigured options
here.
If you want more explanation on the colors, join our Discord and bother ThatGravyBoat, apparently there are a dozen different
ways you can configure a color. there's also a rainbow option maybe? idk join and find out ;).
Texture
Alternatively, if you're goin for a different vibe, you can replace the canvas with a rendered texture. Its a little complicated, so stick with me here.
The texture for the dialogue needs 3 components. Think of it like a sandwich. The top bun "top", which part gets rendered on top, the meat "background", the part that gets rendered
multiple times in a stack to fit the height of the box, and the bottom bum "bottom" which renders on the bottom. Together, these components allow a very flexible text
box experience. That looks something like this.
{
"display": {
"top": {
"texture": "{modid}:guis/momento.png",
"x": 0,
"y": 0,
"u": 0,
"v": 0,
"width": 256,
"height": 256,
"textureWidth": 256,
"textureHeight": 256
},
"background": {
// same as top, but slightly different
},
"bottom": {
//same as top, but slightly different
}
},
...
}
Lets run through these values
"x" and "y"
- Imagine you have a selection box that you're dragging to select a group of pixels in a paint. These coordinates are where it will start selecting from.
"u" and "v"
- Ima be honest, this is rendering stuff, you probably shouldn't change this unless you know what you're doing. These values have a default value of 0 and 0,
you can leave these out and it'll fill them in with the default values automatically.
"width" and "height"
- Remember how I said we're drawing a selection box starting at x and y? This is the size of that selection box.
"textureWidth" and "textureHeight"
- This is the dimensions of the entire image that the
"texture" refers to. You should leave these values blank, as all gui files in Minecraft are typically 256x256 in size.
The recommended way of doing this for you texture artists is to draw your textbox in a single file, make the top, background and bottom all refer to the same file and change the
'selection box' to encapsulate different regions of the texture for the top, bottom and background sections. Your selection boxes can be touching each other,
so it's fine to make the texture look like 1 connected box and then layer the selection boxes stacked next to each other.
✨Socials✨
评论 0
登录后参与评分
还没有评论,来抢沙发吧