Jump to content

How to port DST Wendy&Abigail?


Rickzzs

Recommended Posts

Yes I am aware that there has been the QoL mod, but it didn't port everything like reworked Abigail's Flower, sisturn, pipspook, mourning glory, ghostly elixir(potion), pet health bar in HUD, plus Wendy and Abigail skins. I'm afraid that I need to change everything.

Link to comment
Share on other sites

This is my roadmap for all the stuff that is required, am I missing something? I'm really new to DS modding.

modmain (in a mess):

GLOBAL.setmetatable(env, {
    __index = function(t, k)
        return GLOBAL.rawget(GLOBAL, k)
    end
})
-- #TODO: imporve compatibility with other mods
__STRICT = false
local gmeta = getmetatable(GLOBAL)
if gmeta then
    gmeta.__index = nil
    gmeta.__newindex = nil
end
modimport("scripts/apis.lua")
utils.mod("scripts/entityapis")
-- IDE optimizationa
if not GLOBAL then
    require("scripts/apis")
    require("scripts/entityapis")
end
-- #TODO: Add Custom Speech for DS Exclusive characters

-- AddStategraphActionHandler("wilsonboating", ActionHandler(ACTIONS.CHANGEMODE, "give")) -- Need new anim!?

-- AddPrefabPostInit("abigail", function(inst)
--    inst:AddTag("keepfellowonattacked")

local function dst(inst)
    if IsDLCEnabled(REIGN_OF_GIANTS) or IsDLCEnabled(CAPY_DLC) or IsDLCEnabled(PORKLAND_DLC) then
        inst:AddComponent("waterproofer")
        inst.components.waterproofer:SetEffectiveness(TUNING.WATERPROOFNESS_SMALL)
    end
    if IsDLCEnabled(CAPY_DLC) or IsDLCEnabled(PORKLAND_DLC) then
        MakeInventoryFloatable(inst, "idle_water", "idle")
    end
end
-- Almost everyone has their favorite food, when eating the favorite food they gain 10 sanity bouns --
-- 几乎所有人物都有自己最喜欢的食物,吃最喜欢的食物额外增加10点精神值 --

-- Bug Fix: Ghosts should no longer attack on death --
-- 修复漏洞:鬼魂死后不再能进行攻击 --
local function OnDeath(inst)
    inst.components.aura:Enable(false)
    if inst.components.trader then
        inst.components.trader:Disable()
    end
end

local function death(inst)
    inst:ListenForEvent("death", OnDeath)
end

--AddPrefabPostInit("abigail", death)

local function invisible(inst)
    if inst.components.health then
        inst.components.health.fire_damage_scale = 0
        inst.components.health.canheal = false
    end
    if not inst:HasTag("invisible") then
        inst:AddTag("invisible")
    end
    if not inst:HasTag("NOBLOCK") then
        inst:AddTag("NOBLOCK")
    end
    if not inst:HasTag("flying") then
        inst:AddTag("flying")
    end
end

--AddPrefabPostInit("abigail", invisible)

utils.mod("scripts/main")

main.lua, where everything starts:

-- utils is a patched version of modutils
-- import global variables
print("DST Wendy Mod init")
utils.mod("scripts/dst/Globals")
print("DST Wendy Mod import DST vars")
-- import DST variables, the list may extend
utils.mod("scripts/dst/", {"TheNet", "netvar", "physics", "entityscript", "replica", "sim", "inventoryitematlas",
                           "action", "animstate"})
AddGamePostInit(require "dst/TheWorld") -- #TODO: I don't know when TheWorld initialize!
AddPlayerPostInit(require "dst/ThePlayer")
-- import console command
print("DST Wendy Mod import console")
utils.mod("scripts/console")
-- import recipes as a function
print("DST Wendy Mod import assets")
local xml = "images/inventoryimages_dst_wendy.xml"
local function AddDSTRecipe(name, ingredients, tech, config)
    config.atlas = xml
    return _G.Recipe2(name, ingredients, tech, config)
end
local MakeRecipes = require("dst_recipes")
MakeRecipes(AddDSTRecipe)
MakeRecipes = nil
-- import inventory images as a table
Assets = {}
local InvImages = require("dst_inventoryimages")
RegInvImage(xml, InvImages)
RegAssets(xml, InvImages)
InvImages = nil
-- import shaders
table.insert(Assets, Asset("SHADER", resolvefilepath("shaders/anim_bloom_ghost.ksh")))
-- import languages
print("DST Wendy Mod import language")
utils.mod("scripts/TranslateLanguage")
-- import tunings as a function
local DSTTuning = require("dst/tuning")
local NewTUNING = DSTTuning(TUNING)
table.mergeinto(TUNING, NewTUNING)
NewTUNING = nil
DSTTunings = nil
print("DST Wendy Mod import postinits")
-- import component postinit as a table
local ComponentPostinit = require("dst_components")
for i, v in ipairs(ComponentPostinit) do
    utils.com(v, require("postinit/" .. v))
end
ComponentPostinit = nil
-- import prefabs as a table
local AllPrefabs = require("dst_prefabs")
PrefabFiles = AllPrefabs.prefabs
for i, v in ipairs(AllPrefabs.commonpostinit) do
    utils.prefab(v, AllPrefabs.postinit)
end
for i, v in ipairs(AllPrefabs.prefabpostinit) do
    utils.prefab(v, require("postinit/" .. v))
end
AllPrefabs = nil
-- import actions as a table
print("DST Wendy Mod import actions")
local AllActions = require("dst_actions")
local AllComponentActions = require("dst_componentactions")
utils.mod("scripts/ActionUtils")
AddDSTComponentActions(AllComponentActions)
AddDSTActions(AllActions)
AllActions = nil
AllComponentActions = nil
-- import stategraph
local AllSG = require("dst_sg")
utils.mod("scripts/SGUtils")
AddDSTSG(AllSG)
-- import brain
-- nothing to do
-- import skins
print("DST Wendy Mod import skins")
utils.mod("scripts/SkinUtils")
-- use some skin API
-- #TODO: is there any?

-- #TODO: add sound
Link to comment
Share on other sites

Well, I want to know how much you know about the DST's code (although this has little to do with the DS, I think the deeper you know about the code, the better things you can produce). I think your code is only applicable to the DST (I don't have much contact with DST, but I can still see a little.) For example, DS does not have TheNet and TheWorld. As for other things, I don't know whether it is effective. I will observe it for a while. The following code should be used in modmain:

