扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 152|回复: 0

[转载发布] RMMV的任务插件发布前研讨会~

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    2025-2-4 02:05
  • 签到天数: 110 天

    连续签到: 2 天

    [LV.6]常住居民II

    2327

    主题

    395

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10465
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13215

    灌水之王

    发表于 2024-2-16 07:07:42 | 显示全部楼层 |阅读模式
    RT,RMMV任务系统即将发布了~想和大家讨论讨论效果需不需要改进之类的~{:2_282:}
    感谢诸位提出的建议,部分问题已经被修复了,现在还有一个存档保存的问题,貌似RMMV的存档保存机制和VA不一样……有没有大神能够指导一下~
    上图:

    任务会以类似《天谕》任务界面那样,分主任务、介绍、任务要点(可以理解为子任务)、完成度四部分显示。
    已经完成的要点会变成灰色。
    这个窗口不影响点击地图。
    任务要点可以监测某个变量,或是指定进度双重判定方法。
    任务可以被染色~
    地图上的窗口只显示未完成任务,菜单中的窗口还没做呢。
    使用方法如下:
    * @help 在脚本中输入以下内容来操作任务系统:
    * ======================================================================
    * 新增任务:
    * $gameParty.addmission(id,name,description,childs,reward,autocomplete);
    * id(string):可以任意填写,是你识别任务的唯一参数,注意最好不要重复。
    * name(string):可以任意填写,是显示的任务名称。
    * description(string):可以任意填写,是显示的任务介绍。
    * childs(array):任务要点列表,以[child,child,...]的格式填写,在下一条目有介绍。
    * reward(array):完成奖励,以[['EXP',数量],['MONEY',数量],[物品ID,数量],...]的格式填写。
    * autocomplete(boolean):是否自动完成任务,自动完成的意思就是达成条件后无需NPC触发。
    * ======================================================================
    * 为某个任务新增要点:
    * $gameParty.addmissionchild(id,child);
    * id(string):任务ID。
    * child(array):要点,以[id,name,maxnumber,readnumber,autocomplete,completed]的格式填写。
    *     id(string):可以任意填写,是你识别要点的唯一参数,同一任务中注意最好不要重复。
    *     name(string):可以任意填写,是显示的要点名称。
    *     maxnumber(int):大于0!达到这个数本要点将会被判定为达成。
    *     readnumber(int/变量指针):
    *         如果填int:需要你手动改变,可以做类似“摘三朵花”之类的任务。
    *         如果填变量指针:会自动监测那个变量,可以做类似“生命达到1000”之类的任务。
    *     autocomplete(boolean):是否自动完成本条件,自动完成的意思就是达成要点后无需NPC触发。
    *     completed(boolean):初始状态是否完成,一般填false。
    * ======================================================================
    * 为某个任务的某个要点中的readnumber+1:
    * $gameParty.upratemissionchild(id,childid);
    * id(string):任务ID。
    * childid(string):要点ID。
    * ======================================================================
    * 指定某个任务的某个要点中的readnumber:
    * $gameParty.setratemissionchild(id,childid,num);、
    * id(string):任务ID。
    * childid(string):要点ID。
    * num(int):值。
    * ======================================================================
    * 强制完成任务要点:
    * $gameParty.completemissionchild(id,childid);
    * id(string):任务ID。
    * childid(string):要点ID。
    * ======================================================================
    * 手动完成任务要点:
    * $gameParty.donemissionchild(id,childid);
    * id(string):任务ID。
    * childid(string):要点ID。
    * 这条与上面那个不一样之处在于:
    *     1、这个方法会检测是否满足达成要点的条件,并返回一个布尔值。
    *     2、如果不满足条件,还是不会完成。
    * 所以这个方法我的建议是放在条件分歧的脚本一栏里。
    * ======================================================================
    * 强制完成任务:
    * $gameParty.completemission(id);
    * id(string):任务ID。
    * ======================================================================
    * 手动完成任务:
    * $gameParty.donemission(id);
    * id(string):任务ID。
    * 与上一条的差别同前。
    * ======================================================================
    请注意!以下代码仅供学习与参考,还没有做完,只能使用一部分的功能……
    JAVASCRIPT 代码
    [code]/*:
    * @plugindesc 为RPG Maker MV新增任务系统。
    * @author 小优【66RPG:rpg-sheep】【百度贴吧:优加星爱兔子】
    *
    * @param Default Volume
    * @desc This will be the volume of the BGM played.
    * @default 90
    *
    * @help 在脚本中输入以下内容来操作任务系统:
    * ======================================================================
    * 新增任务:
    * $gameParty.addmission(id,name,description,childs,reward,autocomplete);
    * id(string):可以任意填写,是你识别任务的唯一参数,注意最好不要重复。
    * name(string):可以任意填写,是显示的任务名称。
    * description(string):可以任意填写,是显示的任务介绍。
    * childs(array):任务要点列表,以[child,child,...]的格式填写,在下一条目有介绍。
    * reward(array):完成奖励,以[['EXP',数量],['MONEY',数量],[物品ID,数量],...]的格式填写。
    * autocomplete(boolean):是否自动完成任务,自动完成的意思就是达成条件后无需NPC触发。
    * ======================================================================
    * 为某个任务新增要点:
    * $gameParty.addmissionchild(id,child);
    * id(string):任务ID。
    * child(array):要点,以[id,name,maxnumber,readnumber,autocomplete,completed]的格式填写。
    *     id(string):可以任意填写,是你识别要点的唯一参数,同一任务中注意最好不要重复。
    *     name(string):可以任意填写,是显示的要点名称。
    *     maxnumber(int):大于0!达到这个数本要点将会被判定为达成。
    *     readnumber(int/变量指针):
    *         如果填int:需要你手动改变,可以做类似“摘三朵花”之类的任务。
    *         如果填变量指针:会自动监测那个变量,可以做类似“生命达到1000”之类的任务。
    *     autocomplete(boolean):是否自动完成本条件,自动完成的意思就是达成要点后无需NPC触发。
    *     completed(boolean):初始状态是否完成,一般填false。
    * ======================================================================
    * 为某个任务的某个要点中的readnumber+1:
    * $gameParty.upratemissionchild(id,childid);
    * id(string):任务ID。
    * childid(string):要点ID。
    * ======================================================================
    * 指定某个任务的某个要点中的readnumber:
    * $gameParty.setratemissionchild(id,childid,num);、
    * id(string):任务ID。
    * childid(string):要点ID。
    * num(int):值。
    * ======================================================================
    * 强制完成任务要点:
    * $gameParty.completemissionchild(id,childid);
    * id(string):任务ID。
    * childid(string):要点ID。
    * ======================================================================
    * 手动完成任务要点:
    * $gameParty.donemissionchild(id,childid);
    * id(string):任务ID。
    * childid(string):要点ID。
    * 这条与上面那个不一样之处在于:
    *     1、这个方法会检测是否满足达成要点的条件,并返回一个布尔值。
    *     2、如果不满足条件,还是不会完成。
    * 所以这个方法我的建议是放在条件分歧的脚本一栏里。
    * ======================================================================
    * 强制完成任务:
    * $gameParty.completemission(id);
    * id(string):任务ID。
    * ======================================================================
    * 手动完成任务:
    * $gameParty.donemission(id);
    * id(string):任务ID。
    * 与上一条的差别同前。
    * ======================================================================
    */

    function Window_XY_Mission(){this.initialize.apply(this, arguments);}

    Window_XY_Mission.prototype = Object.create(Window_Base.prototype);
    Window_XY_Mission.prototype.constructor = Window_XY_Mission;

    Window_XY_Mission.prototype.initialize = function(){
        Window_Base.prototype.initialize.call(this, Graphics.boxWidth - this.windowWidth(), Graphics.boxHeight/2, this.windowWidth(), this.windowHeight());
        this.opacity = 0;
            this.line = 0;
            this.padd = 1;
        this.refresh();
    };
    Window_XY_Mission.prototype.standardFontSize = function(){return18;};
    Window_XY_Mission.prototype.standardPadding = function(){return0;};
    Window_XY_Mission.prototype.textPadding = function(){return10;};
    Window_XY_Mission.prototype.windowWidth = function(){return300;};
    Window_XY_Mission.prototype.windowHeight = function(){return300};
    Window_XY_Mission.prototype.update = function(){
            Window_Base.prototype.update.call(this);
            $gameParty.testallmission();
            this.refresh();
    };
    Window_XY_Mission.prototype.refresh = function(){
        this.contents.clear();
        var width = this.contentsWidth();
            var height = this.standardFontSize()*$gameParty.getdrawline() + 2*this.textPadding();
            this.line = 0;
            this.padd = 0;
        var missionlist = $gameParty.getallmission();
            if(missionlist.length > 0){this.drawBackground(0, 0, width, height);}
            for(var i = 0;i < missionlist.length;i++){
                    var childinfos = [];
                    for(var b = 0;b < missionlist.childs.length;b++){
                        childinfos.push([missionlist.childs[1],missionlist.getchildratebyindex(b),missionlist.childs[6]]);      
                }
                    this.drawMission(width,missionlist.name,missionlist.description,childinfos);
                    this.padd ++;
            }

    };
    Window_XY_Mission.prototype.drawBackground = function(x, y, width, height){
            this.contents.context.fillStyle = 'rgba(0, 0, 0, 0.4)';
        this.contents.context.fillRect(0, 0, this.windowWidth(), this.windowHeight());
    };
    Window_XY_Mission.prototype.drawMission = function(width,name,description,childinfos){
        this.drawText(name, this.textPadding(), this.standardFontSize()*this.line + this.textPadding()*this.padd, width ,'left');
            this.line ++;
            if(description != ''){
                this.drawText(description, this.textPadding()*3, this.standardFontSize()*this.line + this.textPadding()*this.padd, width, 'left');
            this.line ++;
            }
            for(var i = 0;i < childinfos.length;i++){
                    this.changeTextColor(childinfos[2] ? 'rgba(160, 160, 160, 0.4)' : 'rgba(255, 255, 255, 1)');
                    this.drawText('▪' + childinfos[0], this.textPadding()*5, this.standardFontSize()*this.line + this.textPadding()*this.padd, width, 'left');
            this.drawText(childinfos[1], 0, this.standardFontSize()*this.line + this.textPadding()*this.padd, width, 'right');
            this.line ++;
            }
    };/*
    Window_XY_Mission.prototype.drawMissionChild = function(name,rate,completed) {
            this.changeTextColor(this.systemColor());
        var color1 = this.dimColor1();
        var color2 = this.dimColor2();
        this.contents.FillRect(0, 0, width, height, 'rgba(0, 0, 0, 0.3)');
        this.contents.gradientFillRect(x + width / 2, y, width / 2, height, color1, color2);
    };
    Window_XY_Mission.prototype.changeColorbycompleted = function(completed) {
            complete ? this.changeTextColor('rgba(0, 0, 0, 0.6)') : this.changeTextColor('rgba(0, 0, 0, 0.6)');
    };*/
    /*
    Window_XY_Mission.prototype.isOpenAndActive = function() {
        return this.isOpen() && this.active;
    };

    Window_XY_Mission.prototype.processTouch = function() {
        if (this.isOpenAndActive()) {
            if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
                this._touching = true;
                this.onTouch(true);
            } else if (TouchInput.isCancelled()) {
                if (this.isCancelEnabled()) {
                    this.processCancel();
                }
            }
            if (this._touching) {
                if (TouchInput.isPressed()) {
                    this.onTouch(false);
                } else {
                    this._touching = false;
                }
            }
        } else {
            this._touching = false;
        }
    };

    Window_XY_Mission.prototype.isTouchedInsideFrame = function() {
        var x = this.canvasToLocalX(TouchInput.x);
        var y = this.canvasToLocalY(TouchInput.y);
        return ((x >= 0)&&(y >= 0)&&(x

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-10 16:08 , Processed in 0.113782 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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