Jump to content

Recommended Posts

Is there a way to change 'character_none'(by character_none i mean wilson_none, wes_none, etc prefabs) to make it into a craftable recipe? What I want to do is change my characters build so it looks like a different character altogether when crafting a recipe. I tried my take on it a few months ago but ultimately failed. I know how recipes work, but I don't know how to make the prefab for this. Any suggestions?

Link to comment
https://forums.kleientertainment.com/forums/topic/66531-skin-crafting-recipes/
Share on other sites

You mean a craftable that has an effect on the builder?

modmain.lua (make Wilson with shapeshifter tag, add new recipe):

PrefabFiles = {
	"willow_switch",
}

local RECIPETABS = GLOBAL.RECIPETABS
local STRINGS = GLOBAL.STRINGS
local TECH = GLOBAL.TECH

local willow_switch = AddRecipe("willow_switch", {Ingredient("twigs", 1), Ingredient("cutgrass", 1)}, 
RECIPETABS.LIGHT, TECH.NONE, nil, nil, nil, nil, "shapeshifter", "images/inventoryimages.xml", "axe.tex")

willow_switch.sortkey = 0

STRINGS.NAMES.WILLOW_SWITCH = "Willow Switch"
STRINGS.RECIPE_DESC.WILLOW_SWITCH = "Just do it."

AddPrefabPostInit("wilson", function(inst)
	inst:AddTag("shapeshifter")
end)

willow_switch.lua in prefabs:

local function onbuilt(inst, builder)
	-- builder:MakeWillow()
	builder.AnimState:SetBuild("willow")
	inst:Remove()
end

local function fn()
	local inst = CreateEntity()

	inst.entity:AddTransform()

	inst:AddTag("CLASSIFIED")

	inst.persists = false

	inst:DoTaskInTime(0, inst.Remove)

	if not TheWorld.ismastersim then
		return inst
	end

	inst.OnBuiltFn = onbuilt

	return inst
end

return Prefab("willow_switch", fn)

Like how Maxwell's shadows work.

@DarkXero, My apologies for not giving you a proper thank you sooner! I was just going to drop this altogether feeling it was too hard to conjure up. But you saved my hiney yet again after my long absence. 

My purpose for this mod will be an easy way for people to choose a character i've created over the year without jeopardizing the gameplay. So if people want to look like Cthulhu without wrecking havoc. You can simply wear a skin to look like it instead!

I'll do some further testing, but I really appreciate the help! 

 

 

Edited by rons0n

Alright everything is almost ready for upload! Except one perculiar problem. While characters such as Wilson, WIllow, Wigfrid, Maxwell, Wendy, Woodie changed in their entirety. Wickerbottom, Wolfgang, WX, and Wes tend to have their Torsos locked in place. 

For instance in this album: http://imgur.com/a/bjA8E

I assumed it was based on my characters current build, but Maxwell just came out and his torso isnt locked compared to the characters above. Any idea? @DarkXero

14 hours ago, rons0n said:

I assumed it was based on my characters current build, but Maxwell just came out and his torso isnt locked compared to the characters above. Any idea?

Use, instead of builder.AnimState:SetBuild:

SetSkinMode(builder.AnimState, new_prefab, new_skin, builder.components.skinner:GetClothing(), nil, default_build)

new_prefab should be "pearl".

new_skin should be pearl_none, which should be "pearl".

default_build should be your mod character build, which should also be "pearl".

6 hours ago, rons0n said:

Though I don't understand what new_prefab and new_skin is supposed to do, whats the purpose?

The full function is in the skinner component.

prefab is to make special cases for wolfgang and mod characters.

base_skin is to make some special symbol replacements.

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