Project Zomboid

Project Zomboid

Not enough ratings
Simple Drink Hotkey
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
14.989 KB
Aug 22, 2023 @ 4:26am
1 Change Note ( view )

Subscribe to download
Simple Drink Hotkey

Description
Adds a Drink hotkey under Options -> Key Bindings.
Action animates the same as Drink from right-click menu

You can turn autodrink off or use it the same time, but hold your water in backpack and drink it manually with new hotkey


1. Script searches all containers on players started with main inventory recursively.
2. Script prefers Favorite water source over unfavorite one (but if favorite water is in a backpack but unfavorite is in a main inventory then script will select a one from main inventory)
3. Script remembers last used water source (resets on load) and will try to drink from it even it was put somewhere in a backpack or something (it also remembers if player uses right-click Drink option on a water)
4. Player will put water source container back where he took it (so to reduce weight you can initially put your water into backpack)
5. Script checks if water is tainted but only if the game option to show tainted icon is active.
6. If there is no drinkable water containers on player then player will say about it
7. Player will say about last sip from water container on it's depletion
8. Drink hotkey works stated with 1% thirst (a vanilla right click menu shows Drink option only at 10%)


Script uses the vanilla ISInventoryPaneContextMenu.onDrinkForThirst() function to improve compatibility

My other mods:


Workshop ID: 3024063146
Mod ID: SimpleDrinkHotkey
5 Comments
UnCheat  [author] Oct 20, 2023 @ 4:06pm 
Thanks brother! Спасибо братан :)
Васька Хроник Oct 20, 2023 @ 3:46pm 
Perfect:steamhappy:
UnCheat  [author] Oct 3, 2023 @ 10:07am 
This only happens when a key is pressed
Ortus Oct 3, 2023 @ 12:32am 
I didn't know I needed a mod like this until I saw it. Thank you!

Question: with this mod, when automatically drinking, will the character take water even from the backpack, or will this only happen when a key is pressed?
AlejoOo Aug 22, 2023 @ 8:53am 
Muchas gracias :spiffo: