赞 | 26 |
VIP | 0 |
好人卡 | 0 |
积分 | 29 |
经验 | 0 |
最后登录 | 2024-7-12 |
在线时间 | 446 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 2866
- 在线时间
- 446 小时
- 注册时间
- 2016-9-26
- 帖子
- 1223
|
500星屑
事情是这样的:我发现,我利用以下类似脚本,作为属性增减药剂更改角色的属性时,当时都可以调整,可是,
当我存档并关掉游戏,再重新读取后,这些属性的增减就变回了一开始的没更改前的值(我猜测是存档没有把它们存档进去,所以,要修改存档的相关脚本吗?该怎么改?),
所以,诸位大佬有没有什么好的办法(这个问题很重要很重要!)
◆脚本:var hit=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 22 && traits[i].dataId == 0) hit += traits[i].value};console.log(hit);var cri=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 22 && traits[i].dataId == 2) cri += traits[i].value};console.log(cri);var eva=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 22 && traits[i].dataId == 1) eva += traits[i].value};console.log(eva);var mev=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 22 && traits[i].dataId == 4) mev += traits[i].value};console.log(mev);var cnt=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 22 && traits[i].dataId == 6) cnt += traits[i].value};console.log(cnt);var mrf=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 22 && traits[i].dataId == 5) mrf += traits[i].value};console.log(mrf);var hrg=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 22 && traits[i].dataId == 7) hrg += traits[i].value};console.log(hrg);var mrg=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 22 && traits[i].dataId == 8) mrg += traits[i].value};console.log(mrg);var rec=1;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 23 && traits[i].dataId == 2) rec *= traits[i].value};console.log(rec);var pha=1;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 23 && traits[i].dataId == 3) pha *= traits[i].value};console.log(pha);var pgcs=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 34 && traits[i].dataId == 0) pgcs += traits[i].value};console.log(pgcs);var xdcs=0;traits=$dataActors[$gameParty._targetActorId].traits;for (var i = 0; i < traits.length; i++) {if (traits[i].code == 61 && traits[i].dataId == 0) xdcs += traits[i].value};console.log(xdcs);
: :hit+=0;cri+=0;eva+=0;mev+=-0.001;
: :cnt+=0;mrf+=0;hrg+=0;mrg+=0;
: :rec+=0;pha+=0;
: :pgcs+=0;
: :xdcs+=0;
: :$dataActors[$gameParty._targetActorId].traits=[{"code":22,"dataId":0,"value":hit},{"code":22,"dataId":2,"value":cri},{"code":22,"dataId":1,"value":eva},{"code":22,"dataId":4,"value":mev},{"code":22,"dataId":6,"value":cnt},{"code":22,"dataId":5,"value":mrf},{"code":22,"dataId":7,"value":hrg},{"code":22,"dataId":8,"value":mrg},{"code":23,"dataId":2,"value":rec},{"code":23,"dataId":3,"value":pha},{"code":34,"dataId":0,"value":pgcs},{"code":61,"dataId":0,"value":xdcs}]; |
最佳答案
查看完整内容
最近在写能力值加点 其实已经知道的是$gameActor是没有有追加和特殊能力值的只有$dataActor才有
$gameActor是能保存而$dataActor不会保存只能读取数据库的资料
我的做法是在$gameActor新增一个对应的数组
我在Game_Actor新建了能力值,追加能力值和特殊能力值对应的数组
Game_Actor_setup_UpgradeParams = Game_Actor.prototype.setup;
Game_Actor.prototype.setup = function (actorId) {
this._actorParam=[0,0,0,0,0,0, ...
|