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

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


 1
 2一四五.白天也能睡帐篷,睡帐篷不减饥饿
 3
 4	MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/tent.lua文件
 5
 6	1.删除下列内容:
 7
 8	if GetClock():IsDay() then
 9		local tosay = "ANNOUNCE_NODAYSLEEP"
10		if GetWorld():IsCave() then
11			tosay = "ANNOUNCE_NODAYSLEEP_CAVE"
12		end
13		if sleeper.components.talker then
14			sleeper.components.talker:Say(GetString(inst.prefab, tosay))
15			return
16		end
17	end
18
19
20	2.删除下列内容:
21
22		if GetClock():IsDay() then
23
24			local tosay = "ANNOUNCE_NODAYSLEEP"
25			if GetWorld():IsCave() then
26				tosay = "ANNOUNCE_NODAYSLEEP_CAVE"
27			end
28
29			if sleeper.components.talker then				
30				sleeper.components.talker:Say(GetString(inst.prefab, tosay))
31				sleeper.components.health:SetInvincible(false)
32				sleeper.components.playercontroller:Enable(true)
33				return
34			end
35		end
36
37
38	3.sleeper.components.hunger:DoDelta(-TUNING.CALORIES_HUGE, false, true)替换为--sleeper.components.hunger:DoDelta(-TUNING.CALORIES_HUGE, false, true)
39
40	即可白天也能睡帐篷,睡帐篷不减饥饿