GLOBAL.setmetatable(env,{__index=function(t,k) return GLOBAL.rawget(GLOBAL,k) end})

 

Link to comment
Share on other sites

I am familiar with DST modding but I find DS lacking many functions.

I have encountered the following problems, hoping you and @Leonidas IV could answer.

1.custom shader

    inst.AnimState:SetBloomEffectHandle("shaders/anim_bloom_ghost.ksh")

When this line is executed, the animmanager assert fails

2.TheWorld, ThePlayer

When do these variables show up?

function(inst)
    inst = GetPlayer()
    if inst and not _G.ThePlayer then
        _G.ThePlayer = inst
    end
    if inst and #AllPlayers == 0 then
        table.insert(AllPlayers, inst)
    end
end

I want to do this, but is there any way that best does this? Currently I hook ThePlayer and use AddPlayerPostInit. And what will happen if I spawn some more players?

So does TheWorld.state:

function(inst)
    inst = inst or GetWorld()
    if inst and not inst.ismastersim then
        inst.ismastersim = true
        inst.state = {}
        setmetatable(inst.state, {
            __index = function(_, k)
                return GetClock()[k]
            end,
            __newindex = function(_, k, v)
                GetClock()[k] = v
            end
        })
    end
end

3.dynamic anim folder issue

I ported Wendy skins, but if I place them in anim/dynamic/, animmanager assert fails after saying "loading dynamic asset", unless they are moved to anim/

I want to give anyone an attention that these files are special.

4.any console improvement mod or trick?

