Date dependent animations

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
Previous topicNext topic
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Date dependent animations

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: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Date dependent animations

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. :)
my avatar:
User avatar
Brody Craft
Inhabitant of a Infinity
Reactions:
Posts: 8034
Joined: 24 Jan 2017, 09:15
Location: SE Asia
Plugins: Showcase Store
Version: Beta

Platform

Re: Date dependent animations

Post by Brody Craft »

Can you lock animation for the amout of time you set?
When you get to be called a Board Index because you are too good.>:3
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Date dependent animations

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
Honorary Contributor
Reactions:
Posts: 3666
Joined: 23 Jul 2017, 10:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Date dependent animations

Post by JustAnyone »

Lobby wrote: 15 Aug 2017, 12: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?
:pickle:
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Date dependent animations

Post by Lobby »

@JustAnyone see this thread for date dependent fun :)
User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4313
Joined: 14 Sep 2017, 15:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Date dependent animations

Post by THEMAX »

We can make weekly firework!!!!
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact
User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 834
Joined: 24 Oct 2018, 11:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Date dependent animations

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
I just love the DOPE-amine you get after completing a plugin!
User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 834
Joined: 24 Oct 2018, 11:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Date dependent animations

Post by Imran M »

Oh, I dumb. I just realized it. Thanks!
I just love the DOPE-amine you get after completing a plugin!
User avatar
FVI
Inhabitant of a Galaxy Cluster
Reactions:
Posts: 2442
Joined: 22 Feb 2022, 16:00
Location: The largest island in Europe
Plugins: Showcase Store
Version: Beta

Platform

Re: Date dependent animations

Post by FVI »

Lobby wrote: 14 Aug 2017, 19: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?
My YT channel! https://www.youtube.com/@FVI297

(Changed the location writing, the old one sounded bad)
User avatar
JustAnyone
Honorary Contributor
Reactions:
Posts: 3666
Joined: 23 Jul 2017, 10:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Date dependent animations

Post by JustAnyone »

It will be animated according to the in-game time.
User avatar
FVI
Inhabitant of a Galaxy Cluster
Reactions:
Posts: 2442
Joined: 22 Feb 2022, 16:00
Location: The largest island in Europe
Plugins: Showcase Store
Version: Beta

Platform

Re: Date dependent animations

Post by FVI »

Ok
My YT channel! https://www.youtube.com/@FVI297

(Changed the location writing, the old one sounded bad)
User avatar
这太好了
Settler
Reactions:
Posts: 2
Joined: 13 Jul 2022, 03:37

怎么确认画中点的位置?

Post by 这太好了 »

正当你们讨论的热火朝天的时候,我在旁边懵逼了,我不知道怎么确定点在画中的位置,谁能教教我?谢谢
黑
黑色高级市长
Settler
Reactions:
Posts: 6
Joined: 15 Nov 2022, 10:56

Re: 怎么确认画中点的位置?

Post by 黑色高级市长 »

这太好了 wrote: 22 Jul 2023, 05:57 正当你们讨论的热火朝天的时候,我在旁边懵逼了,我不知道怎么确定点在画中的位置,谁能教教我?谢谢
Tr. While you are discussing this heatedly, I am confused. I don't know how to determine the position of the point in the painting. Can anyone teach me? Thank you
请使用英文发言。
Please speak in English.
Previous topicNext topic