Animation problem

Plugin specific problems will be solved here.

Moderators: Scenario Moderators, Plugin Moderators

User avatar
DaRK72
Villager
Posts: 16
Joined: 18 Dec 2020, 12:45

Animation problem

#1

Post by DaRK72 »

I were trying to make a walls through animation system, but the animation divided on two SAME frames, not two different.
Lokivu_22-10-14_08.16.30.png
Screenshot_2022-10-14-08-17-31-48_87c2225eebc34d2513fa0e7ad5b93cfc.jpg
Screenshot_2022-10-14-08-17-33-90_87c2225eebc34d2513fa0e7ad5b93cfc.jpg
Screenshot_2022-10-14-08-17-48-18_87c2225eebc34d2513fa0e7ad5b93cfc.jpg
Screenshot_2022-10-14-08-17-54-90_87c2225eebc34d2513fa0e7ad5b93cfc.jpg

User avatar
Bearbear76
Former Bearbear65
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: Animation problem

#2

Post by Bearbear76 »

You can set different animations for different frames:

Code: Select all

"frames": [{...}], // 2 frames in here
"animation": [
	{"id": "$example_animation1", "frame": 0}, // This animation is only displayed for the first frame
	{"id": "$example_animation2", "frame": 1}  // This animation is only displayed for the second frame
]
You could also use this (which is supposed to do the same thing but I haven't tested it):

Code: Select all

"frames": [{...}], // 2 frames in here
"animation": [
	{"id": "$example_animation1"},
	{"id": "$example_animation2"}
],
"frame animation indicies": [
	[0], // Use the first animation (i.e. $example_animation1) for the first frame
	[1]  // Use the second animation (i.e. $example_animation2) for the second frame
]
In your case you could write something like this (I used the first method as it's easier to copy and paste 8-) ):

Code: Select all

[
{
	"id": "$modpanel_animation1",
	"type": "animation",
	"frames": [
		{"bmp": "wall1.png", "x": 0, "w": 16}
	]
},
{
	"id": "$modpanel_animation2",
	"type": "animation",
	"frames": [
		{"bmp": "wall1.png", "x": 16, "w": 16}
	]
},
{
	"id": "$modpanel_example",
	"type": "fence",
	"category": "$modpanelcat01",
	"frames": [
		{"bmp": "wall1.png", "w": 16, "handle y": 8, "count": 2}
	],
	"animation": [
		{"id": "$modpanel_animation1", "frame": 0, "y": -14},
		{"id": "$modpanel_animation1", "frame": 0, "y": -20},
		{"id": "$modpanel_animation1", "frame": 0, "y": -26},
		{"id": "$modpanel_animation2", "frame": 1, "y": -14},
		{"id": "$modpanel_animation2", "frame": 1, "y": -20},
		{"id": "$modpanel_animation2", "frame": 1, "y": -26}
	]
}]
makes a nice wall. :)
makes a nice wall. :)
Screenshot from 2022-10-15 13-01-21.png (31.69 KiB) Viewed 3696 times
Also, when posting code don't upload images instead post the text inside [сode][/code], it's easier for us to look at it. ;)
I couldn't figure out how to combine the animation and select a specific animation frame though. Someone has to help me there (if it's possible). :bt

Code: Select all

[{
	"id": "$modpanel_animation",
	"type": "animation",
	"frames": [
		{"bmp": "wall1.png", "w": 16, "count": 2}
	]
},
{
...
	"animation": [
		{"id": "$modpanel_animation", <get the first frame of the animation>, "frame": 0, "y": -14},
		...
		{"id": "$modpanel_animation", <get the second frame of the animation>, "frame": 1, "y": -14},
		...
	]
}]

User avatar
DaRK72
Villager
Posts: 16
Joined: 18 Dec 2020, 12:45

Re: Animation problem

#3

Post by DaRK72 »

It really worked! Thanks!

But i have one small issue with animation. That white things ain't the part of animation, but they somehow appears.
Lokivu_22-10-17_09.10.07.png

User avatar
Bearbear76
Former Bearbear65
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: Animation problem

