Jump to content

Spriter issues


Recommended Posts

I'm trying to amm new construction to the game. It should look like this:

1gnia6.gif

But it looks like this:

1gni7x.gif

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 by makar5000
  • Like 1
Link to comment
Share on other sites

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

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

  • Like 1
Link to comment
Share on other sites

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?

  • Like 1
Link to comment
Share on other sites

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?

c8958427dff087f653beb7e85fbec422.png

Click on the second set of numbers on the timeline

ss+(2016-12-27+at+10.56.36).png

select the length and click apply length

ss+(2016-12-27+at+10.57.32).png

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

ss+(2016-12-27+at+10.58.44).png

Link to comment
Share on other sites

2 minutes ago, halfrose said:

c8958427dff087f653beb7e85fbec422.png

Click on the second set of numbers on the timeline

ss+(2016-12-27+at+10.56.36).png

select the length and click apply length

ss+(2016-12-27+at+10.57.32).png

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

ss+(2016-12-27+at+10.58.44).png

No, no. I'm talking about moving images in animation. I want to moove it to the left, but it looks like this:

1gnm4c.gif

How to avoid it?

  • Like 1
Link to comment
Share on other sites

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:

1gnm4c.gif

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.

ss+(2016-12-27+at+11.11.51).png

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

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...