CreateShip effects - SetStructure
Posted: Wed Sep 21, 2016 11:53 pm
I'm stumped on modifying the new objects structure/maxstructure within the effects of CreateShip.
A shortened version:
I suspected some issue with processing order, but universe/Effect.cpp:1477 appears to apply these after setting the objects initial max.
Modifying the effects to:
With the appropriate stringtable entry, the sitrep generates and has the original objects structure for the rawtext (possible to use tag labels in sitrep params?).
Removing "Destroy", neither object has a modified max structure.
If the effect does not live long enough for a single turn, any options outside of using the capacity of a special?
As no existing entries use the effects portion of CreateShip, I wanted to make sure the usage was correct before reporting.
A shortened version:
Code: Select all
// param 1: string New ship design to create
MONSTER_MATURATION
'''CreateShip
design = "@1@"
empire = Source.Owner
name = Source.Name
effects = SetMaxStructure value = Source.Structure
Destroy
'''
Modifying the effects to:
Code: Select all
effects = [
SetMaxStructure value = 888
GenerateSitrepMessage
message = "EFFECT_TMP"
label = "EFFECT_TMP_LABEL"
parameters = [
tag = "rawtext" data = Source.Structure
tag = "ship" data = Source.ID
tag = "predefinedshipdesign" data = "@1@"
]
]
Removing "Destroy", neither object has a modified max structure.
If the effect does not live long enough for a single turn, any options outside of using the capacity of a special?
As no existing entries use the effects portion of CreateShip, I wanted to make sure the usage was correct before reporting.