Date dependent fun condition

Any information about the fun attribute is given here.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3380
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Date dependent fun condition

#1

Post by Lobby » Sun Oct 22, 2017 20:54

Since 369 there's a condition for fun to check for a specific date/range.

To do so, use condition type:"date" and define a range using min and max (or z if you want a specific day instead of a range of days). For example, z:0 would mean the 1st day of each year (0 <-> 1 because of how we count in computer science). Here's a sample code that triggers a notification:

Code: Select all

[
  {
    "id":"$notify_test01","type":"notification","text":"I AM SO <..>","frames":[{"steal":"$anim_people_source01","frame":0}]
  },
  
  {
    "id":"$invisible building","type":"decoration","hidden":true,"width":1,"height":1,"frames":[null],
    "random fun":[
      {
        "condition": {
          "type": "date",
          "z": 7  // 8th day of the year
        },
        "actions": [
          {
            "type": "notify",
            "id": "$notify_test01"
          }
        ]
      }
    ]
  }
]
In case you want the condition to be true each week for example just use frame:7. By default frame has a value of 12*30=a year.
...Have a nice stay

User avatar
CommanderABab
AB
Reactions:
Posts: 7923
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Date dependent fun condition (369)

#2

Post by CommanderABab » Sun Oct 22, 2017 21:12

Blue animals be gone! :)

May

Code: Select all

"p":1
still be used in the actions?
777!777Currently using alpha 777. 777 What's new? :)
online maps!!
:)

Telegram - t.me/
πŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈCommanderπŸ†ŽοΈπŸ†ŽοΈ

User avatar
Lobby
Developer
Reactions:
Posts: 3380
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Date dependent fun condition (369)

#3

Post by Lobby » Sun Oct 22, 2017 21:41

Yes, they work independently :bc
...Have a nice stay

User avatar
Josh
Graphic designer
Reactions:
Posts: 2212
Joined: Sat Mar 11, 2017 19:20
Location: The Netherlands
Plugins: Show
Version: Beta
Phone model: Iphone 7

Platform

Plugin Creator

Re: Date dependent fun condition (369)

#4

Post by Josh » Sun Oct 22, 2017 21:43

Great!
Proud TheoTown player sinds update 1.1.50

Creator of Aldorria, Covinton Empire, West Country, Sunnydale

Save nature, before it kills you🌲

User avatar
Josh
Graphic designer
Reactions:
Posts: 2212
Joined: Sat Mar 11, 2017 19:20
Location: The Netherlands
Plugins: Show
Version: Beta
Phone model: Iphone 7

Platform

Plugin Creator

Re: Date dependent fun condition (369)

#5

Post by Josh » Sun Oct 22, 2017 21:56

Is it possible to have a code, when your map surpasses a certain amount of inhabitants a notification is given?
Proud TheoTown player sinds update 1.1.50

Creator of Aldorria, Covinton Empire, West Country, Sunnydale

Save nature, before it kills you🌲

User avatar
CommanderABab
AB
Reactions:
Posts: 7923
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Date dependent fun condition (369)

#6

Post by CommanderABab » Mon Oct 23, 2017 20:46

Use

Code: Select all

"once":true
where you define the notification.
777!777Currently using alpha 777. 777 What's new? :)
online maps!!
:)

Telegram - t.me/
πŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈCommanderπŸ†ŽοΈπŸ†ŽοΈ

User avatar
CommanderABab
AB
Reactions:
Posts: 7923
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Date dependent fun condition (369)

#7

Post by CommanderABab » Tue Oct 24, 2017 14:27

To use a random notification from those you have defined:
Lobby wrote: ↑
Sun Oct 22, 2017 20:54
...

Code: Select all

[
  {
    "id":"$notify_test01","type":"notification","text":"I AM SO <..>","frames":[{"steal":"$anim_people_source01","frame":0}],
    "id":"$notify_test02",...""   ""
    ...
  },
  
  {
    "id":"$invisible building","type":"decoration","hidden":true,"width":1,"height":1,"frames":[null],
    "(random )fun":[
       {"actions": [
          {
            "type": "notify",
            "id": "$notify_test01"
          },
          "p":x
        },
      {"actions": [
          {
            "type": "notify",
            "id": "$notify_test02"
          },
          "p":x
        },
        ...
          
        ]
      }
    ]
  }
]
...
Where x = 1 Γ· (number of different notifications).
777!777Currently using alpha 777. 777 What's new? :)
online maps!!
:)

Telegram - t.me/
πŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈCommanderπŸ†ŽοΈπŸ†ŽοΈ

User avatar
CommanderABab
AB
Reactions:
Posts: 7923
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Date dependent fun condition (369)

#8

Post by CommanderABab » Wed Oct 25, 2017 12:14

Then add one more action that doesn't have a notification! :)
777!777Currently using alpha 777. 777 What's new? :)
online maps!!
:)