The console is really simple compared to DST. I find many functions I'm familiar with missing here, like c_select()

5.Where is RegisterInventoryItemAtlas?

Where can I find this??? Is this functionality totally missing in DS?

6.It seems that AnimState:GetBuild is gone, anyone done such job?

I know I can patch AnimState, but has anyone done this work so that I can copy&paste?

7.MakeInventoryFloatable needs new animation?

In DST the floating animation is not a new one. But I see some instances where there are two anim names passed to MakeInventoryFloatable. I'm afraid can't create new animations.

8.DLC content difference

Since this is a port, I'd like to change some things to adapt to DS worlds. For example in Hamlet there is no grave to naturally spawn pipspooks, so I'll introduce the QoL that Mourning Glories spawned near sisturn when petals rot.

Despite the fact that I'm an early player playing from RoG to SW, and now to DST, I'm new to Hamlet and DS without DLC, so to speak. I don't know much about the two worlds.

Quote

Well, I want to know how much you know about the DST's code (although this has little to do with the DS, I think the deeper you know about the code, the better things you can produce). I think your code is only applicable to the DST (I don't have much contact with DST, but I can still see a little.) For example, DS does not have TheNet and TheWorld. As for other things, I don't know whether it is effective. I will observe it for a while. The following code should be used in modmain

I'm doing the patch thing. Patch everything so that DST codes can run smoothly within DS, without more modifications each prefab file.

For example, patch netvar, DST modders will know what I am doing

-- Regardless of type, not so important anyway
local meta = {}
function meta:value()
    return self.val
end
function meta:set(v)
    self.val = v
    if self.localvalue then
        self:push()
        self.localvalue = nil
    end
end
function meta:set_local(v)
    self.localvalue = v
    self.val = v
end
function meta:push()
    if self.event then
        if Ents[self.guid] then
            Ents[self.guid]:PushEvent(self.event)
        end
    end
end
local netvar = function()
    local newvar = {
        guid = guid,
        name = name,
        event = event,
        val = nil,
        localvalue = nil
    }
    setmetatable(newvar, {
        __index = meta
    })
    return newvar
end
expose {
    net_bool = netvar,
    net_tinybyte = netvar,
    net_smallbyte = netvar,
    net_byte = netvar,
    net_shortint = netvar,
    net_ushortint = netvar,
    net_uint = netvar,
    net_int = netvar,
    net_float = netvar,
    net_hash = netvar,
    net_strihg = netvar,
    net_entity = netvar,
    net_byteartay = netvar,
    net_smallbyteartay = netvar,
    net_event = netvar
}

Proof of Progress:

Snipaste_2022-10-16_00-40-09.png.5340ec8fa1e70dc63b4dece6512fe66b.png

Link to comment
Share on other sites

Quote

custom shader

You need to load the asset:

Asset("SHADER", "shaders/anim_bloom_ghost.ksh")

 

Quote

TheWorld, ThePlayer

These variables don't exist in DS and you can replace them with GetPlayer() and GetWorld().

About "spawning more players", I don't understand, DS is a singleplayer game, how will it have more players? The AllPlayers variable doesn't make sense.

I understand that you are trying to define what is used in the DST files, but >I< believe it is easier to just change what is needed.

 

Quote

dynamic anim folder issue

Ds doesn't have the dynamic asset system, because there are no skins. What the skins mod does is transform the .dyn into .zip and use it as a normal anim. But extracting dyns is illegal.

 

Quote

any console improvement mod or trick?

Here are the ones I use:

Quote

 

Spoiler
GLOBAL.setmetatable(env,{__index=function(t,k) return GLOBAL.rawget(GLOBAL,k) end})
 
-- Console Commands
 
_G.CHEATS_ENABLED = true
require('debugkeys')
 
function _G.DumpBT(bnode, indent)
    indent = indent or 0
 
    local s = ""
    for i=1,indent do
        s = s.."|   "
    end
    local name = s..bnode.name
    nolineprint(name)
   
    if bnode.children then
        for i,childnode in ipairs(bnode.children) do
            DumpBT(childnode, indent+1)
        end
    else
        for i, k in pairs(bnode) do
            nolineprint(s.."|   ".. i .. " = ".. tostring(k))
        end
    end
