代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
三五二.死亡自动读档(死亡不删档)
用MT管理器打开游戏目录/assets/DLC0002/scripts/gamelogic.lua文件,将下列内容:
local playtime = GetTimePlaying()
playtime = math.floor(playtime*1000)
SetTimingStat("time", "scenario", playtime)
SendTrackingStats()
local days_survived, start_xp, reward_xp, new_xp, capped = CalculatePlayerRewards(wilson)
ProfileStatsSet("xp_gain", reward_xp)
ProfileStatsSet("xp_total", new_xp)
SubmitCompletedLevel() --close off the instance
wilson.components.health.invincible = true
wilson.profile:Save(function()
SaveGameIndex:EraseCurrent(function()
scheduler:ExecuteInTime(3, function()
TheFrontEnd:PushScreen(DeathScreen(days_survived, start_xp, nil, capped))
end)
end)
end)
替换为:
StartNextInstance({reset_action=RESET_ACTION.LOAD_SLOT, save_slot = SaveGameIndex:GetCurrentSaveSlot()}, true)
即可死亡自动读档,死后游戏会卡一会儿,不要动,是在读档