Effects messages
Moderator: Oberlus
Effects messages
In certain cases, it is desirable for the player to get a message when an effect is activated, for example when he unearths a rare item from an ancient ruins special. Would it be at all possible to add an optional "notification" or "sitrep message" parameter for effects groups, so that certainl effects could have a sitrep message associated with them?
Warning: Antarans in dimensional portal are closer than they appear.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Effects messages
In principle it's possible. I've thought about it before, but it hasn't been a high priority.
Adding such a notification is probably a bit more complicated that you've considered yet, though. In order to make the message useful and meaningful, it needs to be more than just a static text block... The text would need to incorporate passed-in text to indicate the source object's name, owner empire, and general type (if a building or ship), a target object or a list of target objects and owners, and possibly other effect-specific parameters such as a previous and a new value of a property like a planet type or star type, a location of some sort, or additional objects that are relevant to what the effect has done. What kind of game content (tech, special, building, etc.) has produced an effect would probably be indicated in the message text, so shouldn't need to be passed in.
Try putting together some example messages and associated effects groups or effects.
Adding such a notification is probably a bit more complicated that you've considered yet, though. In order to make the message useful and meaningful, it needs to be more than just a static text block... The text would need to incorporate passed-in text to indicate the source object's name, owner empire, and general type (if a building or ship), a target object or a list of target objects and owners, and possibly other effect-specific parameters such as a previous and a new value of a property like a planet type or star type, a location of some sort, or additional objects that are relevant to what the effect has done. What kind of game content (tech, special, building, etc.) has produced an effect would probably be indicated in the message text, so shouldn't need to be passed in.
Try putting together some example messages and associated effects groups or effects.
Re: Effects messages
I'm not sure exactly how this would be accomplished, but I suppose there would need to be a way to specify objects and empires related to the effect, so when strings are accessed for these effectsgroups, things like %target.system% or %source.empire% would appear as a system name or empire name respectively, determined by where the source object is, who owns it, what and where its target was, and who owns the target.
A few examples:
The associated string would be:
RUINS_PLANET_CLOAK_MESSAGE
Your scouts have discovered the secret to Planetary Cloaking Device amongst the ruins on %source.planet%.
In this case, the two messages would be:
GATEWAY_VOID_SOURCE_MESSAGE
The Gateway to the Void which your empire tore open across the dimensions of space and time at the %source.system% system has utterly consumed the %target.empire% empire's fleet %target%.
GATEWAY_VOID_TARGET_MESSAGE
Your fleet %target% was mysteriously annihilated upon arrival at the %source.system% system!
Is what I'm describing at all possible? Also, the way things are now, I think that if this were implemented, %target% would return nothing in the above example, because the fleet no longer exists. Maybe that's not the case anymore though, since I haven't been in any battles since I got the more recent versions.
A few examples:
Code: Select all
EffectsGroup
scope = Source
activation = And [
Random probability = .33
NotOwnerHasTech "SHP_PLANET_CLOAK"
OwnerHasTech "LRN_XENOARCH_RESTORE"
]
stackinggroup = "ANCIENT_RUINS_TECH_UNLOCK"
sitrepmessage = message = "RUINS_PLANET_CLOAK_MESSAGE" affiliation = TheEmpire empire = Source.Owner
effects = GiveTechToOwner "SHP_PLANET_CLOAK"
RUINS_PLANET_CLOAK_MESSAGE
Your scouts have discovered the secret to Planetary Cloaking Device amongst the ruins on %source.planet%.
Code: Select all
EffectsGroup
scope = And [
ContainedBy Contains Source
Fleet
]
activation = Source
sitrepmessage = [
"GATEWAY_VOID_SOURCE_MESSAGE" TheEmpire Source.Owner
"GATEWAY_VOID_TARGET_MESSAGE" TheEmpire Target.Owner
]
effects = Destroy
GATEWAY_VOID_SOURCE_MESSAGE
The Gateway to the Void which your empire tore open across the dimensions of space and time at the %source.system% system has utterly consumed the %target.empire% empire's fleet %target%.
GATEWAY_VOID_TARGET_MESSAGE
Your fleet %target% was mysteriously annihilated upon arrival at the %source.system% system!
Is what I'm describing at all possible? Also, the way things are now, I think that if this were implemented, %target% would return nothing in the above example, because the fleet no longer exists. Maybe that's not the case anymore though, since I haven't been in any battles since I got the more recent versions.
Warning: Antarans in dimensional portal are closer than they appear.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Effects messages
You've used "affiliation" and "empire" parameters in a manner resembling the OwnedBy condition(s) in specifying the sitrep strings. Is this particularly desirable, or would it suffice to use separate optional effectsgroup parameters for each sitrep message? There probably be separate messages for messages to show to the target object's owner, the source object's owner, and other empires...
What are all the names of objects or empires that might need substituting into sitrep strings? Target and source objects, their empires, their containing planets (if any), their containing system (if any)...?
Potential issues with this are how to decide what objects' info to include in a given sitrep... Simplest would be to include object ids and empire ids or names for all the possible things that might be reference in an effectsgroup sitrep message. This is potentially an exploit though, as editing the sitrep string on a client's machine could cause it to show more information than was intended. I don't want to have to write a parser for the string to figure out what specific objects' ids need to be included, although that might be necessary.
The idea with the empire memory stuff that's being added is that empires will remember information about objects that they have seen previously, but can't see on the current turn. That includes objects that have been destroyed, whether or not the empire knows that the object has been destroyed.
Code: Select all
sourceownersitrepmessage = "STRING_NAME_1"
targetownersitrepmessage = "STRING_NAME_2"
otherempiresitrepmessage = "STRING_NAME_3"
Potential issues with this are how to decide what objects' info to include in a given sitrep... Simplest would be to include object ids and empire ids or names for all the possible things that might be reference in an effectsgroup sitrep message. This is potentially an exploit though, as editing the sitrep string on a client's machine could cause it to show more information than was intended. I don't want to have to write a parser for the string to figure out what specific objects' ids need to be included, although that might be necessary.
The idea with the empire memory stuff that's being added is that empires will remember information about objects that they have seen previously, but can't see on the current turn. That includes objects that have been destroyed, whether or not the empire knows that the object has been destroyed.
Re: Effects messages
In certain cases, I thought it might be desirable for and ally of source owner or target owner to receive a different message than an enemy. Using affiliation and empire in this way allows for greater flexibility in determining who gets what sitrep message.
That probably covers all the relevant objects.Geoff the Medio wrote:What are all the names of objects or empires that might need substituting into sitrep strings? Target and source objects, their empires, their containing planets (if any), their containing system (if any)...?
A sitrep message should probably only be sent to a player if he has visibility of the target object. The names of any objects or empires of which the player didn't have visibility at the time of the effect should be replaced by "unknown" or something similar.Geoff the Medio wrote:Potential issues with this are how to decide what objects' info to include in a given sitrep... Simplest would be to include object ids and empire ids or names for all the possible things that might be reference in an effectsgroup sitrep message. This is potentially an exploit though, as editing the sitrep string on a client's machine could cause it to show more information than was intended. I don't want to have to write a parser for the string to figure out what specific objects' ids need to be included, although that might be necessary.
Warning: Antarans in dimensional portal are closer than they appear.
Re: Effects messages
SitRep message should have also category.
Re: Effects messages
Please see this thread.OndrejR wrote:SitRep message should have also category.
Re: Effects messages
You mean sitrep message category will have to be specified within the effects group? You're probably right. Or, it could just get placed in a category automatically based on the effect somehow, but that's probably more difficult.OndrejR wrote:SitRep message should have also category.
Warning: Antarans in dimensional portal are closer than they appear.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Effects messages
I've added a GenerateSitRepMessage effect, which I discuss a bit here: viewtopic.php?p=44056#p44056