Jump to content

Adding new structure problem :(


Recommended Posts

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:

Link to comment
Share on other sites

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 :?

Edited by pitashi
Link to comment
Share on other sites

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)

 

Edited by K1NGT1GER609
small detail
Link to comment
Share on other sites

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
 Share

×
  • Create New...