{Solved}Trans Spatial Drive - Linux, Master Branch, #f0abc0d

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

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

{Solved}Trans Spatial Drive - Linux, Master Branch, #f0abc0d

#1 Post by MatGB »

I'm not 100% certain I know what this code is meant to be doing, but I am 100% certain it's not working as intended:

Code: Select all

Part
    name = "FU_TRANSPATIAL_DRIVE"
    description = "FU_TRANSPATIAL_DRIVE_DESC"
    class = Speed
    capacity = 40
    mountableSlotTypes = Core
    buildcost = 80 * [[FLEET_UPKEEP_MULTIPLICATOR]]
    buildtime = 8
    location = And [
        OwnedBy empire = Source.Owner
        Contains Building name = "BLD_SHIPYARD_CON_ADV_ENGINE"
        ]
    effectsgroups = [
        EffectsGroup
            scope = Source
            activation = (1 <= [[BEST_CLOAK_EFFECT]] <= 40)
            stackinggroup = "ENGINE_STEALTH_PART_STACK1"
            accountinglabel = "TRANSPATIAL_CLOAK_INTERACTION"
            effects = SetStealth value = Value - [[BEST_CLOAK_EFFECT]]
        EffectsGroup
            scope = Source
            activation = (40 < [[BEST_CLOAK_EFFECT]])
            stackinggroup = "ENGINE_STEALTH_PART_STACK2"
            effects = SetStealth value = Value + 40
    ]
    icon = "icons/ship_parts/engine-4.png"
    
Should be giving me a stealth of 55 so I can sneak past the AI to see what they've got coming up from their shipyard.
Attachments
transspatialstealth.png
transspatialstealth.png (216.29 KiB) Viewed 1701 times
Last edited by MatGB on Sat Aug 29, 2015 8:09 am, edited 1 time in total.
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
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Trans Spatial Drive - Linux, Master Branch, #f0abc0d

#2 Post by Dilvish »

It looks to me like you'd want to change "< " to ">=" in the second activation clause.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Morlic
AI Contributor
Posts: 296
Joined: Tue Feb 17, 2015 11:54 am

Re: Trans Spatial Drive - Linux, Master Branch, #f0abc0d

#3 Post by Morlic »

Yes, seems to be a wrong conversion to the new format. The old effect I implemented reads:

Code: Select all

            activation = ValueTest Low = [[BEST_CLOAK_EFFECT]] TestValue = 40
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: Trans Spatial Drive - Linux, Master Branch, #f0abc0d

#4 Post by MatGB »

Aye, I had got it working by turning the arrow around after I figured out what was happening, but it took me several different reloads to work it all out. Got back from walking dogs and it's all ready to merge in, perfect.

I was partially confused as, well, I created that part and it was full of code I couldn't read, now I know what it's doing it's a lot clearer, thanks.
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