代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
一四五.白天也能睡帐篷,睡帐篷不减饥饿
用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/tent.lua文件,
1.删除下列内容:
if GetClock():IsDay() then
local tosay = "ANNOUNCE_NODAYSLEEP"
if GetWorld():IsCave() then
tosay = "ANNOUNCE_NODAYSLEEP_CAVE"
end
if sleeper.components.talker then
sleeper.components.talker:Say(GetString(inst.prefab, tosay))
return
end
end
2.删除下列内容:
if GetClock():IsDay() then
local tosay = "ANNOUNCE_NODAYSLEEP"
if GetWorld():IsCave() then
tosay = "ANNOUNCE_NODAYSLEEP_CAVE"
end
if sleeper.components.talker then
sleeper.components.talker:Say(GetString(inst.prefab, tosay))
sleeper.components.health:SetInvincible(false)
sleeper.components.playercontroller:Enable(true)
return
end
end
3.将sleeper.components.hunger:DoDelta(-TUNING.CALORIES_HUGE, false, true)替换为--sleeper.components.hunger:DoDelta(-TUNING.CALORIES_HUGE, false, true)
即可白天也能睡帐篷,睡帐篷不减饥饿