Issues with Planetary Starlane Drive

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderators: Oberlus, Committer

Post Reply
Message
Author
User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Issues with Planetary Starlane Drive

#1 Post by Vezzra »

When tinkering around with the Planetary Starlane Drive (testing PR#869 and trying to come up with a fix for issue#917) I came across two issues. The first one is that you can build a Planetary Beacon in the same system as a planet with the PSD + corresponding focus setting, which will cause the planet to travel to the system it is already in. Not a big thing, but still shouldn't be possible. Looking at the code of the PSD focus, the reason seems obvious:

Code: Select all

        EffectsGroup
            scope = Source
            activation = And [
                Planet
                Focus type = "FOCUS_PLANET_DRIVE"
                Or [
                WithinStarlaneJumps jumps = 1 condition = Building name = "BLD_PLANET_BEACON"
                WithinStarlaneJumps jumps = 1 condition = Contains And [
                    Ship 
                    OwnedBy empire = Source.Owner
                    DesignHasPart low = 1 high = 999 name = "SP_PLANET_BEACON"
                    Turn low = LocalCandidate.ArrivedOnTurn + 1
                    ]
                ]
            ]
            effects = [
                MoveTo destination = And [
                    OwnedBy empire = Source.Owner
                    WithinStarlaneJumps jumps = 1 condition = Source
                    Contains Or [
                        And [
                            Building name = "BLD_PLANET_BEACON"
                            OwnedBy empire = Source.Owner
                        ]
                        And [
                            Ship 
                            OwnedBy empire = Source.Owner
                            DesignHasPart low = 1 high = 999 name = "SP_PLANET_BEACON"
                        ]
                    ]
                ]
                GenerateSitRepMessage
                        message = "EFFECT_PLANET_DRIVE"
                        label = "EFFECT_PLANET_DRIVE_LABEL"
                    icon = "icons/building/planetary_stardrive.png"
                        parameters = [
                                tag = "planet" data = Source.ID
                                tag = "system" data = Source.SystemID
                        ]
                        empire = Source.Owner
                SetPopulation value = Value / 2
            ]
The activation condition as well as the destination condition of the MoveTo effect both check for Planetary Beacons within 1 jump or less. I assume that can be fixed by changing "jumps = 1" to "jumps = low = 1 high = 1" - does "jumps" accept that syntax?

Second issue: In the destination condition of the MoveTo effect the owner of the Planetary Beacon building is checked, but not in the activation condition. Shouldn't these two match (after all, the owner of the ship based Planetary Beacon does get checked in both conditions)?

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Issues with Planetary Starlane Drive

#2 Post by MatGB »

To be honest, I'd be tempted to scrap the building beacon completely, it wasn't (IIRC) intended as a permanent thing it was added as there wasn't a better way to target the location planned, the ship works better overall. In addition, it doesn't combo well if you're using the Transformer instead of the Drive building, if you use the latter it blows itself up but I could never get it to work with the former when I was messing around updating it.

And I never noticed the whole 'can move to the same place' issue, weird, no idea what Jumps will or won't accept, it ought to if it doesn't already.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

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

Re: Issues with Planetary Starlane Drive

#3 Post by Geoff the Medio »

Vezzra wrote:I assume that can be fixed by changing "jumps = 1" to "jumps = low = 1 high = 1" - does "jumps" accept that syntax?
I don't think anything would accept that. You probably want to add additional conditions like Not And [InSystem InSystem id = Source.SystemId] or similar.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Issues with Planetary Starlane Drive

#4 Post by Vezzra »

Found another issue, the activation condition of the effectsgroup handling the potential destruction of the moved planet if no Interstellar Lighthouse is near apparently hasn't been adjusted for the Planetary Beacon ship part. It only checked for planets moved by a Planetary Beacon building.

I ended up doing a major rewrite of the thing. Fix pushed: e017c3f

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Issues with Planetary Starlane Drive

#5 Post by MatGB »

Vezzra wrote:Found another issue, the activation condition of the effectsgroup handling the potential destruction of the moved planet if no Interstellar Lighthouse is near apparently hasn't been adjusted for the Planetary Beacon ship part. It only checked for planets moved by a Planetary Beacon building.
That's weird, I am certain I tested that it still blew up without one when I wrote it, must've got lost in one of the rewrties/reverts that ended up happening, good catch, thanks.
I ended up doing a major rewrite of the thing. Fix pushed: e017c3f
Now that's a lot more elegant than my code, and easier to read for the next person that wants to mess with it. Cool.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Post Reply