Effects messages

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderators: Oberlus, Oberlus

Post Reply
Message
Author
User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Effects messages

#1 Post by Bigjoe5 » Sun Nov 08, 2009 2:15 am

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.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12457
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Effects messages

#2 Post by Geoff the Medio » Sun Nov 08, 2009 9:39 pm

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.

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: Effects messages

#3 Post by Bigjoe5 » Mon Nov 09, 2009 7:15 pm

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:

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"
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%.

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
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.
Warning: Antarans in dimensional portal are closer than they appear.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12457
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Effects messages

#4 Post by Geoff the Medio » Mon Nov 16, 2009 7:46 am

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...

Code: Select all

sourceownersitrepmessage = "STRING_NAME_1"
targetownersitrepmessage = "STRING_NAME_2"
otherempiresitrepmessage = "STRING_NAME_3"
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.

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: Effects messages

#5 Post by Bigjoe5 » Mon Nov 16, 2009 7:11 pm

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.
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)...?
That probably covers all the relevant objects.
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.
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.
Warning: Antarans in dimensional portal are closer than they appear.

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: Effects messages

#6 Post by OndrejR » Mon Nov 16, 2009 11:37 pm

SitRep message should have also category.

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

Re: Effects messages

#7 Post by pd » Tue Nov 17, 2009 12:16 am

OndrejR wrote:SitRep message should have also category.
Please see this thread.

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: Effects messages

#8 Post by Bigjoe5 » Tue Nov 17, 2009 12:57 am

OndrejR wrote:SitRep message should have also category.
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.
Warning: Antarans in dimensional portal are closer than they appear.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12457
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Effects messages

#9 Post by Geoff the Medio » Sun Aug 22, 2010 5:01 pm

I've added a GenerateSitRepMessage effect, which I discuss a bit here: viewtopic.php?p=44056#p44056

Post Reply