Modding notifications

PawelS

Ancient Druid
Joined
Dec 11, 2003
Messages
2,811
Location
Poland
I need some guidance about notifications. The problem is that notifications about founding a pantheon don't include my automatically generated descriptions, and the notification itself is generated by the DLL code. Is there a way to bypass the DLL and use Lua to create the notifications instead? I ask because I prefer not to alter the DLL at this stage.

Changing a text key alone is not a good solution, because it won't allow me to call my Lua function that generates the description and put that description into the notification. If there is no solution to this problem, I'll just remove the descriptions from the pantheon notifications for now, so it will only tell that a civ has founded a pantheon, and its name.
 
Provided the notification has a unique type (ie it's not a generic "religion" notification) you can pretty much do what you want with them by modding the core NotificationPanel.lua file
 
Provided the notification has a unique type (ie it's not a generic "religion" notification) you can pretty much do what you want with them by modding the core NotificationPanel.lua file

I guess it's the OnNotificationAdded function... I'll try to do something with it, although the problem is how to retrieve the information that was used to create the original notification - what I need is the belief used for creating the pantheon, so I can insert its description in the right place.

The notification that interests me is NOTIFICATION_PANTHEON_FOUNDED. It uses the following text key (in case of unknown civ):

An unknown civilization has started worshipping a pantheon of gods. They have chosen the belief: {1_BeliefName} ({@2_BeliefDesc})

Belief descriptions in the database are empty in my mod, so the last part is just (). If I can retrieve the belief that was used, I can insert its generated description into the parentheses. I guess I can read the belief name, which is between ':' and '(', and then use it to identify the belief, but maybe there is an easier way...

Edit: Is it possible to modify the database using Lua before the game starts? Then I'd just generate all the descriptions and put the in the database, without the need of any changes in notifications.
 
Back
Top Bottom