pitashi Posted December 6, 2017 Share Posted December 6, 2017 Hello I have problem to add new sctucture , when i click build i have this error somtimes work but structure is invisible in a map. Whats is wrong? shelter1.rar Link to comment Share on other sites More sharing options...
Weexer Posted December 7, 2017 Share Posted December 7, 2017 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 Link to comment Share on other sites More sharing options...
pitashi Posted December 7, 2017 Author Share Posted December 7, 2017 (edited) Still have this same error 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 December 7, 2017 by pitashi Link to comment Share on other sites More sharing options...
K1NGT1GER609 Posted December 8, 2017 Share Posted December 8, 2017 (edited) 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 December 8, 2017 by K1NGT1GER609 small detail Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now