The Silent One wrote:Not sure I like this idea so much - if the death star fires (or not) shouldn't depend on chance.
Sorry I did not explain it better-- I was not intending that to represent some chance of an unreliable machine working or not. I meant it more along the lines of, destroying planets is a big deal, a lot of work, takes a lot of energy being applied for some extended period of time (i.e. the extended destruction sequence), and unless the deathstar operators do about 60 turns of analysis (which they never have the patience for) before beginning to fire then there is a fair amount of uncertainty as to how long they will have to blast away at it before it explodes, and the larger the planet the more the uncertainty
and the countdown (special) itself does work as I would expect it to. However, if planet destruction is triggered by the countdown special, (1) that happens on the same turn the special is created and not on the next one, which is why I was looking for HasSpecialSinceTurn (so the destruction would be triggered on the turn after the special is created); and (2), for some reason I do not grok the planet will not be depopulated as it will be when no countdown special is involved
Hmm, it's hard to help debug anything without seeing the exact script being used, and it sounds like at least some of this is not with the current language of the PR. You could make auxiliary branches with the various different approaches you are trying, and make PRs into your own home repo for them and direct us to take a look there, so that there would be more flexibility to discuss a number of variations without cluttering up the main repo with lots of parallel PRs.
Regarding destruction happening on same turn as special being created, I'm not thinking of how that could happen unless you were trying to use a conditional effect structure instead of leaving all the conditions in scope and activation. So it would be helpful to see the exact script that led to that result.
I agree with Mat that perhaps you could use Special capacity to help regulate your progression and only when they have a high enough or low enough capacity (whether you count up or down) letting them move on to their main effects (or only then being a sufficient trigger for the destruction effect from the weapon).
Also, to improve clarity and help with debugging, since you have so many repetitive structures I think it would help to use parameterized macro substitution. Geoff, or anyone, do we have a writeup anywhere on using those? I couldn't find one to refresh my memory with, so I did so by reviewing some examples and the parser code itself, but I'm not quite 100% sure I am right in thinking an empty parameter list is fine and about the manner of recursive macro substitution within parameters themselves. But here is a restructuring I came up with that I think helps make the part specification more clear, it lets you look at the meat of the specification and compare different prongs without needing to scroll around so much.
Code: Select all
// single argument is any additional conditions for scope
PDC_SCOPE
'''
And [
Planet
InSystem id = Source.SystemID
OrderedDestroyedBy condition = Source
Or [
OwnedBy affiliation = EnemyOf empire = Source.Owner
Unowned
]
VisibleToEmpire empire = Source.Owner
@1@
]
'''
PDC_NEITHER_SPECIAL
'''
Not HasSpecial name = "DESTRUCTION_COUNTDOWN_SPECIAL_2"
Not HasSpecial name = "DESTRUCTION_COUNTDOWN_SPECIAL_1"
'''
PDC_SPECIAL_1
'''
HasSpecial name = "DESTRUCTION_COUNTDOWN_SPECIAL_1"
'''
PDC_SCOPE_NEITHER_SPECIAL
'''
[[PDC_SCOPE( [[PDC_NEITHER_SPECIAL]] )]]
'''
PDC_SCOPE_SPECIAL_1
'''
[[PDC_SCOPE( [[PDC_SPECIAL_1]] )]]
'''
PDC_SCOPE_PLAIN
'''
[[PDC_SCOPE()]]
'''
Part
name = "SP_PLANET_DESTROYER"
description = "SP_PLANET_DESTROYER_DESC"
class = Destroy
mountableSlotTypes = Core
buildcost = 800 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_PART_COST_MULTIPLIER]]
buildtime = 8
tags = [ "CTRL_ALWAYS_BOMBARD" ]
location = All
effectsgroups = [
// if pdc tech is lvl 0 and no countdown is set, start countdown at 2
EffectsGroup
scope = [[PDC_SCOPE_NEITHER_SPECIAL]]
activation = And [
Not OwnerHasTech name = "SHP_PLANET_DESTROYER_REF_1"
Not OwnerHasTech name = "SHP_PLANET_DESTROYER_REF_2"
]
effects = [
AddSpecial name = "DESTRUCTION_COUNTDOWN_SPECIAL_2"
[[PLANET_DESTRUCTION_WARNING_SITREP]]
]
// if pdc tech is lvl 1 and no countdown is set, start countdown at 1
EffectsGroup
scope = [[PDC_SCOPE_NEITHER_SPECIAL]]
activation = And [
OwnerHasTech name = "SHP_PLANET_DESTROYER_REF_1"
Not OwnerHasTech name = "SHP_PLANET_DESTROYER_REF_2"
]
effects = [
AddSpecial name = "DESTRUCTION_COUNTDOWN_SPECIAL_1"
[[PLANET_DESTRUCTION_WARNING_SITREP]]
]
// if pdc tech is lvl 2, destroy planet instantly
EffectsGroup
scope = [[PDC_SCOPE_PLAIN]]
activation = OwnerHasTech name = "SHP_PLANET_DESTROYER_REF_2"
[[PLANET_DESTRUCTION_EFFECT]]
// if countdown is over, destroy planet
EffectsGroup
scope = [[PDC_SCOPE_SPECIAL_1]]
// activation = HasSpecialSinceTurn name = "DESTRUCTION_COUNTDOWN_SPECIAL_1" low = CurrentTurn - 1 high = CurrentTurn - 1
[[PLANET_DESTRUCTION_EFFECT]]
]
icon = "icons/ship_parts/planet_destroyer.png"
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0