Page 1 of 1

Create sitrep message when receiving diplomatic offer

Posted: Fri May 31, 2019 9:42 am
by The Silent One
I'm trying to implement a sitrep message that shows up if a player receives a diplomatic offer, e. g. a peace treaty. The message should look like "%empire% is offering a peace treaty." or "%empire% is proposing an alliance." etc..
I'm pretty clueless about the FOCS part. What would be the scope, the clients empire? Put it in customsitreps.txt?
Also, I will probably need to implement an activation condition, maybe something like HasDiplomaticOffer type = DIPLO_PEACE?

If anyone with insight would give a me some clues, that'd be great.

Code: Select all

EffectsGroup
    // scope = ???
    activation = ReceivedDiploMessage type = DIPLO_PEACE
    priority = [[END_CLEANUP_PRIORITY]]
    effects =
        GenerateSitRepMessage
            message = "SITREP_DIPLO_PEACE"
            label = "SITREP_DIPLO_PEACE_LABEL"
            icon = "icons/peace.png"
            parameters = [
                tag = "empire"  data = // Target.ID  ???
            ]

Re: Create sitrep message when receiving diplomatic offer

Posted: Fri May 31, 2019 3:25 pm
by Geoff the Medio
An issue with this is that diplomacy is (at least presently) not synchronized with turn cycling. So, a player can send a diplomatic message at any time, and could react to any receive messages at any time, with or without a server turn cycle happening between any of the steps...

So how / when exactly do you want / expect notifications to appear?

Re: Create sitrep message when receiving diplomatic offer

Posted: Fri May 31, 2019 3:41 pm
by o01eg
Geoff the Medio wrote: Fri May 31, 2019 3:25 pm An issue with this is that diplomacy is (at least presently) not synchronized with turn cycling. So, a player can send a diplomatic message at any time, and could react to any receive messages at any time, with or without a server turn cycle happening between any of the steps...
What if make diplomacy actions into turn orders?

Re: Create sitrep message when receiving diplomatic offer

Posted: Fri May 31, 2019 5:45 pm
by The Silent One
Geoff the Medio wrote: Fri May 31, 2019 3:25 pmSo how / when exactly do you want / expect notifications to appear?
I had imagined just a regular sitrep. Alternatively, the player list wnd icon (crown) could change into something else (mail icon) when a diplomatic offer is present, which should be easy enough to do.

Re: Create sitrep message when receiving diplomatic offer

Posted: Fri May 31, 2019 6:52 pm
by Geoff the Medio
o01eg wrote: Fri May 31, 2019 3:41 pmWhat if make diplomacy actions into turn orders?
Then there would be situations where players agree between eachother by chatting or external communication that they want to make peace, or some other diplomatic agreement on the current turn, but can't get the diplomacy system to consider them agreed until a turn later. For peace or ceasefire type agreement, this would result in their forces fighting battles anywhere their fleets/planets can see eachother on the next turn cycle, until an offer of ceasefire / peace sent by one on the current turn can be processed by the server during turn cycling and sent to the receipient to be responded to.

One might suggest that two players offering peace or ceasefire to eachother on the same turn should be considered as mutually accepting. But ceasefires agreements, and diplomatic messages in general, might have additional conditions that would need to be seen to be agreed to, so auto-accepting in all cases isn't possible. Accepting some agreements sent mutually, but not others, when sent on the same turn, would probably be confusing or problematic as well... eg. one can't know if an offer of ceasefire will possibly take effect on the current turn or on the next turn, so planning accordingly is difficult and understanding the mechanics is hindered.
The Silent One wrote: Fri May 31, 2019 5:45 pm...the player list wnd icon (crown) could change into something else (mail icon) when a diplomatic offer is present, which should be easy enough to do.
Should be reasonably easy to do. I think this has been suggested before, and there could be a github issue already.