Code: Select all
GenerateSitRepMessage message = "STRINGTABLE_ENTRY" parameters = [ tag = "TAG_STRING1" data = VALUE1 tag = "TAG_STRING2" data = VALUE2 ] empire = EMPIRE_ID
There are some example sitrep-generating effects I've added to some of the starting buildings.
The valid values for the tag string are:
* planet - data should be the ID of the planet to substitute, which will appear as a clickable link in the sitrep entry
* system - data should be the ID of the system
ship - data should be the ID of the ship
* fleet - ... ID of the fleet
* building - ... ID of the building
* empire - ... ID of the empire
* shipdesign - ... ID of the ship design
* tech - data should be the name of the tech
* buildingtype - ... name of the building type
* special - ... name of the special
* shiphull - ... name of the hull
* shippart - ... name of the ship part
* species - ... name of the species
* text - substitutes data as text, not making a clickable link. This isn't likely very useful right now for GenerateSitRepMessage, but exists due to how some other sitreps work internally.
Order of parameters shouldn't matter, since it substitutes based on type. (See limitation below)
There are some limitations:
* The GenerateSitRepMessage will be executed on every target object. This can produce duplicate sitrep entries when this wouldn't be desired. This is a problem if the scope isn't carefully written, such as when a building acts on anything that contains source... this would then act on the planet, and the system, giving a double-sitrep message.
* There's no way to access anything about the whole target set, so you can't do anything like "The Death Star at Endor has destroyed 8 Rebel cruisers!", but you could have 8 separate messages like "The Death Star at endor has destroyed the Rebel ship Home One" for each acted-on target object. In general, this means there's no easy way to generate one sitrep message for a large number of objects being acted on, without writing a separate effectsgroup, which could be tricky to get right and be sure the sitrep message and actual effect are consistent.
* I don't think it's possible to have more than one item in the sitrep message of the same type at the moment. So, you can have parameters that are a tech and a building, but not two systems in the same message. I haven't actually tested this, so it might happen to work, though I doubt it.
* Sitreps are generated on the server, but substitutions for referenced objects are done client-side, so if a player / empire doesn't have visibility of an object, but that object's ID is referenced in a GenerateSitRepMessage on the server, the object won't appear properly in a sitrep message. Currently this will say "ERROR" (or your translation thereof) in place of the object name. The same applies for shipdesign references.