查看: 4988|回复: 3

[已经解决] 如何让插件的变量可以被保存到存档

[复制链接]
梦石
0
星屑
1353
在线时间
412 小时
注册时间
2011-6-10
回帖
26
发表于 2016-1-10 22:45:54 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

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

×
除了直接扔进游戏预设的变量以外还有别的方法吗?
梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2016-1-11 00:47:14 | 显示全部楼层
[pre lang="javascript"]//生成保存目录
DataManager.makeSaveContents = function() {
    // A save data does not contain $gameTemp, $gameMessage, and $gameTroop.
    var contents = {};
    contents.system       = $gameSystem;
    contents.screen       = $gameScreen;
    contents.timer        = $gameTimer;
    contents.switches     = $gameSwitches;
    contents.variables    = $gameVariables;
    contents.selfSwitches = $gameSelfSwitches;
    contents.actors       = $gameActors;
    contents.party        = $gameParty;
    contents.map          = $gameMap;
    contents.player       = $gamePlayer;
//在这里添加上需要保存发变量
    return contents;
};
//提取保存目录
DataManager.extractSaveContents = function(contents) {
    $gameSystem        = contents.system;
    $gameScreen        = contents.screen;
    $gameTimer         = contents.timer;
    $gameSwitches      = contents.switches;
    $gameVariables     = contents.variables;
    $gameSelfSwitches  = contents.selfSwitches;
    $gameActors        = contents.actors;
    $gameParty         = contents.party;
    $gameMap           = contents.map;
    $gamePlayer        = contents.player;
//在这里添加需要读取的变量
};[/pre]
(其实扔进预设变量也挺好的)
回复

使用道具 举报

…あたしは天

梦石
0
星屑
2308
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2016-1-11 11:21:52 | 显示全部楼层
扔进 $gameSystem $gameParty 之类的
回复

使用道具 举报

梦石
0
星屑
60
在线时间
306 小时
注册时间
2014-8-5
回帖
403
发表于 2016-1-11 18:16:17 | 显示全部楼层
本帖最后由 夏末渐离 于 2016-3-4 13:10 编辑

https://rpg.blue/home.php?mod=sp ... ward=1&id=14918

点评

也是呢0x0  发表于 2016-1-11 21:53
存到存档里一般不是用全局存档的吧^  发表于 2016-1-11 21:05
  点我进入    
       ↓      
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部