Notifications (368)

Any information about the fun attribute is given here.

Moderator: Plugin Moderators

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

Platform

Notifications (368)

#1

Post by Lobby »

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 22 Oct 2017, 11:42, edited 1 time in total.

User avatar
Josh
Graphic designer
Posts: 2214
Joined: 11 Mar 2017, 19:20
Location: The Netherlands
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Notifications

#2

Post by Josh »

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?

User avatar
Josh
Graphic designer
Posts: 2214
Joined: 11 Mar 2017, 19:20
Location: The Netherlands
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Notifications

#3

Post by Josh »

And can you add your own notification persons?

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

Platform

Re: Notifications

#4

Post by Lobby »

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 :)

User avatar
Bearbear76
Former Bearbear65
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: Notifications

#5

Post by Bearbear76 »

Lobby wrote:
22 Oct 2017, 00: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:

User avatar
Bearbear76
Former Bearbear65
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: Notifications

#6

Post by Bearbear76 »

What's the recommended size?

User avatar
Bearbear76
Former Bearbear65
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: Notifications

#7

Post by Bearbear76 »

Screenshot_2017-10-22-08-46-11.jpg

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

Platform

Re: Notifications

#8

Post by Lobby »

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 24082 times

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

Plugin Creator

Platform

Re: Notifications

#9

Post by CommanderABab »

That's what

Code: Select all

 "p": 0.001, 
is for.

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

Platform

Re: Notifications

#10

Post by JustAnyone »

Pickle coming to theotown...20178

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

Platform

Re: Notifications

#11

Post by Lobby »

@former member you're right :bc

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

Platform

Re: Notifications

#12

Post by JustAnyone »

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
Posts: 3713
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Notifications

#13

Post by Lobby »

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":[
      ...
    ]
  }
]

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

Platform

Re: Notifications

#14

Post by JustAnyone »

Gotcha.

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

Platform

Re: Notifications

#15

Post by JustAnyone »

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

User avatar
KINGTUT10101
1,000,000 inhabitants
Posts: 2226
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Notifications (368)

#16

Post by KINGTUT10101 »

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

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

Plugin Creator

Platform

Re: Notifications (368)

#17

Post by CommanderABab »

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.

User avatar
KINGTUT10101
1,000,000 inhabitants
Posts: 2226
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Notifications (368)

#18

Post by KINGTUT10101 »

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

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

Platform

Re: Notifications (368)

#19

Post by Lobby »

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

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

Platform

Re: Notifications (368)

#20

Post by Lobby »

Oh, I just noticed that I should have named this attribute differently :mine

Post Reply Previous topicNext topic

Return to “Fun attribute”