Page 1 of 1

Date dependent animations

Posted: 14 Aug 2017, 21:11
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.

Re: Date dependent animations

Posted: 14 Aug 2017, 21:27
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. :)

Re: Date dependent animations

Posted: 15 Aug 2017, 10:59
by Brody Craft
Can you lock animation for the amout of time you set?

Re: Date dependent animations

Posted: 15 Aug 2017, 14:01
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.

Re: Date dependent animations

Posted: 01 Nov 2017, 09:31
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?

Re: Date dependent animations

Posted: 01 Nov 2017, 13:11
by Lobby
@JustAnyone see this thread for date dependent fun :)

Re: Date dependent animations

Posted: 01 Nov 2017, 20:11
by THEMAX
We can make weekly firework!!!!

Re: Date dependent animations

Posted: 02 Dec 2018, 15:26
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

Re: Date dependent animations

Posted: 03 Dec 2018, 23:22
by Imran M
Oh, I dumb. I just realized it. Thanks!

Re: Date dependent animations

Posted: 03 Jun 2022, 23:23
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?

Re: Date dependent animations

Posted: 03 Jun 2022, 23:26
by JustAnyone
It will be animated according to the in-game time.

Re: Date dependent animations

Posted: 04 Jun 2022, 10:27
by FVI
Ok

怎么确认画中点的位置?

Posted: 22 Jul 2023, 07:57
by 这太好了
正当你们讨论的热火朝天的时候,我在旁边懵逼了,我不知道怎么确定点在画中的位置,谁能教教我?谢谢