Jump to content

Recommended Posts

3 hours ago, amazingGob said:

I want to add a perk for my character where they can water the farm soil just by standing on it, i'm not sure where to start

-- modmain.lua
GLOBAL.AddWater = function()
    local vec = GLOBAL.ThePlayer:GetPosition()
  	local moisture_value = 50
    GLOBAL.TheWorld.components.farming_manager:AddSoilMoistureAtPoint(vec.x, vec.y, vec.z, moisture_value)
end

I had a hard time finding it. That code makes the land you're standing on water once. You don't need to set it to GLOBAL, but you can test it by calling AddWater() in the console.

  • Like 1
On 9/26/2025 at 4:14 AM, FerniFrenito said:
-- modmain.lua
GLOBAL.AddWater = function()
    local vec = GLOBAL.ThePlayer:GetPosition()
  	local moisture_value = 50
    GLOBAL.TheWorld.components.farming_manager:AddSoilMoistureAtPoint(vec.x, vec.y, vec.z, moisture_value)
end

I had a hard time finding it. That code makes the land you're standing on water once. You don't need to set it to GLOBAL, but you can test it by calling AddWater() in the console.

thank you! it works perfectly !!

  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...