Jump to content

Recommended Posts

Hi

 

I'm new to modding for don't starve. I've seen and read toturials on how to make a character. I know how to make a character just fine now. However, my issue is I want to create a mod that 1) has a character able to transform after using an item too many times and have this item speak, like woodie and 2) make an unlockable character through this one. 

 

I've already searched everywhere online for how to do this, which people always bring up "just refer to woodie lua". Now I'm still fairly new to the coding aspects so simply looking at woodies setup and renaming everything is not what I'm after. I need a break down in steps of how i would achieve this so that in later mods I can understand what the heck I'm doing. 

Thanks all for any help with this. :happypigs:

I saw these codes below in this mod: http://forums.kleientertainment.com/files/file/351-waverly-the-bewitched/

To make an unlockable character:

function ModPlayerProfile(PlayerProfile)    function PlayerProfile:IsCharacterUnlocked(character)        if character == "wilson" then            return true        end        if self.persistdata.unlocked_characters[character] then            return true        end        if not table.contains(CHARACTERLIST, character) and character ~= "YOUR CHARACTER NAME" then            return true -- mod character        end        return false    endendAddGlobalClassPostConstruct("playerprofile", "PlayerProfile", ModPlayerProfile) 

 

Unlock function:

local function Unlock()	GetPlayer().profile:UnlockCharacter("YOUR CHARACTER NAME")	GetPlayer().profile:Save()end 

 

 

 

I saw these codes below in this mod: http://forums.kleientertainment.com/files/file/351-waverly-the-bewitched/

To make an unlockable character:

function ModPlayerProfile(PlayerProfile)    function PlayerProfile:IsCharacterUnlocked(character)        if character == "wilson" then            return true        end        if self.persistdata.unlocked_characters[character] then            return true        end        if not table.contains(CHARACTERLIST, character) and character ~= "YOUR CHARACTER NAME" then            return true -- mod character        end        return false    endendAddGlobalClassPostConstruct("playerprofile", "PlayerProfile", ModPlayerProfile) 

 

Unlock function:

local function Unlock()	GetPlayer().profile:UnlockCharacter("YOUR CHARACTER NAME")	GetPlayer().profile:Save()end 

 

where would i put these codes? :3

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