The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

评价数不足
Save data template
   
奖励
收藏
已收藏
取消收藏
Tags: Lua
文件大小
发表于
更新日期
5.283 KB
2017 年 4 月 6 日 上午 9:01
2017 年 4 月 9 日 上午 7:29
3 项改动说明 ( 查看 )

订阅以下载
Save data template

描述
Save data template.

Smack it inside your mod's main.lua for easier save handling. It uses the `rundata` table to save and load data using the json library. Be sure to key your tables (table = {[0]=0}) to prevent various issues when saving.

Example codes:
function mod:post_update() rundata.coins = player:GetNumCoins() end mod:AddCallback(ModCallbacks.MC_POST_UPDATE, mod.post_update)

function mod:post_render() if Input.IsButtonTriggered(Keyboard.KEY_T,player.ControllerIndex) then Isaac.DebugString("Saving data...") saveData(rundata) Isaac.DebugString("Data saved!") end end mod:AddCallback(ModCallbacks.MC_POST_RENDER,mod.post_render)
1 条留言
Erfly 2017 年 4 月 6 日 上午 9:10 
Looks like a very handy little template!