end
 
function _G.DT(_table, force_indent, indent, inst_GUIDS)
    if type(_table) ~= "table" then
        return nolineprint(string.format("Variable:  %s    (%s)", _table, type(_table)))
    end
 
    inst_GUIDS = inst_GUIDS or {}
 
    if _table.GUID then
        if inst_GUIDS[_table.GUID] then return end
        inst_GUIDS[_table.GUID] = true
    end
 
    if not indent then
        local inst = (_table.inst and _table.inst.prefab) or _table.name or "dump table!"
        nolineprint("\n")
        nolineprint(string.upper(inst))
    end
 
    indent = indent or 1
 
    local s = ""
    for i=1, indent do
        s = s.."|   "
    end
 
    indent = force_indent or indent
 
    for k, v in pairs(deepcopy(_table)) do
        if type(k) == "table" then k = "{...}" end
        if k == "inst" or k == "task" then v = nil end
       
        local v_is_table = type(v) == "table"
 
        if v == nil then
         -- Do Nothing...
 
        elseif v_is_table and not next(v) then
            nolineprint(s..k .. " = { }")
 
        elseif v_is_table and indent < 4 then
            nolineprint(s..k.. " >")
            DT(v, nil, indent+1, inst_GUIDS)
 
        else
            nolineprint(s..k .. " = ".. (v_is_table and "{...}" or tostring(v)))
        end
    end
end


 
function _G.DTT(_table)
    DT(_table, 5)
end
 
function _G.c_removeall(prefab)
    local count = 0
    for _, ent in pairs(Ents) do
        if ent.prefab and ent.prefab == prefab then
            ent:Remove()
            count = count + 1
        end
    end
    print(count, " entities removed.")
end
 
function _G.printfab()
    print(c_select().prefab)
end
 
function _G.c_revealmap()
    GetWorld().minimap.MiniMap:ShowArea(0,0,0,10000)
end
 
local function GetArgs(func, info)
    local args = {}
    info = info or debug.getinfo(func)
    for i = 1, info.nparams, 1 do
        local param = debug.getlocal(func, i)
        if param ~= "self" then
            table.insert(args, param)
        end
    end
 
    if info.isvararg then
        table.insert(args, "...")
    end
 
    return table.concat(args, ", ")
end
 
local function pprint(str)
    nolineprint("\t"..str)
end
 