#4

Post by Bearbear76 »

DaRK72 wrote:
17 Oct 2022, 08:22
It really worked! Thanks!

But i have one small issue with animation. That white things ain't the part of animation, but they somehow appears.
Lokivu_22-10-17_09.10.07.png
It's hard to figure out what's wrong without the JSON. Please post it here (just for that specific wall + animations). :json

User avatar
DaRK72
Villager
Posts: 16
Joined: 18 Dec 2020, 12:45

Re: Animation problem

#5

Post by DaRK72 »

That's animations

Code: Select all

{
    "type": "animation",
    "id": "WALL11MID",
    "frames": [{"bmp": "WALL11MID.png","h":16,"w":16}]
    },
    {
    "type": "animation",
    "id": "WALL11TOP",
    "frames": [{"bmp": "WALL11TOP.png","h":16,"w":16}]
    },
    {
    "type": "animation",
    "id": "WALL11MIDR",
    "frames": [{"bmp": "WALL11MID.png","h":16,"w":16,"x":16}]
    },
    {
    "type": "animation",
    "id": "WALL11TOPR",
    "frames": [{"bmp": "WALL11TOP.png","h":16,"w":16,"x":16}]
    }
And that's for wall

Code: Select all

{
    "id": "$modpanelwall722",
    "title":"wall 11",
    "type": "fence",
    "category":"$modpanelcat10",
    "frames": [
      {"bmp":"WALL11BASE.png", "h":16,"w":16,"count":2,"handle y": 5}     
    ],
    "price": 100,
    "animation": 
[
{"id": "WALL11MID", "frame":0, "x": 0, "y": -11},
{"id": "WALL11MIDR", "frame":1, "x": 0, "y": -11},
{"id": "WALL11MID", "frame":0, "x": 0, "y": -17},
{"id": "WALL11MIDR", "frame":1, "x": 0, "y": -17},
{"id": "WALL11MID", "frame":0, "x": 0, "y": -23},
{"id": "WALL11MIDR", "frame":1, "x": 0, "y": -23},
{"id": "WALL11MID", "frame":0, "x": 0, "y": -29},
{"id": "WALL11MIDR", "frame":1, "x": 0, "y": -29},
{"id": "WALL11MID", "frame":0, "x": 0, "y": -35},
{"id": "WALL11MIDR", "frame":1, "x": 0, "y": -35},
{"id": "WALL11MID", "frame":0, "x": 0, "y": -41},
{"id": "WALL11MIDR", "frame":1, "x": 0, "y": -41},
{"id": "WALL11MID", "frame":0, "x": 0, "y": -47},
{"id": "WALL11MIDR", "frame":1, "x": 0, "y": -47},
{"id": "WALL11MID", "frame":0, "x": 0, "y": -53},
{"id": "WALL11MIDR", "frame":1, "x": 0, "y": -53},
{"id": "WALL6TOP", "frame":0, "x": 0, "y": -59},
{"id": "WALL6TOPR", "frame":1, "x": 0, "y": -59}
]
}

User avatar
DaRK72
Villager
Posts: 16
Joined: 18 Dec 2020, 12:45

Re: Animation problem

#6

Post by DaRK72 »

UPD:

I just set h:13 instead of h:16 and it worked!

User avatar
ETTOfficial
Inhabitant of a Megacity
Posts: 296
Joined: 23 Oct 2021, 08:09
Location: Philippines
Plugins: Showcase Store

Plugin Creator

Platform

Re: Animation problem

#7

Post by ETTOfficial »

That's a pretty good plugin! I might have just used it for making custom buildings.

Can you make some more modulable plugins like this?

User avatar
DaRK72
Villager
Posts: 16
Joined: 18 Dec 2020, 12:45

Re: Animation problem

#8

Post by DaRK72 »

TheOfficialLSC wrote:
23 Oct 2022, 08:52
That's a pretty good plugin! I might have just used it for making custom buildings.

Can you make some more modulable plugins like this?
There will be a plugin about service buildings, it's on checking now

Post Reply Previous topicNext topic

Return to “Problems”