Project1

标题: GameusQuestSystem 任务没看懂【要怎么调】 [打印本页]

作者: 云端城主    时间: 2023-5-21 11:02
标题: GameusQuestSystem 任务没看懂【要怎么调】
$gameParty.hasQuests([quest ids], filter)
*   此指令一次檢測隊伍是否開啟了某些任務,以及它們是否全部在某個類別中。請勿與上面的指令搞混。
*   過濾子可以是"progress"(進行中)、"completed"(已完成)或"failed"(已失敗)。
*   如果以上條件都滿足,則回傳true。
*   例如,可以使用在接取某任務前,確認該任務必須完成的一海票前置任務。
*
* $gameQuests.get(quest_id).currentStep
* 取得某個任務正進行到哪個階段數。可以藉由"控制變數"事件的腳本取得任務階段id
* $gameQuests.get(quest_id).currentStep === step_number
*   用於取得某個任務正進行到哪個階段。階段數從0開始。
*   注意:即使該任務並未開啟,此指令仍然會回傳數字!請與$gameParty.hasQuest(quest_id)並用!
*
* $gameQuests.get(quest_id).status === "status"
*   用於取得某個任務的狀態。
*   "status"可以是"progress"(進行中)、"completed"(已完成)或"failed"(已失敗)。
*  
* $gameQuests.totalQuests(filter)
*   用於取得某狀態下有多少任務。
*   過濾子可以是"progress"(進行中)、"completed"(已完成)或"failed"(已失敗)。
*   這個指令會取得該狀態所有類別的任務,不管隊伍是否擁有!
*
* $gameParty.totalQuests(filter)
*   與上面指令相同,但只會取得隊伍擁有的任務。


上面那些没看懂,要怎么弄啊,请高手回答一下??先谢谢了!
作者: 云端城主    时间: 2023-6-19 10:51
到底有没有人知道啊?
作者: xiamumomo    时间: 2023-6-19 19:45
云端城主 发表于 2023-6-19 10:51
到底有没有人知道啊?

没想到这么久了你还在解决中
作者: 天下无尽    时间: 2023-6-27 18:30
本帖最后由 天下无尽 于 2023-6-27 18:33 编辑

====小白,最近正在研究GameusQuestSystem,以下为自己的看法,可能有错误====
$gameParty.hasQuests([quest ids], filter):如,$gameParty.hasQuests([1], completed)----这个方法会先判断任务1是否完成,然后返回True或者False.
$gameQuests.get(quest_id).currentStep:如,$gameQuests.get(1).currentStep----这个方法会获取任务1当前进行到的步骤(从0开始计算,建议在$gameParty.hasQuests([quest ids], filter)返回True时再执行函数)
$gameQuests.get(quest_id).status === "status",如:$gameQuests.get(1).status === "completed",判断任务1是否完成,其中"completed"可以替换为"progress"(进行中)、"completed"(已完成)或"failed"(已失败)
$gameQuests.totalQuests(filter),如:$gameQuests.totalQuests(completed),获取完成的任务有多少个
$gameParty.totalQuests(filter),这个不太清楚。
====
例如,有一个任务:
    任务1:步骤1,前往教堂;步骤2,和修女交谈。
    然后,可以在进入教堂的时候判断:
        逻辑:1.判断任务1是否在任务列表中,2.如果是,判断任务步骤,3.如果前面条件都满足,那么完成步骤1,进入步骤2.
        代码:
                ====注,在“$gameVariables.setValue(101,a);”一行中,这个101是对应的变量编号,在这里对应变量“临时”
====希望能有帮助====

a.png (28.51 KB, 下载次数: 97)

a.png

