eleazar wrote:Do i need to refer to the system in a more convoluted way? This is from the effects of a monster hull.
Code: Select all
effects = [
CreateShip "SM_KRILL_2"
Destroy
GenerateSitRepMessage
message = "EFFECT_MONSTER_SPAWNING"
parameters = [
tag = "monster" data = "SM_KRILL_2"
tag = "system" data = System
]
empire = Source.Owner
]
Eng stringtable:
Code: Select all
EFFECT_MONSTER_SPAWNING
A %monster% was spawned in %system%!
Yes; you need to give it the ID number of the system to refer to in the SitRep message.
System isn't a reference to an object ID number... it's just some text (that elsewhere might be a valid condition, but a condition isn't expect here; an integer object ID is). So, when the code that generates the sitrep text tries to interpret it, it fails, and you end up with ERROR in the in-game sitrep (in my tests by adding to cultural archives) because it can't tell what object you're referring to.
What you need to do is refer to some object relevant to the effectsgroup you're writing, and get its ID number by referencing that property. If the target object is a system, you could probably just do Target.ID or Target.SystemID - I think both should work for a system. An alternative to keep in mind is to refer to the Source object, as in Source.ID or Source.SystemID.
You can't use %monster% though. This isn't a valid tag for substitution, so the text generation doesn't know what to do with the data text you (otherwise correctly) provided. For now, you probably want to use a %text% tag, which tells the sitrep generator to look up the specified stringtable entry and substitute it into the template string. Think won't make a clickable link, but will look OK.
The valid tags are (currently):
"text" - look up data as a stringtable entry and substitute. stringtable entry name is surrounded by quotes.
"tech" - link to the tech with the specified name. Name is surrounded by quotes.
"buildingtype" - link to building type. Name can be written in quotes, or can be referenced as in Target.BuildingType
"special" - link to special, name written in quotes.
"shiphull" - link to ship hull, name written in quotes.
"shippart" - link to ship part, name written in quotes.
"species" - link to species. Name can be written in quotes, or can be referenced as in Target.Species
"planet" - find a planet with the specified ID and make a clickable link to it. ID is specified by reference, like Target.ID (if a planet).
"system" - link to system with specified ID
"ship" - link to ship
"fleet" - link to fleet
"building" - link to building
"empire" - link to empire with the specified ID. ID is specified by reference, like Target.Owner
"shipdesign" - link to shipdesign with the specified ID. ID is specified by reference, like Target.DesignID (if a ship).
I'll need to think about making a %predefinedshipdesign% tag. It would also be good to have a way to specify more than one of a particular type of tag, which is currently impossible.
Bigjoe5 wrote:This may or may not be the cause of your problem. If you want to receive the sitrep message yourself, you should put "AnyEmpire" (I think that's it, at least...), or "1"
That won't work. AnyEmpire can only be used in OwnedBy conditions.
Bigjoe5 brings up a good point though... there's no good way to specify which empires would receive such a sitrep message in general, when it's not just the owner of the target or source objects. Is there a good default behaviour that could be used when no empire ID is specified? Perhaps any empire that has visibility of the target object?