Jump to content

Recommended Posts

First of all, Hi

I start agayn to finish one of my own character, i still trying all in it works fine, and today i find the character can't unwrap that thing " Crumpled Package"(wetpouch), the problem is i don't know how work the action itself i read the LUA from "oasislake" to find the name "wetpouch" but i don't find it in game prefabs and in te LUA of Unwrappable i don't find nothing that can help me, it loots like easy maybe, but i don't find the path and i try to read the Player_common.lua but i don't see nothing too, if i click unwrap the character go to the item but don't make nothing.

 

The character.LUA here, i really think it can be easy but i be blind now, i don't know how to solve,

Spoiler


local MakePlayerCharacter = require "prefabs/player_common"


local assets = {
    Asset("SCRIPT", "scripts/prefabs/player_common.lua"),
	Asset( "ANIM", "anim/gatira.zip" ),
	Asset( "ANIM", "anim/gatira_insane.zip" ),

}
local prefabs = {

}

-- Custom starting items
local start_inv = {

	"parabuas",
	"flowerhat",
	
	

	

	

	
}



-- When the character is revived from human


-- When loading or spawning the character



-- This initializes for both the server and client. Tags can be added here.
local common_postinit = function(inst) 
	-- Minimap icon
	inst.MiniMapEntity:SetIcon( "gatira.tex" )
	inst.Transform:SetScale(1, 1, 1)
	inst:AddTag("dappereffects")
	
	inst:AddTag("gatiraparabuabuilder")
	
end


local function sanityfn(inst)
	for k,v in pairs(inst.components.inventory.equipslots) do
		if AllRecipes[v.prefab] and AllRecipes[v.prefab].tab == RECIPETABS.DRESS then
			return TUNING.DAPPERNESS_LARGE
		end
	end
	return 0
end


local function applysanityness(inst)


    local damage_mult = 1
    local hunger_rate = 1
    local health_max = 150
    local sane_scale = 1.1
    local insane_scale = 0.9
	local WALK_SPEED = 1.25
	local RUN_SPEED = 1.25
    
	local insane_scale = 0.9
    local sane_scale = 1.1

    if inst.strength == "sane" then
	 

        damage_mult = 0.8
        health_max = 200 
        hunger_rate = 1.2
		WALK_SPEED = 1
		RUN_SPEED = 1
		inst._sanityness_scale = 1.1
       
    elseif inst.strength == "insane" then


		damage_mult = 1.2
        health_max = 100
        hunger_rate = 0.8
		WALK_SPEED =  1.5
		RUN_SPEED = 1.5
		inst._sanityness_scale = 0.9
		
    else
        inst._sanityness_scale = 1
    end

    inst:ApplyScale("sanityness", inst._sanityness_scale)
    inst.components.hunger:SetRate(hunger_rate*TUNING.WILSON_HUNGER_RATE)
    inst.components.combat.damagemultiplier = damage_mult
	inst.components.locomotor.walkspeed = WALK_SPEED*TUNING.WILSON_WALK_SPEED
	inst.components.locomotor.runspeed = RUN_SPEED*TUNING.WILSON_RUN_SPEED
	
	local health_percent = inst.components.health:GetPercent()
    inst.components.health:SetMaxHealth(health_max)
    inst.components.health:SetPercent(health_percent, true)

 

    
end

local function becomeinsane(inst, silent)
    if inst.strength == "insane" then
        return
    end
	inst.components.skinner:SetSkinMode("insane_skin", "gatira_insane")

    if not silent then
        inst.sg:PushEvent("powerdown")
		inst.components.talker:Say("DEJAD DE GRITAR MALDITAS!!")
		
    end

    
    inst.strength = "insane"
end
local function becomenormal(inst, silent)
    if inst.strength == "normal" then
        return
    end
	inst.components.skinner:SetSkinMode("normal_skin", "gatira")

    if not silent then
        if inst.strength == "sane" then
        
		    inst.components.talker:Say("El dolor de cabeza vuelve...")	
            inst.sg:PushEvent("powerdown")
            
        elseif inst.strength == "insane" then
			inst.components.talker:Say("Callad voces estupidas!!")
            inst.sg:PushEvent("powerup")
            
        end
    end

    
    inst.hurtsoundoverride = nil
    inst.strength = "normal"
