rientelfon Posted October 10, 2021 Share Posted October 10, 2021 Hey everyone, I am extremely new to modding and I have been successfully doing a few things here and there utilizing tutorials and other things I have managed to find online. However, I am confused on how taking pills works, looking at the item properties for pain killers I notice there is no "PainReduce=X" property. How does this aspect work? I am also curious on how to add new type of actions to the context menu when looking at your health from the UI. I have added the PainKiller Item info below: item Pills { Weight = 0.2, Type = Drainable, UseDelta = 0.1, UseWhileEquipped = FALSE, DisplayName = Painkillers, Icon = PillsPainkiller, Tooltip = Tooltip_Painkillers, } Any help on how all this works would definitely be appreciated! Link to comment Share on other sites More sharing options...
rientelfon Posted October 10, 2021 Author Share Posted October 10, 2021 (edited) So I have learned there is an event that is JustTookPill, and this appears to be in the base BodyDamage.class meaning there is no real way to simulate this same type of action. However, is there any way I can add a custom tooltip? I heard something about a Translate File and have added one that has the following info, but it does not appear to be working. Translate File: Tooltip_EN = { Tooltip_zombieCure = "This will cure you of a zombie infection... or so it appears." } Script File: module ZombieCure{ imports { Base } item ZombieCurePill { Weight = 0.1, Type = Food, UseWhileEquipped = FALSE, ReduceInfectionPower = 50, CustomContextMenu = Take, CantBeFrozen = TRUE, OnEat = zombieInfectionRemove, Tooltip = Tooltip_zombieCure, DisplayName = Zombie Cure } Any help is definitely appreciated! Edited October 10, 2021 by rientelfon Link to comment Share on other sites More sharing options...
rientelfon Posted October 10, 2021 Author Share Posted October 10, 2021 I actually figured this one out on my own, and decided to post the answer here in case anyone else has the same issue. Essentially name your Translate file Tooltip_EN.txt and place it in the following location: <modname>/media/lua/shared/Translate/EN. This fixed my issue! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now