Jump to content

Recommended Posts

I just need some general help with my woodie modding.

1.I have ready a werebeaver scml and textures to be compiled by the autocompiler but it always hits with a compiler error, I did some texture edits to make it look aquatic, submerged underwater

ERROR: missing image 'beaver_head-0.png' referenced by 'beaver.scml' . already done all the folder path regrouping, flattening, however you want to call it doesn't let me compile and throws me that error, I attach below my scml and .png textures in compilebeaver.zip 

2.Does anyone have the weremoose build? I tried digging the game's folders and there's weremoose_build to be found in the dynamic folders and then there's the weremoose_basic under the anim folders but no tex files at all.  I need the texture files to make a water deep version with scml.

3.  I also have tried to revive some old code for weregoose flying out of caves, not respecting any cave boundaries to walk in 'nothing' but I got help from ChatGpt and we trie a lot of things and determined maybe it was the game engine not letting the player be in navmesh. Or maybe it's even as stategraph of the goose not letting it happen, Here's a code block has been tried and did not work.

--------------------------------------------------------------------------
-- Goose cave-only void-walk (no snapback, no drowning, no takeoff)
--------------------------------------------------------------------------

local function IsGoose(inst)
    return inst
        and inst.prefab == "woodie"
        and (inst:HasTag("weregoose") or (inst:HasTag("wereplayer") and inst.were_mode == "goose"))
end

--------------------------------------------------------------------------
-- Disable drowning for Goose
--------------------------------------------------------------------------
AddComponentPostInit("drownable", function(self)
    local _old = self.ShouldDrown
    function self:ShouldDrown(...)
        if IsGoose(self.inst) then
            return false
        end
        return _old(self, ...)
    end
end)

--------------------------------------------------------------------------
-- Disable client snapback correction
--------------------------------------------------------------------------
AddClassPostConstruct("components/playercontroller", function(self)
    local _old_DoSnap = self.DoSnapPredictionCorrection
    function self:DoSnapPredictionCorrection(...)
        local inst = self.inst
        if IsGoose(inst) and GLOBAL.TheWorld and GLOBAL.TheWorld:HasTag("cave") then
            return -- cancel snapback
        end
        return _old_DoSnap(self, ...)
    end
end)

--------------------------------------------------------------------------
-- Physics setup for Goose transforms
--------------------------------------------------------------------------
AddPrefabPostInit("woodie", function(inst)
    if not GLOBAL.TheWorld or not GLOBAL.TheWorld:HasTag("cave") then
        return
    end

    -- Into Goose
    inst:ListenForEvent("transform_wereplayer", function(inst, data)
        if data and data.mode == "goose" then
            inst.Physics:SetCollisionMask(
                GLOBAL.COLLISION.GROUND,
                GLOBAL.COLLISION.OBSTACLES,
                GLOBAL.COLLISION.SMALLOBSTACLES,
                GLOBAL.COLLISION.CHARACTERS,
                GLOBAL.COLLISION.GIANTS
            )
            inst.Physics:ClearCollidesWith(GLOBAL.COLLISION.LIMITS) -- allow void-walk
        end
    end)

    -- Back to Woodie
    inst:ListenForEvent("transform_person", function(inst, data)
        if data and data.mode == "goose" then
            inst.Physics:SetCollisionMask(
                GLOBAL.COLLISION.WORLD,
                GLOBAL.COLLISION.OBSTACLES,
                GLOBAL.COLLISION.SMALLOBSTACLES,
                GLOBAL.COLLISION.CHARACTERS,
                GLOBAL.COLLISION.GIANTS
            )
            inst.Physics:CollidesWith(GLOBAL.COLLISION.LIMITS)
        end
    end)

    -- Goose already active on load
    local old_OnPreLoad = inst.OnPreLoad
    inst.OnPreLoad = function(inst, data, ...)
        if old_OnPreLoad then old_OnPreLoad(inst, data, ...) end
        if data and data.isgoose then
            inst.Physics:SetCollisionMask(
                GLOBAL.COLLISION.GROUND,
                GLOBAL.COLLISION.OBSTACLES,
                GLOBAL.COLLISION.SMALLOBSTACLES,
                GLOBAL.COLLISION.CHARACTERS,
                GLOBAL.COLLISION.GIANTS
            )
            inst.Physics:ClearCollidesWith(GLOBAL.COLLISION.LIMITS)
        end
    end
end)

--------------------------------------------------------------------------
-- Stategraph override: prevent Goose from "taking off" in caves
--------------------------------------------------------------------------
local function RemoveGooseTakeOff(inst)
    if inst.sg and inst.sg.states and inst.sg.states.takeoff then
        local old_onenter = inst.sg.states.takeoff.onenter
        inst.sg.states.takeoff.onenter = function(inst2)
            if IsGoose(inst2) and GLOBAL.TheWorld and GLOBAL.TheWorld:HasTag("cave") then
                inst2.sg:GoToState("idle")
                return
            end
            if old_onenter then
                old_onenter(inst2)
            else
                inst2.sg:GoToState("idle")
            end
        end
    end