作者: 云端城主    时间: 2023-6-28 15:55
天下无尽 发表于 2023-6-27 18:30
====小白,最近正在研究GameusQuestSystem,以下为自己的看法,可能有错误====
$gameParty.hasQuests([ques ...

不知道是不是设置错了?我就想知道是怎么判定任务1 第1步的?

都还没有错。

任务1的 第1步进行中时,居然判定不了任务啦?任务1 进行不了第1步?

作者: 天下无尽    时间: 2023-6-29 20:57
本帖最后由 天下无尽 于 2023-6-29 21:04 编辑
云端城主 发表于 2023-6-28 15:55
不知道是不是设置错了?我就想知道是怎么判定任务1 第1步的?

都还没有错。


hmmmmmm,$gameQuests.get(quest_id).currentStep方法返回的是一个数字,默认从0开始计算,也就是说,如果任务进行到了第1步,返回的数字就是0——所以......直接用条件判断一个数字......?有点奇怪。而且,最近我对这段代码进行了修改,可以参考一下新代码。

屏幕截图 2023-06-29 210404.png (168.01 KB, 下载次数: 115)

屏幕截图 2023-06-29 210404.png

作者: 天下无尽    时间: 2023-6-29 21:00
云端城主 发表于 2023-6-28 15:55
不知道是不是设置错了?我就想知道是怎么判定任务1 第1步的?

都还没有错。

而且,如果条件分歧支持直接判断数字的话,你的任务进行到了步骤1,返回的数字是0,代表了false,会直接执行“否则”里的事件,如果真是这样,当然会显示未取得了,建议不要直接用分歧判断一个数字。
作者: 云端城主    时间: 2023-6-30 17:12
天下无尽 发表于 2023-6-29 20:57
hmmmmmm,$gameQuests.get(quest_id).currentStep方法返回的是一个数字,默认从0开始计算,也就是说,如果 ...

我是条件分支设置,没有影响任务100%,你的代码我没懂?对不起我是小白目了。
我把任务文件范例传下,你下载,做好了再传给我看看。谢谢啊!


链接:https://pan.baidu.com/s/1dws1gykxmYsjXibaK5unJA?pwd=ydo1
提取码:ydo1

作者: 天下无尽    时间: 2023-6-30 18:58
本帖最后由 天下无尽 于 2023-6-30 19:28 编辑
云端城主 发表于 2023-6-30 17:12
我是条件分支设置,没有影响任务100%,你的代码我没懂?对不起我是小白目了。
我把任务文件范例传下,你 ...


啊这,本人只是一个初中生,出于学业方面很多东西受限,还是直接发截图吧,貌似没有办法可以直接发一整个工程文件。
作者: 天下无尽    时间: 2023-6-30 19:23
本帖最后由 天下无尽 于 2023-6-30 19:30 编辑
云端城主 发表于 2023-6-30 17:12
我是条件分支设置,没有影响任务100%,你的代码我没懂?对不起我是小白目了。
我把任务文件范例传下,你 ...


我直接发那个地图文件代码吧:
JSON 代码复制下载
  1. {
  2. "autoplayBgm":false,"autoplayBgs":false,"battleback1Name":"","battleback2Name":"","bgm":{"name":"","pan":0,"pitch":100,"volume":90},"bgs":{"name":"","pan":0,"pitch":100,"volume":90},"disableDashing":false,"displayName":"","encounterList":[],"encounterStep":30,"height":13,"note":"","parallaxLoopX":false,"parallaxLoopY":false,"parallaxName":"","parallaxShow":true,"parallaxSx":0,"parallaxSy":0,"scrollType":0,"specifyBattleback":false,"tilesetId":1,"width":17,
  3. "data":[2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,2816,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
  4. "events":[
  5. null,
  6. {"id":1,"name":"EV001","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":false,"image":{"tileId":0,"characterName":"Actor1","direction":8,"pattern":1,"characterIndex":1},"list":[{"code":108,"indent":0,"parameters":["--判断是否接受了该委托--"]},{"code":355,"indent":0,"parameters":["//使用$gameParty.hasQuest(quest_id)判断"]},{"code":655,"indent":0,"parameters":["if(!($gameParty.hasQuest(1))){"]},{"code":655,"indent":0,"parameters":["    //如果没有,则设置临时变量的数值"]},{"code":655,"indent":0,"parameters":["    $gameVariables.setValue(1, 1);"]},{"code":655,"indent":0,"parameters":["}else{"]},{"code":655,"indent":0,"parameters":["    if($gameQuests.get(1).currentStep === 1){"]},{"code":655,"indent":0,"parameters":["        $gameMessage.setFaceImage('Actor1',1);"]},{"code":655,"indent":0,"parameters":["        $gameMessage.add(\"【勇者】\\n完成任务!\");"]},{"code":655,"indent":0,"parameters":["        $gameVariables.setValue(1, 3);"]},{"code":655,"indent":0,"parameters":["    }else{"]},{"code":655,"indent":0,"parameters":["        $gameVariables.setValue(1, 4);}"]},{"code":655,"indent":0,"parameters":["}"]},{"code":111,"indent":0,"parameters":[1,1,0,1,0]},{"code":101,"indent":1,"parameters":["Actor1",1,0,2]},{"code":401,"indent":1,"parameters":["【勇者】"]},{"code":401,"indent":1,"parameters":["你好,少年,来接受委托吧!"]},{"code":101,"indent":1,"parameters":["Actor1",0,0,2]},{"code":401,"indent":1,"parameters":["【霍尔德】"]},{"code":401,"indent":1,"parameters":["好!"]},{"code":356,"indent":1,"parameters":["Quest Add 1"]},{"code":0,"indent":1,"parameters":[]},{"code":411,"indent":0,"parameters":[]},{"code":111,"indent":1,"parameters":[1,1,0,3,0]},{"code":356,"indent":2,"parameters":["Quest Complete 1"]},{"code":0,"indent":2,"parameters":[]},{"code":411,"indent":1,"parameters":[]},{"code":111,"indent":2,"parameters":[1,1,0,4,0]},{"code":101,"indent":3,"parameters":["Actor1",1,0,2]},{"code":401,"indent":3,"parameters":["【勇者】"]},{"code":401,"indent":3,"parameters":["快去吧!"]},{"code":0,"indent":3,"parameters":[]},{"code":412,"indent":2,"parameters":[]},{"code":0,"indent":2,"parameters":[]},{"code":412,"indent":1,"parameters":[]},{"code":0,"indent":1,"parameters":[]},{"code":412,"indent":0,"parameters":[]},{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":1,"stepAnime":false,"through":false,"trigger":0,"walkAnime":true}],"x":8,"y":8},
  7. {"id":2,"name":"EV002","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":false,"image":{"tileId":0,"characterName":"Actor3","direction":2,"pattern":1,"characterIndex":0},"list":[{"code":101,"indent":0,"parameters":["Actor3",0,0,2]},{"code":401,"indent":0,"parameters":["【将军】"]},{"code":401,"indent":0,"parameters":["你好。"]},{"code":108,"indent":0,"parameters":["--判断是否接受了该委托--"]},{"code":355,"indent":0,"parameters":["//使用$gameParty.hasQuest(quest_id)判断"]},{"code":655,"indent":0,"parameters":["if(!($gameParty.hasQuest(1) || ($gameQuests.get(1).status === \"progress\" && $gameQuests.get(1).currentStep === 1))){"]},{"code":655,"indent":0,"parameters":["    //如果没有,则这里直接用脚本对话。"]},{"code":655,"indent":0,"parameters":["    $gameMessage.setFaceImage('Actor3',0);"]},{"code":655,"indent":0,"parameters":["    $gameMessage.add(\"【将军】\\n没什么事情就不要来找我!\");"]},{"code":655,"indent":0,"parameters":["}else{//否则,判定获取步骤"]},{"code":655,"indent":0,"parameters":["    if($gameQuests.get(1).currentStep == 0){"]},{"code":655,"indent":0,"parameters":["        $gameMessage.setFaceImage('Actor3',0);"]},{"code":655,"indent":0,"parameters":["        $gameMessage.add(\"【将军】\\n你回去汇报,不用找我了。\");"]},{"code":655,"indent":0,"parameters":["        $gameVariables.setValue(1, 2);"]},{"code":655,"indent":0,"parameters":["    }"]},{"code":655,"indent":0,"parameters":["}"]},{"code":111,"indent":0,"parameters":[1,1,0,2,0]},{"code":356,"indent":1,"parameters":["Quest NextStep 1"]},{"code":0,"indent":1,"parameters":[]},{"code":412,"indent":0,"parameters":[]},{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":1,"stepAnime":false,"through":false,"trigger":0,"walkAnime":true}],"x":8,"y":4}
  8. ]
  9. }



====我的GameQuestSystem是我自己修改过的,在主菜单直接添加了任务选项,所以地图上没有打开任务界面的事件====

屏幕截图 2023-06-30 192907.png (487.58 KB, 下载次数: 115)

屏幕截图 2023-06-30 192907.png

屏幕截图 2023-06-30 192916.png (504 KB, 下载次数: 144)

屏幕截图 2023-06-30 192916.png

屏幕截图 2023-06-30 192927.png (104.45 KB, 下载次数: 119)

屏幕截图 2023-06-30 192927.png

作者: 云端城主    时间: 2023-7-1 15:17
天下无尽 发表于 2023-6-30 18:58
啊这,本人只是一个初中生,出于学业方面很多东西受限,还是直接发截图吧,貌似没有办法可以直接发一整个 ...

链接:https://pan.baidu.com/s/1dws1gykxmYsjXibaK5unJA?pwd=ydo1
提取码:ydo1

下这个只有2MB容量。你弄好了再传百度盘就好了。
作者: 天下无尽    时间: 2023-7-1 17:21
云端城主 发表于 2023-7-1 15:17
链接:https://pan.baidu.com/s/1dws1gykxmYsjXibaK5unJA?pwd=ydo1
提取码:ydo1

真的是有限制......真的是有一些原因,而且最近百度网页端登不上账号,如果要下的话麻烦在外面套一个文件夹,这样就可以直接用exe下,而不是网页端了,谢谢。
作者: 天下无尽    时间: 2023-7-3 10:41
云端城主 发表于 2023-7-1 15:17
链接:https://pan.baidu.com/s/1dws1gykxmYsjXibaK5unJA?pwd=ydo1
提取码:ydo1

而且本人是真的没有办法传百度网盘......
可以直接把我之前的帖子发的文件下载,然后粘贴到“data”文件夹里,打开工程就可以看到了。
作者: 清澈淌漾    时间: 2023-7-3 12:30
给你个解决方案 把所有代码加注释扔给GPT 问
怎么用xxxx
作者: 天下无尽    时间: 2023-7-5 10:01
清澈淌漾 发表于 2023-7-3 12:30
给你个解决方案 把所有代码加注释扔给GPT 问
怎么用xxxx

建议不要,我试过让GPT帮我写一个“RMMV内在主菜单添加读档选项”的插件,它写了几次,都没有用




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1