The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

Not enough ratings
Save data template
   
Award
Favorite
Favorited
Unfavorite
Tags: Lua
File Size
Posted
Updated
5.283 KB
6 Apr, 2017 @ 9:01am
9 Apr, 2017 @ 7:29am
3 Change Notes ( view )

Subscribe to download
Save data template

Description
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 Comments
Erfly 6 Apr, 2017 @ 9:10am 
Looks like a very handy little template!