设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 496|回复: 7
打印 上一主题 下一主题

[有事请教] 怎么设置游戏通关后,更改标题界面的音乐呢?

[复制链接]

Lv2.观梦者

梦石
0
星屑
320
在线时间
84 小时
注册时间
2018-6-30
帖子
89
跳转到指定楼层
1
发表于 2023-9-2 10:23:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
80星屑
如题,求大佬赐教QAQ QAQ

最佳答案

查看完整内容

https://rpg.blue/forum.php?mod=redirect&goto=findpost&ptid=491557&pid=2962625&fromuid=2731820 可以参考我之前给别人的回答,他是通关后改变标题画面背景图片。 (function() { ConfigManager.makeData = function() { const config = {}; config.alwaysDash = this.alwaysDash; config.commandRemember = this.commandRemember; config.touchUI = this.touchUI; config.bgmVolume = this.bgmVolume; ...
是一位萌新,正在用mz尝试做游戏,请多多指教!(≧∇≦)ノ

Lv4.逐梦者

梦石
0
星屑
5469
在线时间
396 小时
注册时间
2021-12-4
帖子
417
2
发表于 2023-9-2 10:23:24 | 只看该作者
https://rpg.blue/forum.php?mod=r ... amp;fromuid=2731820
可以参考我之前给别人的回答,他是通关后改变标题画面背景图片。
(function() {
ConfigManager.makeData = function() {
    const config = {};
    config.alwaysDash = this.alwaysDash;
    config.commandRemember = this.commandRemember;
    config.touchUI = this.touchUI;
    config.bgmVolume = this.bgmVolume;
    config.bgsVolume = this.bgsVolume;
    config.meVolume = this.meVolume;
    config.seVolume = this.seVolume;
    config.newGamePlus = this.newGamePlus; // 本行为新增内容,表示是否已通关一周目
    return config;
};
ConfigManager.applyData = function(config) {
    this.alwaysDash = this.readFlag(config, "alwaysDash", false);
    this.commandRemember = this.readFlag(config, "commandRemember", false);
    this.touchUI = this.readFlag(config, "touchUI", true);
    this.bgmVolume = this.readVolume(config, "bgmVolume");
    this.bgsVolume = this.readVolume(config, "bgsVolume");
    this.meVolume = this.readVolume(config, "meVolume");
    this.seVolume = this.readVolume(config, "seVolume");
    this.newGamePlus = this.readFlag(config, 'newGamePlus'); // 本行为新增内容,表示是否已通关一周目
};
Scene_Title.prototype.playTitleMusic = function() {
    if (ConfigManager.newGamePlus) {
        $dataSystem.titleBgm = {"name":"Theme4","pan":0,"pitch":100,"volume":90};
    } // 以上为新增内容,Theme4为通关后的音乐
    AudioManager.playBgm($dataSystem.titleBgm);
    AudioManager.stopBgs();
    AudioManager.stopMe();
}
})();
然后,在通关事件里,使用如下两行脚本:
ConfigManager.newGamePlus = true; // 标记已完成一周目通关
ConfigManager.save(); // 和四个音量等一起保存到配置文件里
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
320
在线时间
84 小时
注册时间
2018-6-30
帖子
89
3
 楼主| 发表于 2023-9-2 20:03:08 | 只看该作者
小秋橙 发表于 2023-9-2 13:45
https://rpg.blue/forum.php?mod=redirect&goto=findpost&ptid=491557&pid=2962625&fromuid=2731820
可以参 ...

蟹蟹!看下来有点懵懵,我先试试
是一位萌新,正在用mz尝试做游戏,请多多指教!(≧∇≦)ノ
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
320
在线时间
84 小时
注册时间
2018-6-30
帖子
89
4
 楼主| 发表于 2023-9-3 21:30:17 | 只看该作者
小秋橙 发表于 2023-9-2 10:23
https://rpg.blue/forum.php?mod=redirect&goto=findpost&ptid=491557&pid=2962625&fromuid=2731820
可以参 ...

感谢大佬!成功啦!!
是一位萌新,正在用mz尝试做游戏,请多多指教!(≧∇≦)ノ
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
320
在线时间
84 小时
注册时间
2018-6-30
帖子
89
5
 楼主| 发表于 2023-9-3 21:35:05 | 只看该作者
小秋橙 发表于 2023-9-2 10:23
https://rpg.blue/forum.php?mod=redirect&goto=findpost&ptid=491557&pid=2962625&fromuid=2731820
可以参 ...

不过大佬,我试了一次后,第二第三次测试就算没打开脚本,通关音乐也会在标题里出现诶,是因为YEP插件的原因吗?QAQ

点评

不关插件的事哦,是因为我给的写法是一次设定好就一直管用的,测试阶段可以删掉那个没有编号的存档文件来重置。  发表于 2023-9-4 20:09
是一位萌新,正在用mz尝试做游戏,请多多指教!(≧∇≦)ノ
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
320
在线时间
84 小时
注册时间
2018-6-30
帖子
89
6
 楼主| 发表于 2023-9-4 23:15:57 | 只看该作者
小秋橙 发表于 2023-9-2 10:23
https://rpg.blue/forum.php?mod=redirect&goto=findpost&ptid=491557&pid=2962625&fromuid=2731820
可以参 ...

是删掉save文件夹里的config.rpgmzsave文件吗?(萌新懵懵)

点评

是的吧,手头没电脑记不太清楚了……  发表于 2023-9-5 06:34
是一位萌新,正在用mz尝试做游戏,请多多指教!(≧∇≦)ノ
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-4 02:36

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表