Cunning fox Posted December 27, 2016 Share Posted December 27, 2016 (edited) I'm trying to amm new construction to the game. It should look like this: But it looks like this: What am I doing wrong? My myprefab.lua is here: require "prefabutil" require "recipe" require "modutil" local assets= { Asset("ANIM", "anim/generator.zip"), Asset("ATLAS", "images/inventoryimages/generator.xml"), Asset("IMAGE", "images/inventoryimages/generator.tex"), } local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddMiniMapEntity() inst.entity:AddNetwork() MakeObstaclePhysics(inst, 1) inst:AddTag("structure") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "generator.tex" ) inst.AnimState:SetBank("generator") inst.AnimState:SetBuild("generator") inst.AnimState:PlayAnimation("idle_loop", true) if not TheWorld.ismastersim then return inst end STRINGS.CHARACTERS.GENERIC.DESCRIBE.GENERATOR = "It's a custom prefab!" --Examine inst:AddComponent("inspectable") inst:AddComponent("workable") return inst end return Prefab( "common/generator", fn, assets, prefabs), MakePlacer( "common/generator_placer", "generator", "generator", "idle_loop" ) Edited December 27, 2016 by makar5000 1 Link to comment Share on other sites More sharing options...
halfrose Posted December 27, 2016 Share Posted December 27, 2016 oh I had my fair share of this happening to me, it is nothing to do with lua, it is spriter, when you animate a symbol in spriter, deleting it from the animation doesn't hide them when the compiler compiles the animation, I honestly don't know why but the best thing you can do to fix that is maybe make a fully transparent symbol to replace the ones you want to be invisible, or hide it behind all the other symbols. Link to comment Share on other sites More sharing options...
Cunning fox Posted December 27, 2016 Author Share Posted December 27, 2016 5 minutes ago, halfrose said: oh I had my fair share of this happening to me, it is nothing to do with lua, it is spriter, when you animate a symbol in spriter, deleting it from the animation doesn't hide them when the compiler compiles the animation, I honestly don't know why but the best thing you can do to fix that is maybe make a fully transparent symbol to replace the ones you want to be invisible, or hide it behind all the other symbols. Okay, I'll try. Thx 1 Link to comment Share on other sites More sharing options...
Cunning fox Posted December 27, 2016 Author Share Posted December 27, 2016 28 minutes ago, halfrose said: oh I had my fair share of this happening to me, it is nothing to do with lua, it is spriter, when you animate a symbol in spriter, deleting it from the animation doesn't hide them when the compiler compiles the animation, I honestly don't know why but the best thing you can do to fix that is maybe make a fully transparent symbol to replace the ones you want to be invisible, or hide it behind all the other symbols. One more question about spriter. I've got my animation, but I want to increase size of it/move it. How to make it? 1 Link to comment Share on other sites More sharing options...
halfrose Posted December 27, 2016 Share Posted December 27, 2016 1 minute ago, makar5000 said: One more question about spriter. I've got my animation, but I want to increase size of it/move it. How to make it? Click on the second set of numbers on the timeline select the length and click apply length It will look the same length however, hover your mouse over the timeline bar, hold Ctrl and use your mouse wheel and it will reveal the rest of the timeline Link to comment Share on other sites More sharing options...
Cunning fox Posted December 27, 2016 Author Share Posted December 27, 2016 2 minutes ago, halfrose said: Click on the second set of numbers on the timeline select the length and click apply length It will look the same length however, hover your mouse over the timeline bar, hold Ctrl and use your mouse wheel and it will reveal the rest of the timeline No, no. I'm talking about moving images in animation. I want to moove it to the left, but it looks like this: How to avoid it? 1 Link to comment Share on other sites More sharing options...
halfrose Posted December 27, 2016 Share Posted December 27, 2016 2 minutes ago, makar5000 said: No, no. I'm talking about moving images in animation. I want to moove it to the left, but it looks like this: How to avoid it? Oh boy, that is a bit tricky, with the free version you cannot move the center point, now, a trick you can do is to create a bone. 1 create a bone by holding alt, clicking and dragging. 2 selecting the bone, go to Edit tab and select 'Copy' 3 again in the Edit tab select, 'Paste to all Keys'. This will add the bone to every key, 4 now you will want to lick on the edge of the timeline tab and drag it up, showing all the layers and delete the keys of the bone except the first. 5 Select the bone you created, press and hold B on your keyboard and start clicking on the symbol/sprites. That will link the sprites to the bone. 6 once all of them are selected, move the bone position and it should move the entire animation. Once you are done you can delete the bone. 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