Jump to content

Help with my hat


Recommended Posts

transfer a hat to a character mod to make it a part of it?

I'm not sure what you mean. Do you want it to be something only that character can craft, a unique item they start, with, or what?

 

You can use add the prefab file for the hat to your mod's scripts/prefabs folder, which is where your character should be. You'll also have to add it to the PrefabFiles table in the modmain. There are several character mods that add custom items (with both of the approaches I suggested above), so you can check how those do it. 

Edited by rezecib
Link to comment
Share on other sites

 

inst:AddComponent("dapperness")
inst.components.dapperness.dapperness = TUNING.DAPPERNESS_TINY
for a sanity gain

 

Idk what's going on, but whenever I give myself the item, it doesn't raise my sanity. I was wondering where to I paste it into the prefab (just in case I'm doing it wrong.)

Link to comment
Share on other sites

@Crestonia, show us your current version of the prefab file? It should be in the fn() (the function that gets passed to the Prefab(...) constructor, usually called simply "fn"), after the part where it says "if not TheWorld.ismastersim then return inst end"

 

To make it a unique item that they start with, just add it to their starter_inv (it should be a list in your character's prefab, empty by default).

Link to comment
Share on other sites

Idk what's going on, but whenever I give myself the item, it doesn't raise my sanity. I was wondering where to I paste it into the prefab (just in case I'm doing it wrong.)

You put in the local function fn() anywhere below the inst.entity:SetPristine()

Edited by ELEMENTALCRAFTER009
Link to comment
Share on other sites

I ran into an error... I tried to basically paste the hat mod into a character mod and it says

http://steamcommunity.com/sharedfiles/filedetails/?id=400866265

oh and also here's the file. I don't know how to solve the issue about the modmain, I looked at a mod on steam and used it as a reference, and I don't know what I did wrong. I hope someone can help.

Character.zip

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