Can someone tell what I am doing wrong? I have this script
import services
import sims4.commands
from sims.household_utilities.utility_types import UtilityShutoffReasonPriority, Utilities
@sims4.commands.Command('poweron', command_type=sims4.commands.CommandType.Live)
def offgridelectro(_connection=None):
household_id = services.owning_household_id_of_active_lot()
utilities_manager = services.utilities_manager(household_id)
utilities_manager.shut_off_utility(Utilities.POWER, UtilityShutoffReasonPriority.OFF_THE_GRID, tooltip="Power doesn't work off-the-grid")
This shutoffs the power, but it doesn't add the tooltip, and The interactions are not there. What I am doing wrong?
Heres how I want it to look:
Heres how mine looks:
Comments
You can't provide a tooltip as a string, the game can't process that. The tooltip most likely has to be an Int or a LocalizedString.
Any test that returns a tooltip will be displayed with a tooltip, but when the tooltip is missing, the interactions will just disappear.
Ok so I got the key from the string table and converted it from hex to decimal and used that, but that still did not work, so it probably has to be a LocalizedString, the problem is I have no idea what a localizedstring is, this is my first sims 4 script mod, and the info on the internet is kinda scarce, Could you elaborate some more on that?
ps: I also tried just putting it as hex, still nothing
utilities_manager.shut_off_utility(Utilities.POWER, UtilityShutoffReasonPriority.OFF_THE_GRID, tooltip=0x67B66DF3)
Ok so I found this function inside someone else's script mod and tried to use it inside my mod, but I get a "TypeError: 'LocalizedString' object is not callable" error, so I am pretty much out of ideas now
Thank you so much, everything works fine now