function _G.FnHelp(fn)
    if type(fn) ~= "function" then
        return pprint(('"%s" is not a function.'):format(fn))
    end
 
    local info = debug.getinfo(fn)
 
    if info.what == "C" then
        return pprint("C side functions don't have acessible info...")
    end
 
    local parse_str = "/data/"
    local parse_index = info.source:find(parse_str)
    local source = parse_index and info.source:sub(parse_index + #parse_str, #info.source) or info.source
 
    pprint(("Defined at:  %s:%s"):format(source, info.linedefined))
    pprint(("Parameters:  (%s)"):format(GetArgs(fn, info)))
end
 
local class_fns = {"__index", "_ctor", "is_a", "__newindex"}
local buildin_types = {"string", "number", "function", "boolean"}
 
function _G.GetFns(table_, _inMetatable)
    if type(table_) ~= "table" then
        if not table.contains(buildin_types, type(table_)) then
            table_ = getmetatable(table_).__index
        else
            return pprint(('\n \n"%s" is not a table.\n'):format(table_))
        end
    end
 
    local fns = {}
    local index = 0
    for k, v in pairs(table_) do
        if type(v) == "function" and not table.contains(class_fns, k) then
            local string = string.format("%s(%s)", k, GetArgs(v))
           
            print(string)
            table.insert(fns, string .. "\t" .. string.rep(" ", 40-#string))
            index = index + 1
            if index % 3 == 0 then
                table.insert(fns, "\n")
            end
        end
    end
 
    if #fns ~= 0 then
        nolineprint("\n \n", table.concat(fns))
        nolineprint("")
    elseif not _inMetatable then
        GetFns(getmetatable(table_), true)
    else
        pprint("The table don't contains any function.")
    end
end
 
AddGlobalDebugKey(KEY_END, function()
    TheSim:ResetErrorShown()
    --FrontEnd:ShowTitle("RESTARTING...")
    TheFrontEnd:HideConsoleLog()
    TheSim:SetDebugRenderEnabled(false)
   
    TheFrontEnd:Fade(false, 1, function()
        EnableAllDLC()
        StartNextInstance()
    end)
end)
 
_G.c_circle = function(radius, prefab)
    local inst = c_select() or GetPlayer()
    local pt = Vector3(inst.Transform:GetWorldPosition())
    local theta = math.random() * 2 * math.pi
    local itemdensity = 0.5 --(X items per unit)
   
    local circ = 2*math.pi*radius
    local numitems = circ * itemdensity
 
    for i = 1, numitems do
        local offset = Vector3(radius * math.cos( theta ), 0, -radius * math.sin( theta ))
        local wander_point = pt + offset
        local spawn = SpawnPrefab(prefab or "blueprint")
        spawn.Transform:SetPosition( wander_point.x, wander_point.y, wander_point.z )    
        theta = theta - (2 * math.pi / numitems)
    end
end
 
------------------------------------------------------------------------------------
 
local NewReignMod = "A-New-Reign-Solo-Mod"
if KnownModIndex and KnownModIndex.savedata and KnownModIndex:IsModEnabled(NewReignMod) then
    return
end
 
_G.we = function()
    local components = GetPlayer().components
   
    components.builder:GiveAllRecipes()
 
    c_sethunger(1)
    c_sethealth(1)
    if c_setboathealth then c_setboathealth(1) end
    c_setsanity(1)
    c_speed(3)
 
    if components.moisture then
        components.moisture:SetMoistureLevel(0)
    end
 
    if components.poisonable then
        components.poisonable:Cure()
    end
 
    components.temperature:SetTemperature(25)
   
    if not components.health:IsInvincible() then
        c_godmode()
    end
end
 
 ---------------------------------------------
 
_G.c_save = function ()
    if not GetPlayer() then return end
    GetPlayer().components.autosaver:DoSave()
end
 
 ---------------------------------------------
 
 function _G.c_reset()
    GetPlayer().HUD:Hide()
    TheFrontEnd:HideConsoleLog()
    TheSim:SetDebugRenderEnabled(false)
 
    TheFrontEnd:Fade(false, 1, function()
        StartNextInstance(
            {
                reset_action=RESET_ACTION.LOAD_SLOT,
                save_slot = SaveGameIndex:GetCurrentSaveSlot()
            },
            true
        )
    end)
end
 
 ---------------------------------------------
 
 _G.c_reload = function()
    c_save()
    GetPlayer():DoTaskInTime(3, c_reset)
end
 
_G.c_sanity = function(n)
    c_setsanity(n)
end
 
_G.c_wet = function(n)
    local wet = GetPlayer().components.moisture
    if wet then wet:SetMoistureLevel(n) end
end
 
function ConsoleWorldEntityUnderMouse()
    if TheInput.overridepos == nil then
        return TheInput:GetWorldEntityUnderMouse()
    else
        local x, y, z = TheInput.overridepos:Get()
        local ents = TheSim:FindEntities(x, y, z, 1)
        for i, v in ipairs(ents) do
            if v.entity:IsVisible() then
                return v
            end
        end
    end
end
 
function ConsoleWorldPosition()
    return TheInput.overridepos or TheInput:GetWorldPosition()
end
 
function _G.c_select(inst)
    if not inst then
        inst = ConsoleWorldEntityUnderMouse()
    end
    print("Selected: "..tostring(inst or "<nil>") )
    SetDebugEntity(inst)
    return inst
end
 
_G.s   = c_select
_G.sc  = function() return c_select().components end
_G.Pl  = function() return GetPlayer() end
_G.Plc = function() return GetPlayer().components end
_G.Wo  = function() return GetWorld() end
_G.Woc = function() return GetWorld().components end
 
function _G.c_setpeice(name, raw_name) -- eaw_name is a BOOL
    local obj_layout = require("custom_object_layout")
    local entities = {}
    local map_width, map_height = GetWorld().Map:GetSize()
    local add_fn = {
        fn=function(prefab, points_x, points_y, current_pos_idx, entitiesOut, width, height, prefab_list, prefab_data, rand_offset)
                local x = (points_x[current_pos_idx] - width/2.0)*TILE_SCALE
                local y = (points_y[current_pos_idx] - height/2.0)*TILE_SCALE
                x = math.floor(x*100)/100.0
                y = math.floor(y*100)/100.0
                SpawnPrefab(prefab).Transform:SetPosition(x, 0, y)
        end,
        args={entitiesOut=entities, width=map_width, height=map_height, rand_offset = false, debug_prefab_list=nil}
    }
 
    local x, y, z = ConsoleWorldPosition():Get()
    x, z = GetWorld().Map:GetTileCoordsAtPoint(x, y, z)
    obj_layout.Place({math.floor(x), math.floor(z)}, name, add_fn, nil, raw_name)
end

 

 

Quote

Where is RegisterInventoryItemAtlas?

This doesn't exist on the DS and basically it's pretty tedious to get everything working. I have an API for that: [API] Inventory Images

 

Quote

It seems that AnimState:GetBuild is gone

This function doesn't exist on the DS, and I've never seen anyone mimic it yet. I know the build can be taken from DebugString with regex, but you can hook AnimState too.

 

Quote

MakeInventoryFloatable needs new animation?

Yes. You can port the DST system or make changes to the images and use the default animation provided in this template: Extended Sample Character Shipwrecked

 

Hope I helped.
Cheers :)

Ok I see you already loaded the shader, but I think you need a resolvefilepath instead of a softresolvefilepath.

About the animations on the boat, you can use my method, in which I make the original boat appear during the animation and then hide it again (character animations have the boat as a symbol, why? Good question)

My method is in bug fixes mod, the function is defined in scripts/utils.lua and used in scripts/bug_fixes/shipwrecked.lua

Link to comment
Share on other sites

1. Assert failure 'h != INVALID_RESOURCE_HANDLE' at ..\source\game\components\AnimStateComponent.cpp(807): Trace follows...

--main.lua
table.insert(Assets, Asset("SHADER", resolvefilepath("shaders/anim_bloom_ghost.ksh")))
--abigail.lua
inst.AnimState:SetBloomEffectHandle("shaders/anim_bloom_ghost.ksh")

2.c_spawn("wendy")

Snipaste_2022-10-16_09-36-12.thumb.png.72b9ac0dab5b560dd11753cc551d01a2.png

3.Is there exact reason why I can't place animation files elsewhere? Or anim/dynamic/ in DS is a special directory? I'll try.

4.Thanks for your API, I decide to port DST functions together with yours. But it looks that DST implementation is a bit different (I already patched the missing functions like TheSim:AtlasContains so don't worry):

function RegisterInventoryItemAtlas(atlas, imagename)
    if atlas ~= nil and imagename ~= nil then
        if inventoryItemAtlasLookup[imagename] ~= nil then
            if inventoryItemAtlasLookup[imagename] ~= atlas then
                print("RegisterInventoryItemAtlas: Image '" .. imagename .. "' is already registered to atlas '" ..
                          atlas .. "'")
            else
                return -- added
            end
        end
        -- else --deleted
        inventoryItemAtlasLookup[imagename] = atlas
        -- compatible with API
        if TheInvImagesAPI then
            TheInvImagesAPI.atlasLookup[imagename] = atlas
        end
    end
end
function GetInventoryItemAtlas(imagename, no_fallback)
    local atlas = inventoryItemAtlasLookup[imagename]
    if atlas then
        return atlas
    end
    local base_atlas = InventoryItemAtlas.defaultatlas -- changed, DS name is "inventoryimages" and "inventoryimages_2"
    local alt_atlas = HAMenabled and "images/inventoryimages_2.xml" or "" -- Hamlet compatibility added
    atlas = TheSim:AtlasContains(base_atlas, imagename) and base_atlas or
                (not no_fallback or TheSim:AtlasContains(alt_atlas, imagename)) and alt_atlas or nil
    if atlas then
        inventoryItemAtlasLookup[imagename] = atlas
    end
    return atlas
end

So it is better to be more compatible:

local old = _G.Ingredient.GetAtlas
if old then
    function _G.Ingredient:GetAtlas(imagename)
        self.atlas = ChangedGetAtlas(imagename, self.atlas) or old(self, imagename)
        return self.atlas
    end
else
    function _G.Ingredient:GetAtlas(imagename)
        self.atlas = ChangedGetAtlas(imagename, self.atlas)
        return self.atlas
    end
end
local old = _G.Recipe.GetAtlas
if old then
    function _G.Recipe:GetAtlas()
        self.atlas = ChangedGetAtlas(self.image, self.atlas) or old(self)
        return self.atlas
    end
else
    function _G.Recipe:GetAtlas()
        self.atlas = ChangedGetAtlas(self.image, self.atlas)
        return self.atlas
    end
end

5.DST Floating anim uses AnimState:SetFloatParams, but what about SW? I don't know how to patch such function regarding animation.

6.Speaking of boat, can I either ignore "swap_boat"(or such thing) or add this symbol from existing DS characer anim file? I don't want to draw it apparently.

7.After importing abigailbrain, she seems to be stuck moving. What's the cause? I guess locomotor missing functions?

edit: I messed up trader component, never mind.

 

8.How to extract sound files and recompile them? I have little knowledge about this. This sounds are under "dontstarve/characters/wendy/abigail/".

Link to comment
Share on other sites

Quote

2.c_spawn("wendy")

I don't know why you stick to multiple players (even if they are generated through the console, they are also uncontrollable targets, unless you want to... make them your followers or something like that). Well, if you want to use AllPlayers, there is no problem. Try the following code: 

local AllPlayers = {}
for k,v in pairs (Ents) do
    if v ~= nil and v:HasTag("player") then
	    table.insert(AllPlayers, v)
	end
end

 

Quote

5.DST Floating anim uses AnimState:SetFloatParams, but what about SW? I don't know how to patch such function regarding animation.

This is irreversible. The only thing you can do is to modify anim file (adding 'idle_water').

Link to comment
Share on other sites

Quote

I don't know why you stick to multiple players (even if they are generated through the console, they are also uncontrollable targets, unless you want to

Technically ThePlayer always point to the local player in DST, but AddPlayerPostInit is not so safe if I spawn more players. If I do not initialize ThePlayer once for all, the newly spawned entities with player tag will interfere with AddPlayerPostInit causing unexpected behaviors.

Yet as a desirable feature I do want AllPlayers mimic itself in DST. For instance Abigail's flower utilize this to play its ground animation.

Quote

This is irreversible. The only thing you can do is to modify anim file (adding 'idle_water')

I'll pay attention to the floating part when it comes to SW. The priority now is vanilla DS and RoG. This information is really precious.

Link to comment
Share on other sites

Quote

Speaking of boat, can I either ignore "swap_boat"(or such thing) or add this symbol from existing DS characer anim file? I don't want to draw it apparently.

I don't recommend adding symbol unless you are confident of success. 

Quote

3.Is there exact reason why I can't place animation files elsewhere? Or anim/dynamic/ in DS is a special directory? I'll try.

You have to put it in 'anim'. Others should not be allowed. I don't know the specific reason.

Link to comment
Share on other sites

The mod is published for now and indeed many things are still not implemented. However, since I have to handle the animation files it is expected that the work will not be done very soon. And I hope that the code is available for anyone to check right now.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...