Jump to content

Wortox teleportation & eat without disadvantages


Recommended Posts

Hello again :) , i got another few questions.
At first, I want my character to be able to eat mushrooms without any disadvantages. I tried to use code from Webber, but I just found something like "strongstomach", but this doesn't help me.

Furthermore I want to add teleportation like the teleportation of Wortox to my character. I copied some code from Wortox to my characters code, so I am able to teleport now, but there is a problem... if I drop a soul it will heal me and I dont know how to change this.
This is the code I've added to my character: 
 

local function GetPointSpecialActions(inst, pos, useitem, right)
    if right and useitem == nil and inst.replica.inventory:Has("wortox_soul", 1) then
        local rider = inst.replica.rider
        if rider == nil or not rider:IsRiding() then
            return { ACTIONS.BLINK }
        end
    end
    return {}
end

local function OnSetOwner(inst)
    if inst.components.playeractionpicker ~= nil then
        inst.components.playeractionpicker.pointspecialactionsfn = GetPointSpecialActions
    end
end

-- In master_postinit:
	inst:AddTag("soulstealer")						
	inst:ListenForEvent("setowner", OnSetOwner)		
	inst._checksoulstask = nil

I want to add a soul as non-consumable startitem, so it is a startitem right now, but if I use it, it will disappear.
Thank you for your help :) 

Link to comment
Share on other sites

"strongstomach" only affects "monstermeat" as far as I can see on the code. Take a look at my new Fun With Food tutorial, specifically the part about "Removing ONLY Negative Stat Effects From Certain Foods (CHARACTER)".

I don't think I can help with the soul-dropping thing. Have you tried simply removing the line

inst:AddTag("soulstealer")	

?

Link to comment
Share on other sites

18 hours ago, Ultroman said:

"strongstomach" only affects "monstermeat" as far as I can see on the code. Take a look at my new Fun With Food tutorial, specifically the part about "Removing ONLY Negative Stat Effects From Certain Foods (CHARACTER)".

I don't think I can help with the soul-dropping thing. Have you tried simply removing the line


inst:AddTag("soulstealer")	

?

The food thing worked :D Thank you.
If I remove "inst:AddTag("soulstealer")" I can still drop souls for healing me, but teleporting won't work.

Link to comment
Share on other sites

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
 Share

×
  • Create New...