饥荒
274 个评价
Beefalo Info (驯牛信息)
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
16.284 KB
2019 年 1 月 16 日 上午 12:24
2019 年 1 月 16 日 上午 7:02
2 项改动说明 ( 查看 )

订阅以下载
Beefalo Info (驯牛信息)

描述
Shows Beefalo info (hunger,obedience,tamed).

显示驯牛信息,饥饿,顺从度,驯服度
36 条留言
Kuhrosh 4 月 7 日 上午 9:13 
Sorry max 1000 char messed the comment up. Here is an image of the code which will be a lot easier to read. https://imgur.com/gRCgHw2
Kuhrosh 4 月 7 日 上午 9:12 
-- Health
if inst.components.health then
local current_health = inst.components.health.currenthealth
local max_health = inst.components.health.maxhealth
str = str .. "\n Health: " .. round2(current_health, 0) .. "/" .. round2(max_health, 0)
end

-- Attack
if inst.components.combat then
local attack_damage = inst.components.combat.defaultdamage
str = str .. "\n Attack: " .. round2(attack_damage, 0) .. "\n "
end
end
Kuhrosh 4 月 7 日 上午 9:12 
Here is my code..

if inst.components.domesticatable ~= nil and inst.components.domesticatable.domestication > 0 and inst.prefab == "beefalo" then
-- Hunger
if inst.components.hunger then
local val = inst.components.hunger:GetPercent()
str = str .. "\n " .. label.hunger .. ": " .. round2(inst.components.hunger.current, 0)
end

-- Obedience
if inst.components.domesticatable.GetObedience ~= nil then
local obedience = inst.components.domesticatable:GetObedience()
str = str .. " / ".. label.obedience .. ": " .. round2(obedience * 100, 0) .. "%"
end

-- Tamed
if inst.components.domesticatable.GetDomestication ~= nil then
local domest = inst.components.domesticatable:GetDomestication()
str = str .. " / " .. label.tamed .. ": " .. round2(domest * 100, 0) .. "%"
end
Kuhrosh 4 月 7 日 上午 9:11 
Hi everyone, for those who want to add Health and Attack dmg to the info on this I fixed it but you will need to copy and paste this code into the modmain.lua file of this mod.

Find the files for DS like this.. right-click on DS in steam > manage > browse local files

Once you find the the file modmain.lua open it (I did so in VSCode) and in the function showInfo replace the if statement with hunger, obedience, and tamed with my code. That is line 55 -> 72

You can see below Health and Attack is added. And at the end of attack .. "\n " this just add white space under it so it isn't all jammed together.

Hope this helps. :) Here is an image of my character after I confirmed it worked. https://imgur.com/a/FVtFdoe
凤九歌 2 月 11 日 上午 11:37 
如何改成中文啊?我这边显示它是英文的
hyp 2024 年 10 月 26 日 下午 3:22 
mine doesnt show attack or health
八刀斷魂 2021 年 8 月 11 日 上午 12:02 
正常使用喔 2021/8/11 in ROG
回樓下1499647809 你要不改成英文版本
1499647809 2021 年 8 月 10 日 下午 7:31 
根本用不了
Lerix 2021 年 1 月 24 日 上午 7:05 
still worky? :beatmeat:
我滋你3点甲你会生气吗 2019 年 3 月 30 日 下午 10:52 
tamed满了还是会把鞍甩下来