Animation problem
Posted: 14 Oct 2022, 07:18
I were trying to make a walls through animation system, but the animation divided on two SAME frames, not two different.
A feature rich city builder game for Android, iOS and PC
https://forum.theotown.com/
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
]
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
]
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}
]
}]
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},
...
]
}]
It's hard to figure out what's wrong without the JSON. Please post it here (just for that specific wall + 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}]
}
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}
]
}
There will be a plugin about service buildings, it's on checking nowTheOfficialLSC 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?