pitashi

Adding new structure problem :(

Recommended Posts

pitashi    0

Hello

I have problem to add new sctucture , when i click build i have this error  errorpng_qxepwxe.png

somtimes work but structure is invisible in a map.

Whats is wrong?

 

shelter1.rar

Share this post


Link to post
Share on other sites
Weexer    4

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

Edited by pitashi

Share this post


Link to post
Share on other sites
K1NGT1GER609    26

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

Share this post


Link to post
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