Forum Announcement, Click Here to Read More From EA_Cade.

Anyone figured out how to create custom notifications? (script modding)

ZerbuZerbu Posts: 3,457 Member
edited March 5 in Nominated Threads
I'm trying to create a custom notification in The Sims 4. Unfortunately, the format is really confusing. I checked the "Bills" file which contains three notifications, but what I got was:
self._send_notification(self.BILL_ARRIVAL_NOTIFICATION)

So I searched for BILL_ARRIVAL_NOTIFICATION and got:
BILL_ARRIVAL_NOTIFICATION = UiDialogNotification.TunableFactory(description='\n        A notification which pops up when bills are delivered.\n        ')

I have little idea how the game gets the text that's meant to be in the notification (all I see is a debug description), but from what I can see, it requires some kind of tuning. Is there any way to create a custom notification that people are aware of? or am I doomed to wait until we have more information and/or more advanced tools?
Post edited by EA_Cade on

Comments

  • MyreMylarMyreMylar Posts: 80 Member
    The text itself would presumably be translated into multiple languages and located with the other game text.

    A 'Factory' in programming generally means a class that makes objects. So I would guess that BILL_ARRIVAL_NOTIFICATION in this code is a class that is called inside the _send_notification() function to create the actual 'Tunable' notification objects. I suspect the factory class name is passed into the factory's create method to make the objects distinct.

    Probably there is a tunable datafile somewhere that has a reference to 'BILL_ARRIVAL_NOTIFICATION' which in turn points to the language data, either that or 'BILL_ARRIVAL_NOTIFICATION' goes directly to the language files - I'm not sure exactly how the localisation fits in.

    So. To make a new notification I would write:
    MY_NEW_NOTIFICATION = UiDialogNotification.TunableFactory(description='\n  A test notification.\n
    
    self._send_notification(self.MY_NEW_NOTIFICATION)
    

    Then find whatever datafiles contain the localisation and see if there is a direct reference to BILL_ARRIVAL_NOTIFICATION in there, if not I would explore the gamedata package with the Datafile tool: (http://www.modthesims.info/showthread.php?t=531876) and see if you can find a reference to the notification somewhere in there that then refers to the localisation data. Wherever it is, eventually you'll need to add the text into the localisation files.
  • HenekHenek Posts: 36 Member
    Notifications is indeed a tunable instance and the description can be found under Snippets in the Modding Documentation.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file
Return to top