Notifications (368)

Any information about the fun attribute is given here.

Moderator: Plugin Moderators

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

Notifications (368)

Post by Lobby » Sat Oct 21, 2017 23:31

I heard that there's an interest in showing notifications via plugins. So, here we go (version 368):
notify.png
You can define a notification by using type "notification":

Code: Select all

{
    "id":"$notify_test00",
    "type":"notification",
    "text":"Hi, I'm a test notification!",
    "frames":[{"steal":"$anim_people_source01","frame":14}] // Use this if you want to show one of the built in people in your message
}
After that, you can reference to it in a notify-fun-action:

Code: Select all

{
    "id":"$notification_test_building00",
    "type":"decoration",
    "width":1,
    "height":1,
    "frames":[{"x":480,"y":0,"w":32,"h":16}],
    "on click fun":[
        {
            "actions":[{"type":"notify","id":"$notify_test00","z":1}] // Let's trigger the notification if the player taps on this building
        }
    ]
}
In case you wonder: the "z":1 puts a location button on the notification that navigates the user to the building that spawned it.

There are optional things you can define in a notification:

Code: Select all

"show once":true,  // The notification will be displayed only one time (per city)
"immersive":true,  // The notification will be displayed in an own window
"important":true,  // The notification will be marked as important (like fire notifications)
"closeable":false  // Removes the close button from the notification. Not really useful...
Last edited by Anonymous on Sun Oct 22, 2017 11:42, edited 1 time in total.
...Have a nice stay

User avatar
Josh
Graphic designer
Reactions:
Posts: 2199
Joined: Sat Mar 11, 2017 19:20
Location: The Netherlands
Plugins: Show
Version: Beta

Re: Notifications

Post by Josh » Sun Oct 22, 2017 0:01

Can you also set like a counter, for example when it's new year, you can get a new year notification without having a building?
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: 2199
Joined: Sat Mar 11, 2017 19:20
Location: The Netherlands
Plugins: Show
Version: Beta

Re: Notifications

Post by Josh » Sun Oct 22, 2017 0:01

And can you add your own notification persons?
Proud TheoTown player sinds update 1.1.50

Creator of Aldorria, Covinton Empire, West Country, Sunnydale

Save nature, before it kills you🌲

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

Re: Notifications

Post by Lobby » Sun Oct 22, 2017 0:25

About date specific notifications: Not yet, but I plan to add a condition for date so you can use "random fun" to trigger it.

Just provide your own image as frame for the notification :)
...Have a nice stay

User avatar
Bearbear65
Inhabitant of a Universe
Reactions:
Posts: 4565
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta
Phone model: Xperia™ XZ1 SO-01K

Re: Notifications

Post by Bearbear65 » Sun Oct 22, 2017 1:29

Lobby wrote:
Sun Oct 22, 2017 0:25
About date specific notifications: Not yet, but I plan to add a condition for date so you can use "random fun" to trigger it.

Just provide your own image as frame for the notification :)
Heheheheh
I'm going to add so many bears :evil:
ImageJust my opinion
Theotown forum authoritarian

User avatar
Bearbear65
Inhabitant of a Universe
Reactions:
Posts: 4565
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta
Phone model: Xperia™ XZ1 SO-01K

Re: Notifications

Post by Bearbear65 » Sun Oct 22, 2017 1:31

What's the recommended size?
ImageJust my opinion
Theotown forum authoritarian

User avatar
Bearbear65
Inhabitant of a Universe
Reactions:
Posts: 4565
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta
Phone model: Xperia™ XZ1 SO-01K

Re: Notifications

Post by Bearbear65 » Sun Oct 22, 2017 1:47

Screenshot_2017-10-22-08-46-11.jpg
ImageJust my opinion
Theotown forum authoritarian

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

Re: Notifications

Post by Lobby » Sun Oct 22, 2017 1:47

16x32 and 32x32 are the default sizes.

Here an overview over the frames contained in the built in "$anim_people_source01" animation:
people.png
people.png (8.96 KiB) Viewed 1319 times
...Have a nice stay

User avatar
CommanderABab
Inhabitant of a Multiverse
Reactions:
Posts: 6707
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Re: Notifications

Post by CommanderABab » Sun Oct 22, 2017 8:20

That's what

Code: Select all

 "p": 0.001, 
is for.
547547Currently using alpha 547. 547 What's new? :)
settings.json!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
JustAnyone
Feature manager
Reactions:
Posts: 2427
Joined: Sun Jul 23, 2017 12:45
Location: Pickle command center
Plugins: Show
Version: Beta
Phone model: Picklephone S5

Re: Notifications

Post by JustAnyone » Sun Oct 22, 2017 9:53

Pickle coming to theotown...20178

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

Re: Notifications

Post by Lobby » Sun Oct 22, 2017 12:56

@former member you're right :bc
...Have a nice stay

User avatar
JustAnyone
Feature manager
Reactions:
Posts: 2427
Joined: Sun Jul 23, 2017 12:45
Location: Pickle command center
Plugins: Show
Version: Beta
Phone model: Picklephone S5

Re: Notifications

Post by JustAnyone » Sun Oct 22, 2017 19:31

Code: Select all

