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?
Comments
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:
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.