Sign in to follow this  
EuedeAdodooedoe

A few mechanics that I'm struggling to find code for...

Recommended Posts

EuedeAdodooedoe    1187

So, a few things that I'm trying to take examples from to apply to whatever I'm working on (Bernie and Willow's Lighter), but I cannot find code for. I want to try things for myself before asking any proper code advice, but for me right now, the biggest problem is finding what is where:

1) Where is it mentioned and what function makes it so that the lureplants can't gobble up the chester eyebone? I tested it, and they don't eat it, but I cannot find a reference for any code anywhere really when looking for it; to my knowledge, it's not in eyeplant.lua, eyebone.lua, digester.lua or eater.lua.

2) Where is it mentioned and what function makes it so that the eyebone drops upon the player exiting?

3) Where is it mentioned and what function makes it so that a Woodie player cannot hold onto more than one Lucy the Axe?

4) Where is it mentioned and what function makes it so that you can light things on fire with Willow's Lighter?

Share this post


Link to post
Share on other sites
Serpens    578

1+2) it is the Tag "irreplacable". I think the function is not in lua, so unaccessable. It makes sure, that these items can't get lost.
 

Share this post


Link to post
Share on other sites
EuedeAdodooedoe    1187
17 hours ago, Serpens said:

1+2) it is the Tag "irreplacable". I think the function is not in lua, so unaccessable. It makes sure, that these items can't get lost.
 

Oh... so it's one tag for both to prevent eyeplants from eating them as well as players exiting with them... That sucks because I want to make sure that the item(s) I'm working with cannot be eaten by eyeplants, but can be exited with under certain conditions.

The tag that Lucy the Axe seems to have is "sharp", however when adding it to my prefabs, they don't seem to change anything at all. I'm guessing this answers question 3 and it cannot really be changed, if the tag is created in C++ or whatever. In which case, it seems like I'll need to try and mess around with functions to make this thing work.

In terms of the fourth question, I've found out that lighter.lua in components creates the ability for things like torches and lighters to be used to light things on fire. A tag "lighter" then needs to be added in fn function of a prefab to make it an item that you can light things with. But the problem is, I can't exactly set it so that this tag only applies under certain conditions (i.e. for the Willow's Lighter, to only be possible to light things with if you're playing as Willow). May be if there is some way to remove tags and components that are added in fn() under certain conditions, although this function I wrote:

local function LighterCheck(inst, owner)
    if owner.prefab ~= "willow" then
        inst:RemoveTag("lighter")
        inst:RemoveComponent("lighter")
    end
end

doesn't do anything. Am I missing something?

Share this post


Link to post
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
Sign in to follow this