[{
		"id":"$notify_test00",
		"type":"notification",
		"text":"Hi, I'm a test notification!",
		"frames": [{
			"steal":"$anim_people_source01",
			"frame": 14
		}]
	},
	{
		"random fun": [{
			"condition": {
				"type":"building count",
				"id":"dsahq",
				"min": 0,
				"max": 0
			},
			"actions": [{
				"type": "notify",
				"id": "$notify_test00",
				"z": 1
			}]
		}]
	}
]
No value for type. Show me the error because I am blind.

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

Re: Notifications

Post by Lobby » Sun Oct 22, 2017 19:51

You have to put "random fun" into a building (or road) plugin :teach

You might use a dummy building similar to

Code: Select all

[
  {
    "id":"$somerandomidyouwillneveruse",
    "type":"decoration",
    "hidden":true,
    "width":1,
    "height":1,
    "frames":[null],
    "random fun":[
      ...
    ]
  }
]
...Have a nice stay

User avatar
JustAnyone
Feature manager
Reactions:
Posts: 2427
Joined: Sun Jul 23, 2017 12:45
Location: Pickle command center
Plugins: Show
Version: Beta
Phone model: Picklephone S5

Re: Notifications

Post by JustAnyone » Sun Oct 22, 2017 20:18

Gotcha.

User avatar
JustAnyone
Feature manager
Reactions:
Posts: 2427
Joined: Sun Jul 23, 2017 12:45
Location: Pickle command center
Plugins: Show
Version: Beta
Phone model: Picklephone S5

Re: Notifications

Post by JustAnyone » Sun Oct 22, 2017 20:27

OK. Not really. I have explained stuff in discord pm.

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 1814
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Phone model: Moto Z Force Droid

Re: Notifications (368)

Post by KINGTUT10101 » Thu Oct 26, 2017 0:16

Where do I need to add once: true for it to work?

User avatar
CommanderABab
Inhabitant of a Multiverse
Reactions:
Posts: 6707
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Re: Notifications (368)

Post by CommanderABab » Thu Oct 26, 2017 0:40

Code: Select all

{
    "id":"$notify_test00",
    "type":"notification",
    "text":"Hi, I'm a test notification!",
    "frames":[{"steal":"$anim_people_source01","frame":14}] // Use this if you want to show one of the built in people in your message
}
In this place I believe @KINGTUT10101.
547547Currently using alpha 547. 547 What's new? :)
settings.json!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 1814
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Phone model: Moto Z Force Droid

Re: Notifications (368)

Post by KINGTUT10101 » Thu Oct 26, 2017 1:46

I tried putting it there and it didn't work.

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

Re: Notifications (368)

Post by Lobby » Sun Nov 05, 2017 12:04

What do you mean by doesn't work?

It's a general flag for all plugins, therefor it should work independently of the type O_o
...Have a nice stay

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

Re: Notifications (368)

Post by Lobby » Sun Nov 05, 2017 12:33

Oh, I just noticed that I should have named this attribute differently :mine
...Have a nice stay

User avatar
TheFennekin
Inhabitant of a Solar System
Reactions:
Posts: 1835
Joined: Thu Aug 24, 2017 11:17
Location: Where do you think?
Plugins: Show
Version: Beta
Phone model: Pickle

Re: Notifications (368)

Post by TheFennekin » Sun Nov 05, 2017 12:37

Maybe @KoalaGuy[Posts][PM]'s problem is not to use "once": true and use once: true just like @Lobby[Posts][PM] said in the codes.
Don't even blink

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

Re: Notifications (368)

Post by Lobby » Sun Nov 05, 2017 12:47

It will be fixed, and it will be renamed to

Code: Select all

"show once":true
@TheFennekin I omitted the quotes as some json standards allow it for names without spaces. However, it's better to use them unless you're lazy :)
...Have a nice stay

User avatar
JustAnyone
Feature manager
Reactions:
Posts: 2427
Joined: Sun Jul 23, 2017 12:45
Location: Pickle command center
Plugins: Show
Version: Beta
Phone model: Picklephone S5

Re: Notifications (368)

Post by JustAnyone » Mon Dec 18, 2017 19:33

Wait. How do you remove navigation button.

User avatar
Bearbear65
Inhabitant of a Universe
Reactions:
Posts: 4565
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta
Phone model: Xperia™ XZ1 SO-01K

Re: Notifications (368)

Post by Bearbear65 » Fri May 04, 2018 12:14

JustAnyone wrote:
Mon Dec 18, 2017 19:33
Wait. How do you remove navigation button.
In case you wonder: the "z":1 puts a location button on the notification that navigates the user to the building that spawned it.
ImageJust my opinion
Theotown forum authoritarian

User avatar
JustAnyone
Feature manager
Reactions:
Posts: 2427
Joined: Sun Jul 23, 2017 12:45
Location: Pickle command center
Plugins: Show
Version: Beta
Phone model: Picklephone S5

Re: Notifications (368)

Post by JustAnyone » Fri May 04, 2018 14:05

I already figured out.
With the new version something cool is coming for notifications.

Post Reply Previous topicNext topic

Return to “Fun attribute”

Who is online

Users browsing this forum: No registered users and 1 guest