代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。

原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html


 1
 2三五二.死亡自动读档(死亡不删档)
 3
 4	MT管理器打开游戏目录/assets/DLC0002/scripts/gamelogic.lua文件,将下列内容:
 5
 6		local playtime = GetTimePlaying()
 7		playtime = math.floor(playtime*1000)
 8		SetTimingStat("time", "scenario", playtime)
 9		SendTrackingStats()
10		local days_survived, start_xp, reward_xp, new_xp, capped = CalculatePlayerRewards(wilson)
11		
12		ProfileStatsSet("xp_gain", reward_xp)
13		ProfileStatsSet("xp_total", new_xp)
14		SubmitCompletedLevel() --close off the instance
15
16		wilson.components.health.invincible = true
17
18		wilson.profile:Save(function()
19			SaveGameIndex:EraseCurrent(function() 
20					scheduler:ExecuteInTime(3, function() 
21						TheFrontEnd:PushScreen(DeathScreen(days_survived, start_xp, nil, capped))
22					end)
23				end)
24			end)
25
26	替换为:
27
28	   StartNextInstance({reset_action=RESET_ACTION.LOAD_SLOT, save_slot = SaveGameIndex:GetCurrentSaveSlot()}, true)
29
30	即可死亡自动读档,死后游戏会卡一会儿,不要动,是在读档