Date dependent animations

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Date dependent animations

#1

Post by Lobby »

With version 332 you will be able to show an animation only on a specific date (range). For example, if we want to show an animation with id $animationblinkingredlight3x3 (this one is built-in into the game) only on 2nd, 3rd and 4th december. Then we might add this code to our building/road plugin:

Code: Select all

    "animation":[
      {
        "id":"$animationblinkingredlight3x3","x":15,"y":-1,
        "date":{
          "start day":2,
          "start month":12,
          "days":3
        }
      }
    ],
If you want the animation on multiple date ranges with gaps in between you may provide multiple animation spots, each for a single date range.

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Date dependent animations

#2

Post by CommanderABab »

Great! :teach :json animation :)

A suggestion :mine Maybe add one for day of the week only. :) To avoid coding a perpetual calendar in each plugin. :)

User avatar
Brody Craft
Inhabitant of a Infinity
Reactions:
Posts: 8034
Joined: 24 Jan 2017, 11:15
Location: SE Asia
Plugins: Showcase Store
Version: Beta

Platform

Re: Date dependent animations

#3

Post by Brody Craft »

Can you lock animation for the amout of time you set?

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Date dependent animations

#4

Post by Lobby »

No, you cannot lock the animation, but you might do something similar by having to animations, a static and a non-static one. By switching between these two dependent on date you might create a similar effect.

You can also do it weekly or monthly by using repeat:

Code: Select all

    "animation":[
      {
        "id":"$animationblinkingredlight3x3","x":15,"y":-1,
        "date":{
          "start day":2,
          "days":3,
          "repeat":"weekly"
        }
      }
    ],
Valid arguments for repeat are yearly, monthly and weekly.

If you want to set an amount of days until it should repeat you can use days total:

Code: Select all

    "animation":[
      {
        "id":"$animationblinkingredlight3x3","x":15,"y":-1,
        "date":{
          "start day":1,
          "days":1,
          "days total":2
        }
      }
    ],
This example only shows the animation any second day.

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Date dependent animations

#5

Post by JustAnyone »

Lobby wrote:
15 Aug 2017, 14:01
No, you cannot lock the animation, but you might do something similar by having to animations, a static and a non-static one. By switching between these two dependent on date you might create a similar effect.

You can also do it weekly or monthly by using repeat:

Code: Select all

    "animation":[
      {
        "id":"$animationblinkingredlight3x3","x":15,"y":-1,
        "date":{
          "start day":2,
          "days":3,
          "repeat":"weekly"
        }
      }
    ],
Valid arguments for repeat are yearly, monthly and weekly.
Could I use the same code for notifications?

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Date dependent animations

#6

Post by Lobby »

@JustAnyone see this thread for date dependent fun :)

User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4314
Joined: 14 Sep 2017, 17:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Date dependent animations

#7

Post by THEMAX »

We can make weekly firework!!!!

User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 844
Joined: 24 Oct 2018, 13:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Date dependent animations

#8

Post by Imran M »

So, I could make a rocket fly up on December 1st, and I could make it come back on the 31st of December? I'm making a new plugin. But, I need to make two animations, one for leaving, and one for landing, and I'm thinking of using the other type of animation, like move x

User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 844
Joined: 24 Oct 2018, 13:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Date dependent animations

#9

Post by Imran M »

Oh, I dumb. I just realized it. Thanks!

User avatar
FVI
Inhabitant of a Planet
Reactions:
Posts: 1453
Joined: 22 Feb 2022, 18:00
Location: That island above France
Plugins: Showcase Store
Version: Beta

Platform

Re: Date dependent animations

#10

Post by FVI »

Lobby wrote:
14 Aug 2017, 21:11
With version 332 you will be able to show an animation only on a specific date (range). For example, if we want to show an animation with id $animationblinkingredlight3x3 (this one is built-in into the game) only on 2nd, 3rd and 4th december. Then we might add this code to our building/road plugin:

Code: Select all

    "animation":[
      {
        "id":"$animationblinkingredlight3x3","x":15,"y":-1,
        "date":{
          "start day":2,
          "start month":12,
          "days":3
        }
      }
    ],


If you want the animation on multiple date ranges with gaps in between you may provide multiple animation spots, each for a single date range.
But by doing this, will the plugin be animated on December 2, 3 and 4 in real life or on theotown?

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Date dependent animations

#11

Post by JustAnyone »

It will be animated according to the in-game time.

User avatar
FVI
Inhabitant of a Planet
Reactions:
Posts: 1453
Joined: 22 Feb 2022, 18:00
Location: That island above France
Plugins: Showcase Store
Version: Beta

Platform

Re: Date dependent animations

#12

Post by FVI »

Ok

User avatar
这太好了
Settler
Reactions:
Posts: 2
Joined: 13 Jul 2022, 05:37

怎么确认画中点的位置?

#13

Post by 这太好了 »

正当你们讨论的热火朝天的时候,我在旁边懵逼了,我不知道怎么确定点在画中的位置,谁能教教我?谢谢

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”