Center-screen notifications?

Oh, I didn't mean the popup window... just the simple text that appears on-screen behind it.

I know I'm lazy to not try and search for it myself... just hoping someone knows offhand. :shifty:
 
You lazy bastard!

I actually think the string is hardcoded normally but there might be a way to access it
 
If everything fails just create a new label and display it (like the civwillard buttons), shouldn't be very difficult

Edit: I found something else that's interesting, you can add popups to tiles using Events.AddPopupTextEvent like Events.AddPopupTextEvent(HexToWorld(ToHexFromGrid(Vector2(35, 29))), "test", 0)
 
Ok, here's what you're looking for: Events.GameplayAlertMessage(text)
 
Interesting, does that AddPopupTextEvent display even when off-screen?

I'm using this for notifications of bonuses gained from citystate-capture rewards I implemented. I'd use regular notifications but the inflexible static system they've got set up is such a pain to work with, especially for compatibility concerns with other mods trying to do so. :badcomp:
 
I'll see about making my custom notifications script modular, it probably shouldn't need much more than adding a lua content type like I did for the diplo corner. Wouldn't expect it very soon, though.
 
Interesting, does that AddPopupTextEvent display even when off-screen?

Yes, it does. When I first started trying to get custom popup windows to work, I ended up making the popup text display instead. By chance, while testing, my start location just happened to be in view of the particular plot. Otherwise I would have assumed it failed completely. I believe it will not only generate the message off screen, but also when the plot is still under the fog.
 
If anyone's worked with GameplayAlertMessage a bit, have any idea how to display a message to specific people, like the other game alerts? Most of the alert system appears to be coded in the c++ so I'm having difficulty figuring this one out.
 
If anyone's worked with GameplayAlertMessage a bit, have any idea how to display a message to specific people, like the other game alerts? Most of the alert system appears to be coded in the c++ so I'm having difficulty figuring this one out.

Check if it's the right player when triggering the event. Why would you ever want to display anything to a non-active player? It's UI only.

I'm unsure what would happen in MP (if Game.GetActivePlayer() returns the local player or the active one, for example) but that's more or less irrelevant as mods don't work in MP anyways.
 
Hmm I see what you mean. I haven't done any UI or local player stuff yet in CiV, only Blizzard games. Good question over whether it means "player whose current turn it is" or "player who's on the local machine."

So I'm guessing this should work if I want to check if a city is visible before displaying a message about it... will give it a try.

PHP:
if lostCityPlot:IsRevealed(Game.GetActiveTeam()) then
  Events.GameplayAlertMessage("Refugees from "..lostCityName.." fled to the [ICON_CAPITAL] Capital!");
end

Edit: Worked perfectly, thank you! :beer:
 
Back
Top Bottom