Jump to content

Make equips invisable?


Recommended Posts

Hi again everyone.

 

I am sorry if this has already been asked, I have tried a search on the forums and even a google search to no avail.

 

Now on to my question,

 

I was wondering if there is a MOD that makes equips invisible? Like the hats, log suits ect.

 

I am making a custom character and do not want her covered up all the time.

 

Thanks! =D

Link to comment
Share on other sites

@Zchu
I don't see the problem in wearing armor. Anyways...


inst:ListenForEvent("equip", function(inst, data)        print("I'm wearing something.")        inst.AnimState:ClearOverrideSymbol("swap_body")    end)

That will hide all body-equippable items, such as armor, amulets, backpacks, etc.
If you want to filter certain items, you can do something like:

local allowed_items = {"amulet","backpack"}        local function isallowed(item)        for i,v in ipairs(allowed_items) do            if item.prefab == v then                return false            end        end        return true    end        inst:ListenForEvent("equip", function(inst, data)        if data.item and data.item.components.equippable.equipslot == EQUIPSLOTS.BODY and isallowed(data.item) then            print("I'm wearing a", data.item.name)            inst.AnimState:ClearOverrideSymbol("swap_body")        end    end)
Link to comment
Share on other sites

 

@Zchu

I don't see the problem in wearing armor. Anyways...

inst:ListenForEvent("equip", function(inst, data)        print("I'm wearing something.")        inst.AnimState:ClearOverrideSymbol("swap_body")    end)

That will hide all body-equippable items, such as armor, amulets, backpacks, etc.

 @Ryuushu I am sorry but... where do I put this? I have never modded anything before. Can you be more specific? Thank you.

Link to comment
Share on other sites

@Zchu
Put it inside your character's prefab file, in the master_postinit function, like so:

...local master_postinit = function(inst)    -- sound your character will play    inst.soundname = "wendy"        -- Stats    inst.components.health.maxhealth = 200    inst.components.sanity.max = 200    inst.components.hunger.max = 200    inst:ListenForEvent("equip", function(inst, data)        print("I'm wearing something.")        inst.AnimState:ClearOverrideSymbol("swap_body")    end)end...
Link to comment
Share on other sites

 

@Zchu

Put it inside your character's prefab file, in the master_postinit function, like so:

...local master_postinit = function(inst)    -- sound your character will play    inst.soundname = "wendy"        -- Stats    inst.components.health.maxhealth = 200    inst.components.sanity.max = 200    inst.components.hunger.max = 200    inst:ListenForEvent("equip", function(inst, data)        print("I'm wearing something.")        inst.AnimState:ClearOverrideSymbol("swap_body")    end)end...

 

@Ryuushu

Ohhhhh! I see now! Thanks so much! Now does this work for head equips?

 

 