Telegram - t.me/
πŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈCommanderπŸ†ŽοΈπŸ†ŽοΈ

User avatar
Lobby
Developer
Reactions:
Posts: 3380
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Date dependent fun condition (369)

#9

Post by Lobby » Wed Oct 25, 2017 12:35

How about this?

Code: Select all

[
  ...
  {
    "id":"$invisible building","type":"decoration","hidden":true,"width":1,"height":1,"frames":[null],
    "random fun":[
       {"actions": [
          {
            "type": "notify",
            "id": "$notify_test01"
          }
        ],  // Actions array is ending here
        "p":x  // Probability
      },
      {"actions": [  // Here begins a new transition
          {
            "type": "notify",
            "id": "$notify_test01"
          }
        ],
        "p":x
      },
      ...
    ]
  }
]
Note that "p" belongs into the transition object and not into the actions array.
...Have a nice stay

User avatar
Lobby
Developer
Reactions:
Posts: 3380
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Date dependent fun condition (369)

#10

Post by Lobby » Wed Oct 25, 2017 12:55

:bc
...Have a nice stay

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 445
Joined: Sat Sep 23, 2017 14:29

Platform

Re: Date dependent fun condition

#11

Post by 22Alpha » Wed Jan 31, 2018 9:32

I think I've asked this before but maybe there is an update about it. Does this fun activation have duration coding now? I mean action would trigger within a duration of time like 3 days, 5 days.
:mine

User avatar
Lobby
Developer
Reactions:
Posts: 3380
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Date dependent fun condition

#12

Post by Lobby » Wed Jan 31, 2018 16:40

Have you tried this? :json

Code: Select all

"condition": {
  "type": "date",
  "min": 0,
  "max": 2,   // Trigger at days 0, 1, 2
  "frame": 8  // Overall time frame of 3 + 5 = 8 days
},
...Have a nice stay

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 445
Joined: Sat Sep 23, 2017 14:29

Platform

Re: Date dependent fun condition

#13

Post by 22Alpha » Thu Feb 01, 2018 6:04

Lobby wrote: ↑
Wed Jan 31, 2018 16:40
Have you tried this? :json

Code: Select all

"condition": {
  "type": "date",
  "min": 0,
  "max": 2,   // Trigger at days 0, 1, 2
  "frame": 8  // Overall time frame of 3 + 5 = 8 days
},
Not yet, but will try! That's something new :bc Thanks!
:mine

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 445
Joined: Sat Sep 23, 2017 14:29

Platform

Re: Date dependent fun condition

#14

Post by 22Alpha » Thu Feb 01, 2018 8:30

@Lobby , I think I phrased it wrong. It was supposed to be 3 or 5 days. Does the code would remain the same?

A specific example would be:

If I build building A, after 5 days building B will automatically be replaced.
:mine

User avatar
CommanderABab
AB
Reactions:
Posts: 7923
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Date dependent fun condition

#15

Post by CommanderABab » Thu Feb 01, 2018 9:53

Use

Code: Select all

"min":5,"max":7,
then.
777!777Currently using alpha 777. 777 What's new? :)
online maps!!
:)

Telegram - t.me/
πŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈCommanderπŸ†ŽοΈπŸ†ŽοΈ

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 445
Joined: Sat Sep 23, 2017 14:29

Platform

Re: Date dependent fun condition

#16

Post by 22Alpha » Thu Feb 01, 2018 10:21

Without the "frames": line anymore?
:mine

User avatar
CommanderABab
AB
Reactions:
Posts: 7923
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Date dependent fun condition

#17

Post by CommanderABab » Thu Feb 01, 2018 12:18

Yes with the frames line, I just showed what you want to change.
777!777Currently using alpha 777. 777 What's new? :)
online maps!!
:)

Telegram - t.me/
πŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈπŸ†ŽοΈCommanderπŸ†ŽοΈπŸ†ŽοΈ

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 445
Joined: Sat Sep 23, 2017 14:29

Platform

Re: Date dependent fun condition

#18

Post by 22Alpha » Thu Feb 01, 2018 12:40

Looks like I'm one very confused guy. Maybe trying it into plugin would help me understand more. Thank you for all your help guys!
:mine

User avatar
Lobby
Developer
Reactions:
Posts: 3380
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Date dependent fun condition

#19

Post by Lobby » Sun Feb 04, 2018 1:33

I'm not sure what you mean by 3 or 5 days. Can you make an explicit example?
...Have a nice stay

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 445
Joined: Sat Sep 23, 2017 14:29

Platform

Re: Date dependent fun condition

#20

Post by 22Alpha » Sun Feb 04, 2018 2:33

Here:

If I build building A,

after 5 days,

building A will be removed, then building B will replace it.
:mine

Post Reply Previous topicNext topic

Return to β€œFun attribute”