饥荒联机版

饥荒联机版

Show Me (Origin)
 此主题已被置顶,因此可能具有重要性
star  [开发者] 2017 年 2 月 1 日 上午 7:05
API for modders
Custom info
inst.GetShowItemInfo = function(inst) return "Custom Info: hi!!!", "Custom info2: hi???", "well well well" end
Any author of a mod may add this code to any prefab.
This code will add these lines to item info on mouse over.

Example 1
AddPrefabPostInit("flint",function(inst) inst.GetShowItemInfo = function(inst) return "Hello" end end)
Note: your mod may be "server only". It does not matter if this function exists on client side.
最后由 star 编辑于; 2017 年 2 月 24 日 上午 11:15
< >
正在显示第 1 - 3 条,共 3 条留言
star  [开发者] 2017 年 2 月 2 日 上午 9:05 
Custom diet for custom character
ShowMe mod automatically picks the diet of the character. Really, modder shouldn't do anything if diet is simple (using groups). Example:
inst.components.eater:SetDiet({FOODGROUP.OMNI}, {FOODTYPE.MEAT, FOODTYPE.GOODIES})

But some characters have very special diet. For example, +10 sanity on eating any meat. Probably you want ShowMe mod to show this info too. And you could help a bit to show this info. For doing this, declare the function FoodValuesChanger and attach it to your character.
inst.FoodValuesChanger = function(player, food) local e = food.components.edible return e.healthvalue, e.hungervalue, (e.sanityvalue + 10) end
This function should return changed stats of the food. But this function shouldn't change the food. You can use this function in your mod too (in oneat event).
最后由 star 编辑于; 2017 年 2 月 2 日 上午 9:19
star  [开发者] 2017 年 2 月 2 日 上午 9:05 
Custom chests support
If you made a new custom chest, you want ShowMe to support this chest, don't you? By default ShowMe supports only game treasure chests.

To do this, just add prefab of your chest to TUNING.MONITOR_CHESTS:
TUNING.MONITOR_CHESTS = TUNING.MONITOR_CHESTS or {} TUNING.MONITOR_CHESTS.my_chest_prefab_name = true

Note: You should do this on client AND on the server, i.e. your mod should be "all clients require mod".
Note 2: Your mod should have lower priority than mine. Priority of this mod = 0.00666155465
最后由 star 编辑于; 2017 年 3 月 14 日 上午 7:04
五年 2020 年 12 月 9 日 下午 11:42 
please add the param "viewer" into the function GetShowItemInfo, sometimes we need show diff info to diff players
< >
正在显示第 1 - 3 条,共 3 条留言
每页显示数: 1530 50