EDIT: This crashed my game =(

Edited by Zchu
Link to comment
Share on other sites

Well, this is strange, I tried using that and it worked for me.

What does the log say?

 

Alternatively, maybe instead of ClearOverrideSymbol, you can try using:

-- to hide hatinst.AnimState:Hide("hat")inst.AnimState:Hide("hat_hair")inst.AnimState:Show("hair_nohat")inst.AnimState:Show("hair")inst.AnimState:Show("head")inst.AnimState:Hide("head_hair")-- to hide armorinst.AnimState:Hide("swap_body") -- to hide weaponinst.AnimState:Hide("arm_carry")inst.AnimState:Show("arm_normal")

instead of:

inst.AnimState:ClearOverrideSymbol("swap_hat")inst.AnimState:ClearOverrideSymbol("swap_body")inst.AnimState:ClearOverrideSymbol("swap_object")
Edited by DarkXero
Link to comment
Share on other sites

 

Well, this is strange, I tried using that and it worked for me.

What does the log say?

 

Alternatively, maybe instead of ClearOverrideSymbol, you can try using:

-- to hide hatinst.AnimState:Hide("hat")inst.AnimState:Hide("hat_hair")inst.AnimState:Show("hair_nohat")inst.AnimState:Show("hair")inst.AnimState:Show("head")inst.AnimState:Hide("head_hair")-- to hide armorinst.AnimState:Hide("swap_body") -- to hide weaponinst.AnimState:Hide("arm_carry")inst.AnimState:Show("arm_normal")

instead of:

inst.AnimState:ClearOverrideSymbol("swap_hat")inst.AnimState:ClearOverrideSymbol("swap_body")inst.AnimState:ClearOverrideSymbol("swap_object")

 

 

It was my bad! I forgot to rename the Ghost anim folder DX

 

Hmmm which method would be better? or does it really matter? THANK YOU!  :love_heart:

Link to comment
Share on other sites

Well, it depends.

 

For armor, the best is ClearOverrideSymbol. There are no Show() or Hide() on the equip functions.

 

For hats, depending on your hair, and the hat you equip, if you use ClearOverrideSymbol you will delete the hat but the hair won't come back unless you unequip the hat, because the hair is hidden. So you want to both make the hat invisible, and tell the game to show the hair.

 

Concisely, this:

	inst:ListenForEvent("equip", function()		inst.AnimState:ClearOverrideSymbol("swap_hat")		inst.AnimState:Show("hair")		inst.AnimState:ClearOverrideSymbol("swap_body")	end)
Link to comment
Share on other sites

Not sure what you mean? Like on every character or for everyone playing on just my character?

For everyone who are plaing on the server? Or for everyone on the server except owner of item?

 

Don't you think that other character can get this item (as a gift, for example)? Don't you think that admin will try to summon this item for himself while he is playing on another character?

Link to comment
Share on other sites

@Maris, as it is, by putting the listener on the master_postinit, the invisible things are a character property. The items aren't actually invisible or make themselves invisible in their own. So for any item, nobody will see it equipped on that character, but everybody will see it on another.

Link to comment
Share on other sites

@Maris, as it is, by putting the listener on the master_postinit, the invisible things are a character property. The items aren't actually invisible or make themselves invisible in their own. So for any item, nobody will see it equipped on that character, but everybody will see it on another.

 

@DarkXero

 

Oh I see, sadly this is not what I want. I want equips to be completely invisible to everyone. If it is even possible of course. 

Link to comment
Share on other sites

@Zchu, well, I figured you just wanted to have only the blue cats with invisible things.

 

For a entire naked server:

AddPlayerPostInit(function(inst)	inst:ListenForEvent("equip", function()		inst.AnimState:ClearOverrideSymbol("swap_hat")		inst.AnimState:Show("hair")		inst.AnimState:ClearOverrideSymbol("swap_body")	end)end)

in modmain.

Edited by DarkXero
Link to comment
Share on other sites

@Zchu, well, I figured you just wanted to have only the blue cats with invisible things.

 

For a entire naked server:

AddPlayerPostInit(function(inst)	inst:ListenForEvent("equip", function()		inst.AnimState:ClearOverrideSymbol("swap_hat")		inst.AnimState:Show("hair")		inst.AnimState:ClearOverrideSymbol("swap_body")	end)end)

in modmain.

 

What mod main? Do I just stick in my character mod folder mod main?

Link to comment
Share on other sites

@Zchu, in the modmain.lua file of your character mod, next to the modinfo.lua file.

 

That way, everybody from Wilsons to Wendys to blue cats will have their armor and hats invisible.

 

YAY!!! it works!!

 

THANK YOU!!!!  :highly_amused:

 

Will i have to put this in all my characters modmain.lua's? =o

 

No more covering up my character  with grass and football helmets lol

Link to comment
Share on other sites

@Zchu, your character is a prefab that is inside a mod.

When you load the mod, you load the modmain.lua code.

 

If you have AddPlayersPostInit in one mod, it doesn't matter what other characters in the same mod, or mods you have, EVERYBODY will have their things invisible. Wilson, Wendy, blue cat, black cat, characters from other mods. EVERYBODY in your server will be naked.

 

If you don't have the AddPlayersPostInit, then yes, you would need to put the listener inside every character's master_postinit.

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