end
local function becomesane(inst, silent)
    if inst.strength == "sane" then
        return
    end
	inst.components.skinner:SetSkinMode("normal_skin", "gatira")

    if not silent then
		inst.components.talker:Say("Se callaron las voces.")
        inst.sg:PushEvent("powerup")
        
    end

    
    inst.hurtsoundoverride = nil
    inst.strength = "sane"
end
local function onsanitychange(inst, data, forcesilent)
    if inst.sg:HasStateTag("nomorph") or
        inst:HasTag("playerghost") or
        inst.components.health:IsDead() then
        return
    end

    local silent = inst.sg:HasStateTag("silentmorph") or not inst.entity:IsVisible() or forcesilent

    if inst.strength == "sane" then
        if inst.components.sanity.current < 160 then
            if silent and inst.components.sanity.current < 70 then
                becomeinsane(inst, true)
            else
                becomenormal(inst, silent)
            end
        end
    elseif inst.strength == "insane" then
        if inst.components.sanity.current > 70 then
            if silent and inst.components.sanity.current > 160 then
                becomesane(inst, true)
            else
                becomenormal(inst, silent)
            end
        end
    elseif inst.components.sanity.current > 160 then
        becomesane(inst, silent)
    elseif inst.components.sanity.current < 70 then
        becomeinsane(inst, silent)
    end

    applysanityness(inst)
end
local function onnewstate(inst)
    if inst._wasnomorph ~= inst.sg:HasStateTag("nomorph") then
        inst._wasnomorph = not inst._wasnomorph
        if not inst._wasnomorph then
            onsanitychange(inst)
        end
    end
end

local function onbecamehuman(inst)
	-- Set speed when reviving from ghost (optional)
	inst.components.locomotor:SetExternalSpeedMultiplier(inst, "gatira_speed_mod", 1)
	if inst._wasnomorph == nil then
        inst.strength = "normal"
        inst._wasnomorph = inst.sg:HasStateTag("nomorph")
        inst.talksoundoverride = nil
        inst.hurtsoundoverride = nil
        inst:ListenForEvent("sanitydelta", onsanitychange)
        inst:ListenForEvent("newstate", onnewstate)
        onsanitychange(inst, nil, true)
    end
end

local function onbecameghost(inst)
	-- Remove speed modifier when becoming a ghost
   inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "gatira_speed_mod")
    if inst._wasnomorph ~= nil then
        inst.strength = "normal"
        inst._wasnomorph = nil
        inst.talksoundoverride = nil
        inst.hurtsoundoverride = nil
        inst:RemoveEventCallback("sanitydelta", onsanitychange)
        inst:RemoveEventCallback("newstate", onnewstate)
    end
end

local function onload(inst)
    inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman)
    inst:ListenForEvent("ms_becameghost", onbecameghost)
	local loadhealth = inst._loadhealth or inst.components.health.currenthealth
    inst._loadhealth = nil

    if inst:HasTag("playerghost") then
        onbecameghost(inst)
    else
        onbecamehuman(inst)
    end
	inst.components.health:SetPercent(loadhealth / inst.components.health.maxhealth, true)
end
local function onpreload(inst, data)
    if data ~= nil and data.health ~= nil then
        inst._loadhealth = data.health.health
    end
end
local master_postinit = function(inst)
	-- choose which sounds this character will play
	inst.soundsname = "wendy"
	
	-- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used
    --inst.talker_path_override = "dontstarve_DLC001/characters/"
	inst.strength = "normal"
    inst._mightiness_scale = 1
    inst._wasnomorph = nil
    inst.talksoundoverride = nil
	inst.hurtsoundoverride = nil
	-- Stats	
	
	inst.components.hunger:SetMax(150)
	inst.components.sanity:SetMax(200)
	
	-- Damage multiplier (optional)
    --Parabuirem
	inst:SetStateGraph("SGgatira")
	
	-- Hunger rate (optional)

    inst.components.sanity.night_drain_mult = 1.5
    inst.components.sanity.neg_aura_mult = 1.5
	inst.components.sanity.custom_rate_fn = sanityfn
	inst.components.sanity.dapperness = TUNING.DAPPERNESS_SMALL*-1.5
	


	


	inst.OnPreLoad = onpreload
	inst.OnLoad = onload
    inst.OnNewSpawn = onload
	

end
return MakePlayerCharacter("gatira", prefabs, assets, common_postinit, master_postinit, start_inv)

 

Thx For reading and sorry for my english level.

wrapp.jpg

unwrap.jpg

Edited by leprucio

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