Events.AddPopupTextEvent

adan_eslavo

Archmage of all Pixels
Supporter
Joined
Apr 23, 2017
Messages
3,488
Location
Łódź, Poland
Do someone know how to restrict pop up messages from:
Code:
Events.AddPopupTextEvent.Add( AddPopupText );
to be shown only for one player like it is done in VP?

For now I have situation where info should be visible only for one player, but every one can see that message even if he didn't found that civilization on the map.
 
Anyone knows some solution?
 
What exactly are you trying to do with the pop up message? What triggers the pop-up message? Kris Swordman/Bushido promotion text will even appear over fog(because they use the same popup)

tsk tsk.
 
There are many popup messages triggers:
  • at the begginning of the turn:
    • over unit with new promotion
    • after resource creating
    • after grabing tile
    • on unit levelling
    • just for being inside enemy territory
    • on new Era
    • on each B'ak'tun
  • on attack
  • after triggering diplomatic mission with diplomatic unit having unique promotion
  • after move of a unit
    • normal move,
    • taking goody hut (special bonus)
  • on Kill (specific which could not be coded with sql table)
  • on building construction.
They are moslty information about specific damage or heal of a unit or one-time yield gain by the unit or city. They should look like effect with UnitPromotion_YieldFromKills table which is visible only for one player.

I though about adding IsHuman() function but it doesn't resolve problem if there are 2 humans playing and one of them triggers such message (second should not see it).

You can check Montezuma's faith and gold for kill. I put with IGE enemy units and waited to kill mine and I couldn;t see his faith and gold yield income for that particular kill.
 
Last edited:
@JFD

I could recall you had an issue with this kind of Lua where some messages would appear through fog and basically other players could see, but you managed to fix it in your mod.
 
Maybe try IsActivePlayer()? I haven’t tested that in multiplayer, but it sounds like the kind of thing that might help i this situation.
 
Ok, thank you guys for help. I will try to impement it soon.
 
Top Bottom