Jump to content

Recommended Posts

so i wanna make an item mod that are purely cosmetic that will give the players new crafting options for character specific items in the same way you can craft different skins for the pit and packs . (plan to make each elegant skin for each item to make a ful match for each characters elegant)

and im asking how do i find the in game images that i can edit to do these redesigns or will i have to completely remake the item from the ground up?

Edited by EsaiXD
1 hour ago, Aquaterion said:

I remember i was doing a mod similar to this once, and then after a bunch of coding, I remembered I have no artistic talent rip

Me neither, but despite lacking talent, you can do quite some stuff with simple (color) transformations and filters.

so i just finished all the animations for the new skins but now im not entirely sure how to make them have their own craftable item or to implement them into the actual game

judging that these are just redesigns i should be able to use the standard code with slight changes in the source files right?

but.... thats what I couldnt figure out how to do

7 hours ago, EsaiXD said:

so i just finished all the animations for the new skins but now im not entirely sure how to make them have their own craftable item or to implement them into the actual game

judging that these are just redesigns i should be able to use the standard code with slight changes in the source files right?

but.... thats what I couldnt figure out how to do

The way I was gonna do it was rather than crafting them, you're forced to have them, if you're wearing anything elegant on your character, it would make change the prefab's look into the elegant one.

7 hours ago, Aquaterion said:

The way I was gonna do it was rather than crafting them, you're forced to have them, if you're wearing anything elegant on your character, it would make change the prefab's look into the elegant one.

yeah i actually wanted to have that happen in mine but I cant understand how D: looking at other mods have it set to a zip with these two files included atlas-0.tex and the build.bank  while im still stuck here with the .scml files and idk how to get to that point of the zip

Edited by EsaiXD

I suggest you change the prefabs (items, creatures, etc.) using AddPrefabPostInit() in modmain.lua, here's some pseudo-code:

Spoiler



-- First, make a fancy skinswitcher!
local function abigail_flower_topocket(inst, owner)
    -- There should be a player, but just to be sure...
	if owner then
        -- If the player is a Wendy w/out skin, then...
		if owner.prefab == "wendy_none" then
            -- Use the regular images
			inst.AnimState:SetBuild("abigail_flower")
			-- Optionally update inventory icons too
		elseif owner.prefab == "wendy_formal" then
			inst.AnimState:SetBuild("abigail_flower_CUSTOMBUILD_NAME1")
		elseif owner.prefab == "wendy_survivor" then
			inst.AnimState:SetBuild("abigail_flower_CUSTOMBUILD_NAME2")
		elseif owner.prefab == "wendy_shadow" then
			inst.AnimState:SetBuild("abigail_flower_CUSTOMBUILD_NAME3")
		end
	end
end

-- Now to attach it!
AddPrefabPostInit("abigail_flower", function(inst)
    -- The following triggers our fancy skinswitcher everytime the item gets picked up.
	inst:ListenForEvent("onputininventory", abigail_flower_topocket)
end)

 

Abigail can adjust her skin according to her current leader.

so my go to guy is gone atm so I am asking forums about a problem Ive got

got the skin switcher that mobbstar has provided and everything managed to load up in game but the skins did not change any idea as to why this is?

mod main.jpg

The skin doesn't actually change your prefab I believe, so try this;

local function abigail_startfollow(inst, data)
	if data and data.leader then
		local skin = data.leader.components.skinner:GetClothing().base
		skin = string.sub(skin, 7) --removes the "wendy_" part
		print("Skin set to: " .. skin)
		skin = skin == "none" and "abigail" or "ghost_abigail_" .. skin
		inst.AnimState:SetBuild(skin) -- sets the build to the skin
	end
end

 

Edited by Aquaterion
On 9/5/2016 at 6:30 PM, Mobbstar said:

I suggest you change the prefabs (items, creatures, etc.) using AddPrefabPostInit() in modmain.lua, here's some pseudo-code:

  Hide contents

 



-- First, make a fancy skinswitcher!
local function abigail_flower_topocket(inst, owner)
    -- There should be a player, but just to be sure...
	if owner then
        -- If the player is a Wendy w/out skin, then...
		if owner.prefab == "wendy_none" then
            -- Use the regular images
			inst.AnimState:SetBuild("abigail_flower")
			-- Optionally update inventory icons too
		elseif owner.prefab == "wendy_formal" then
			inst.AnimState:SetBuild("abigail_flower_CUSTOMBUILD_NAME1")
		elseif owner.prefab == "wendy_survivor" then
			inst.AnimState:SetBuild("abigail_flower_CUSTOMBUILD_NAME2")
		elseif owner.prefab == "wendy_shadow" then
			inst.AnimState:SetBuild("abigail_flower_CUSTOMBUILD_NAME3")
		end
	end
end

-- Now to attach it!
AddPrefabPostInit("abigail_flower", function(inst)
    -- The following triggers our fancy skinswitcher everytime the item gets picked up.
	inst:ListenForEvent("onputininventory", abigail_flower_topocket)
end)

 

Abigail can adjust her skin according to her current leader.

That's not pseudo-code. That is real code. You deceived us!

6 hours ago, Joachim said:

That's not pseudo-code. That is real code. You deceived us!

19 hours ago, Aquaterion said:

The skin doesn't actually change your prefab

It wasn't proper code, instead of the prefab, you'd have to check for inst.components.skinner.skin_name like so:

 -- First, make a fancy skinswitcher!
local function abigail_startfollow(inst, data)
    -- There should be a player, but just to be sure...
    if data and data.leader and data.leader.components and data.leader.components.skinner then
        -- If the player is a Wendy w/out skin, then...
        if data.leader.components.skinner.skin_name == "wendy_none" then
            -- Use the regular images
            inst.AnimState:SetBuild("abigail")
            -- Optionally update inventory icons too
        elseif data.leader.components.skinner.skin_name == "wendy_formal" then
            inst.AnimState:SetBuild("abigail2")
        elseif data.leader.components.skinner.skin_name == "wendy_survivor" then
            inst.AnimState:SetBuild("abigail3")
        elseif data.leader.components.skinner.skin_name == "wendy_shadow" then
            inst.AnimState:SetBuild("abigail4")
        end
    end
end

-- Now to attach it!
AddPrefabPostInit("abigail", function(inst)
    -- The following triggers our fancy skinswitcher once Abigail has a Wendy.
    inst:ListenForEvent("startfollowing", abigail_startfollow)
end)

In comparison to Aqua's code, this one lets you have any build you want and spawn fx virtually without limitation. It is, however, less sleek and more effortous to adjust for every new prefab getting "skinned".

4 hours ago, Mobbstar said:

It wasn't proper code, instead of the prefab, you'd have to check for inst.components.skinner.skin_name like so:

--

In comparison to Aqua's code, this one lets you have any build you want and spawn fx virtually without limitation. It is, however, less sleek and more effortous to adjust for every new prefab getting "skinned".

the skin variable in my code would have normal,formal,shadow or survivor. so you can easily just do an if statement to achieve something similar to yours

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