Mod:
Using a mop ask for container to put liquid.
Malus: Possible need of filter to make “impure” liquid usable again.
Work in food liquid only with clean items, like a towel or brand new mop, you dont use the same mop in oil and diesel
Malus: Possible need boil before consume.
Sorry my english. I m not skilled to made mod myself.
Work in a school mooping floors, know about “picking liquid”
Zhilkin
February 3, 2018, 11:01pm
2
Probably possible with lua.
That LUA thing is everywhere, I only learn “Basic” and that’s was like 28 years ago, don’t remember much.
Mop item received two new item functions:
Allows to pickup spilled liquids in 1 tile radius around player;
Allows to pickup spilled liquids in nearest tile adjacent to player in selected direction.
2 Likes
WOW!
Thanks!
Dont know what else to say, that was incredible fast and perfect.
It is not perfect - picked liquids are not put in container, so they will be dropped when player moves.
Kedrak
February 4, 2018, 6:28pm
10
So maybe the liquids can be unloaded into a container…
Zhilkin
February 4, 2018, 8:43pm
11
Yes, it is possible to ask for a container from player inventory while mopping, but I’m too lazy to add this functionality right now.
You can look how to work with containers in LUA here and update the mod:
local p = {}
p.init = function()
return p
end
function p.add_item(item_id, item_quantity, container_id)
if (item_quantity > 0) then
item_quantity = math.floor(item_quantity)
local LIQUID = enums.phase_id["LIQUID"]
local item_ref = item(item_id, 1)
local item_type = item_ref.type
local item_type_phase = item_type.phase
local item_default_container_id = item_type.default_container
This file has been truncated. show original
Zhilkin
August 17, 2018, 10:44pm
13
There is an error in the code on line 51 of preload.lua
:
instead of:
if( #Mop_MenuEntries > 1 ) then
should be:
if( #Mop_MenuEntries >= 1 ) then
stk2008
August 17, 2018, 10:55pm
14
oh wow you dont know how greatful i am I spent 2hrs looking at this LOL (i have zero code skills) gonna do this now thank you so much).
Yep just did as was told and all is perfect YAY thank you :).