Revolutionist_8
King
My dear friends!
I've been trying to get a method that would give the human player a notification every turn. I have this template that if I understand correctly would put a notification above the "Next turn" button with an exclamation mark every turn with the text 'Summary' inside it. But there is something I'm clearly missing here as this doesn't want to work
Could someone please enlighten me?
Also any idea why
gives error 'function expected instead of nil' ? I tried with . instead of : in case it's a scoping issue, but same error
Any help, advice, suggestion is greatly appreciated! Thank you very much!
I've been trying to get a method that would give the human player a notification every turn. I have this template that if I understand correctly would put a notification above the "Next turn" button with an exclamation mark every turn with the text 'Summary' inside it. But there is something I'm clearly missing here as this doesn't want to work

Spoiler code :
Code:
function NotifEachTurn()
NotificationID = NotificationID and NotificationID +1 or 50000
pNotification = {};
pNotification.GetTypeName = function() return "NOTIFICATION_CUSTOM_NAME"; end
pNotification.GetPlayerID = function() return Game:GetLocalPlayer(); end
pNotification.GetID = function() return NotificationID; end
pNotification.GetGroup = function() return NotificationGroups.NONE; end
pNotification.GetIconName = function() return "ICON_NOTIFICATION_GENERIC"; end
pNotification.GetType = function() return 888888; end
pNotification.GetEndTurnBlocking = function() return EndTurnBlockingTypes.NO_ENDTURN_BLOCKING; end
pNotification.IsIconDisplayable = function() return true; end
pNotification.IsValidForPhase = function() return true; end
pNotification.IsAutoNotify = function() return false; end
pNotification.GetMessage = function() return "Message"; end
pNotification.GetSummary = function() return "Summary"; end
pNotification.CanUserDismiss = function() return true; end
pNotification.IsLocationValid = function() return false; end
pNotification.GetLocation = function() return 0, 0; end
pNotification.IsTargetValid = function() return false; end
pNotification.GetTarget = function() return ; end
pNotification.IsVisibleInUI = function() return true; end
pNotification.Activate = function(Boolean) end
pNotification.GetCount = function() return 1; end
pNotification.GetAddTurn = function() return Game.GetCurrentGameTurn(); end
pNotification.EraseOnStartTurn = true;
pNotification.DissmissOnActivate = false;
pNotification.GetEventOnActivate = "Default_Event"
LuaEvents.CustomNotification_OnDefaultAddNotification(pNotification);
end
GameEvents.PlayerTurnStarted.Add(NotifEachTurn);
Could someone please enlighten me?
Also any idea why
Spoiler code :
Code:
function Script(playerID)
local pPlayer = Players[playerID]
local gov = pPlayer:GetCulture():GetCurrentGovernment() <---- function expected instead of nil
...
GameEvents.PlayerTurnStarted.Add(Script)
gives error 'function expected instead of nil' ? I tried with . instead of : in case it's a scoping issue, but same error

Any help, advice, suggestion is greatly appreciated! Thank you very much!