Don't Starve Together

Don't Starve Together

Show Me (Origin)
 This topic has been pinned, so it's probably important
star  [developer] 1 Feb, 2017 @ 7:05am
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.
Last edited by star; 24 Feb, 2017 @ 11:15am
< >
Showing 1-3 of 3 comments
star  [developer] 2 Feb, 2017 @ 9:05am 
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).
Last edited by star; 2 Feb, 2017 @ 9:19am
star  [developer] 2 Feb, 2017 @ 9:05am 
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
Last edited by star; 14 Mar, 2017 @ 7:04am
五年 9 Dec, 2020 @ 11:42pm 
please add the param "viewer" into the function GetShowItemInfo, sometimes we need show diff info to diff players
< >
Showing 1-3 of 3 comments
Per page: 1530 50