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.

pitashi

Adding new structure problem :(

Recommended Posts

Weexer    6

In folder scripts -> sheltertw.lua

 In lines(30-33):

local function onbuilt(inst)
	inst.AnimState:PlayAnimation("place")
	inst.AnimState:PushAnimation("idle", false)
end

You set here animation for placement as "idle"

In the same lua file in lines (118-120):

    inst.AnimState:SetBank("sheltertw")
    inst.AnimState:SetBuild("sheltertw")
    inst.AnimState:PlayAnimation("sheltertw", true)    

I think there is a problem it should look more like:

    inst.AnimState:SetBank("sheltertw")
    inst.AnimState:SetBuild("sheltertw")
    inst.AnimState:PlayAnimation("idle", true)    

Be sure that your spriter file *.scml have same value's as higher

Hope this will solve Your problem :wilsconnivingsmile:

Share this post


Link to post
Share on other sites
pitashi    0

Still have this same error :(error2png_qxernwa.png

Maybe problem is this line?

end

return Prefab( "common/objects/sheltertw", fn, assets),
        MakePlacer( "common/sheltertw__placer", "sheltertw", "sheltertw", "sheltertw" )

 

im edit Wilson_House mod and when put Wilson_House_placer no have error but structure is have wilson house graphic :?

Share this post


Link to post
Share on other sites
K1NGT1GER609    100

the last argument should be idle try this:

return Prefab( "common/objects/sheltertw", fn, Assets),
 MakePlacer( "common/sheltertw_placer", "sheltertw", "sheltertw", "idle" )

also some stuff is missing:

require "prefabutil"--near the very top not inside a function
require "modutil"

local function fn(Sim)--ur main function


    
    inst:AddTag("structure")   
    inst:AddTag("tent")
    inst:AddTag("nosleepanim")    
    inst.AnimState:SetBank("sheltertw")
    inst.AnimState:SetBuild("sheltertw")
    inst.AnimState:PlayAnimation("sheltertw", true)
 
inst.entity:SetPristine() --all this should be before theworld.ismastersim
 
 if not TheWorld.ismastersim then
        return inst
    end
 
I'm just eyeballing it but those are the most standout syntax errors I caught.if more pop up ill see what else is missing.(don't have my best computer with me atm)

 

Share this post


Link to post
Share on other sites