end

AddPlayerPostInit(function(inst)
    if inst.prefab == "woodie" then
        inst:DoTaskInTime(0, function() RemoveGooseTakeOff(inst) end)
    end
end)

4. setting up action strings for beaver, I tried again with AI, the main problem was registering the action instead of the string, to attach it to the action while woodie is a werebeaver.

local function BeaverExtraActionString(inst, action)
    return (action.action == ACTIONS.MOUNT_PLANK and STRINGS.ACTIONS.MOUNT_PLANK)
        or (action.action == ACTIONS.ABANDON_SHIP and STRINGS.ACTIONS.ABANDON_SHIP)
		or (action.action == ACTIONS.USE_WEREFORM_SKILL and STRINGS.ACTIONS.USE_WEREFORM_SKILL.BEAVER)
        or (action.action == ACTIONS.REMOVELUNARBUILDUP and STRINGS.ACTIONS.REMOVELUNARBUILDUP)
		or (action.action == ACTIONS.PICKUP and "Pick Up")
		or (action.action == ACTIONS.PICK and "Pick")	
	    or (action.action == ACTIONS.MIGRATE and "Migrate")	
	    or (action.action == ACTIONS.ACTIVATE and "Use")	
	    or (action.action == ACTIONS.GIVE and "Give")
	    or (action.action == ACTIONS.UNEQUIP and "Unequip")
		or (action.action == ACTIONS.EAT and "Eat")
		or (action.action == ACTIONS.EQUIP and "Equip")
		or (action.action == ACTIONS.DROP and "Drop")
		or (action.action == ACTIONS.HEAL and "Heal")
		or (action.action == ACTIONS.NET and "Catch")
		or (action.action == ACTIONS.ADDFUEL and "Add Fuel")
		or (action.action == ACTIONS.MURDER and "Murder")
		or (action.action == ACTIONS.HAMMER and "Hammer")
	    or (action.action == ACTIONS.MINE and "Mine")
	    or (action.action == ACTIONS.ATTACK and "Attack")
		or (action.action == ACTIONS.DIG and "Dig")
		or (action.action == ACTIONS.CHOP and "Chop")
	    or (action.action == ACTIONS.TELEPORT and "Teleport")
        or STRINGS.ACTIONS.GNAW	
		 
         or (action.action == ACTIONS.ABANDON_SHIP) 
		or (action.action == ACTIONS.USE_WEREFORM_SKILL)												
		or nil
end

5. Allow the werebeaver to eat edibles off the ground like DS,  Then I inject into playeractionpicker, but again a plethora of options have been tried. The real challenge in all of this coding is to do it only from modmain.lua , I also attach my base modmain lua and modinfo under the file "woodie tweaks"

local WEREFORM_DIET =
{
    GLOBAL.FOODTYPE.WOOD,

    GLOBAL.FOODTYPE.ROUGHAGE,
	GLOBAL.FOODTYPE.VEGGIE,
	GLOBAL.FOODTYPE.SEEDS,
	GLOBAL.FOODTYPE.BERRY,
	GLOBAL.FOODTYPE.GOODIES,
}

local WOODIE_DIET =
{
    GLOBAL.FOODTYPE.WOOD,

	GLOBAL.FOODTYPE.ROUGHAGE,
	GLOBAL.FOODTYPE.SEEDS,
	GLOBAL.FOODGROUP.OMNI,
} 
 

local function BeaverExtraRightClickPicker(inst, target, pos)
    if target ~= nil and target ~= inst and target.components.edible ~= nil and not target:HasTag("molebait") and 
	(TUNING.WOODIE_EAT_DIET == 1 or TUNING.WOODIE_EAT_DIET == 4) then
       for i, v in ipairs(WOODIE_DIET) do
                return inst.components.playeractionpicker:SortActionList({ ACTIONS.EAT }, target, nil)
				
        end
	end
  
  -- ======================================== ====================
-- Inject into PlayerActionPicker beaver and left click, right click
-- ============================================================
AddClassPostConstruct("components/playeractionpicker", function(self)
    local _OldGetLeftClickActions = self.GetLeftClickActions
    local _OldGetRightClickActions = self.GetRightClickActions

    -- Override LeftClick
    function self:GetLeftClickActions(position, target, ...)
        if self.inst ~= nil and self.inst.prefab == "woodie" and self.inst:HasTag("beaver") then
            local actions = BeaverLeftClickPicker(self.inst, target)
            if actions ~= nil then
                return actions
            end
        end
        return _OldGetLeftClickActions(self, position, target, ...)
    end

    -- Override RightClick
    function self:GetRightClickActions(position, target, ...)
        if self.inst ~= nil and self.inst.prefab == "woodie" and self.inst:HasTag("beaver") then
            local actions = BeaverRightClickPicker(self.inst, target)
            if actions ~= nil then
                return actions
            end
        end
        return _OldGetRightClickActions(self, position, target, ...)
    end
end)
  
  

 

beavercompile.zip woodie tweaks.zip

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