Jump to content

Recommended Posts

Hello ... I would like to create a custom object just for my character that regenerates the sanity of the user for a while (similar to Soothing Tea but that works as an Ointment and not as food)
I also wanted my character to be able to create an item that allows him to repair armor.
If you could help me I would be very grateful. Since I do not know anything about programming. Thank you in advance

If you want to do these things, you will need to learn programming lua as the armor repairing is not simple as adding 1 or 2 lines to your mod. But you should learn lua if you want to mod, as you can't expect someone to make your mod for you. 

Start with the newcomer Intro and Tutorial Collection and go on from there. 

You will find good starting points and from there on it will get easier :) I'm pretty sure that there should be posts like these here already, try to google and find them or look for mods that do exactly what you are asking and see how they are doing it. But most importantly you should try to understand what you're doing so that it makes it also easier for you :)

Thank you very much ... the truth is, as I am bad understanding this about modifications, I thought it would be easy ... I mean to use the sewing kit item and only configure that it repairs but ... asking and looking for mods to know how they did it, I got stuck. ..that's why I asked for help T_T but what I thought would be easy is very complicated ... I will try to start with something easier .. so I will practice and improve

Leí el enlace que dejaste ... pero me gustaría preguntar algo ... existe la posibilidad de hacer que la flauta de pan solo emita sonido ... quiero decir, no duerme nadie ni las turbas ... pero si funciona para hablar o charlar con las plantas ... perdón por molestarme con cosas así T_T

 

local function HearPanFlute(inst, musician, instrument)
    if inst ~= musician and
        (TheNet:GetPVPEnabled() or not inst:HasTag("player")) and
        not (inst.components.freezable ~= nil and inst.components.freezable:IsFrozen()) and
        not (inst.components.pinnable ~= nil and inst.components.pinnable:IsStuck()) and
        not (inst.components.fossilizable ~= nil and inst.components.fossilizable:IsFossilized()) then
        local mount = inst.components.rider ~= nil and inst.components.rider:GetMount() or nil
        if mount ~= nil then
            mount:PushEvent("ridersleep", { sleepiness = 10, sleeptime = TUNING.PANFLUTE_SLEEPTIME })
        end
        if inst.components.farmplanttendable ~= nil then
            inst.components.farmplanttendable:TendTo(musician)
        elseif inst.components.sleeper ~= nil then
            inst.components.sleeper:AddSleepiness(10, TUNING.PANFLUTE_SLEEPTIME)
        elseif inst.components.grogginess ~= nil then
            inst.components.grogginess:AddGrogginess(10, TUNING.PANFLUTE_SLEEPTIME)
        else
            inst:PushEvent("knockedout")
        end
    end
end

ese es el codigo ... que pienso que tiene la funcion de la flauta no

Edited by KyE039

Yes it's probably better to start with something easier, as what you want to do it a bit more qcomplicated :)

From what I could gather from google translate and my poor spanish skills, you want the pan flute to only speak to plants?

You can just add a AddPrefabPostInit to the panflute where you override inst.components.instrument:SetOnHeardFn and enter your function that only tends/speaks to plants.

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...