Logo Platform
logo amplifiers simplified

Help on modifying the dark matter manipulators trait

Reply
Copied to clipboard!
3 years ago
Sep 16, 2021, 8:22:53 AM

Hello everyone


I'd like to create a custom trait, similar to dark matter manipulator (which converts unallocated bandwidth into manpower), except that it would convert unallocated bandwidth into hacking speed.


Unfortunately, it doesn't seem that simple to do.


Dark matter manipulator is a simple trait, wich points to a single simulation descriptor :


(excerpt from "SimulationDescriptors[FactionTrait_DLC3]", dark matter manipulators simulationDescriptors) :

    <SimulationDescriptor Name="FactionTraitManpowerFromProcessingPower"    Type="FactionTrait">
<Modifier TargetProperty="PassiveProcessingPowerEnrollmentRate" Operation="Addition" Value="0.5" Path="ClassEmpire"/>
</SimulationDescriptor>


It seems that the "PassiveProcessingPowerEnrollmentRate " property is hardcoded ? So it is not possible to copy it or modify it to give hacking speed instead of Manpower ?




Alternatively, hacking speed bonus can be added to a trait via the following simulation descriptors :


   <SimulationDescriptor Name="FactionTraitBonusHackingSpeed"    Type="FactionTrait">
<Modifier TargetProperty="HackingWarpSpeed" Value="0.10" Operation="Percent" Path="ClassEmpire" TooltipHidden="true"/>
<Modifier TargetProperty="HackingNonWarpSpeed" Value="0.10" Operation="Percent" Path="ClassEmpire" TooltipHidden="true"/>
<Modifier TargetProperty="HackingNodeSpeed" Value="0.10" Operation="Percent" Path="ClassEmpire"/>
    </SimulationDescriptor>


However, I don't know how to make it so the speed bonus is proportionnal to the unallocated bandwidth. is there maybe a property that counts unallocated bandwidth ?


Can anyone help me ? Is there a way to have a trait that gives you hacking speed proportionnal to your unallocated bandwidth ?


Thanks !

0Send private message
3 years ago
Sep 16, 2021, 9:24:35 AM

The variable you want to target is EmpireProcessingPowerStock (which is located in ClassEmpire)


ProcessingPowerForManpower is located within ClassEmpire, and is calculated via this line:

<BinaryModifier TargetProperty="ProcessingPowerForManpower"         Operation="Addition"    Left="$(EmpireProcessingPowerStock)"    BinaryOperation="Multiplication" Right="$(PassiveProcessingPowerEnrollmentRate)"/>

The reason they do this is for the tooltip, they're perfectly capable of just doing all the math within the faction trait, however, the auto-tooltip generator thing will mess up the variable names, so what they do is make a new property, give that property its own GUI Element and give it the name of the trait, so that in the breakdown of where your resources come from it'll say "+5 Manpower From Dark Matter Manipulators".


If you want to make a trait that converts unused bandwidth into hacking speed, you need to remember that Hacking Speed is a PERCENTAGE. If you have 500 bandwidth and you add that to hacking speed, you'll get +5000 HACKING SPEED. So, to avoid this, you need to first divide the bandwidth by 10.

 

I'll give you an example of what you need to do, but I'm not going to type the full thing out:

Property: BandwidthToHackingSpeed = 0

Modifier: BandwidthToHackingSpeed = EmpireProcessingPowerStock / 10

Modifier: HackingSpeed += BandwidthToHackingSpeed 


After you do that, you need to make a gui element named BandwidthToHackingSpeed (or whatever you name your property to be), then make the title of that GUI Element to be the same title as your trait.


0Send private message
0Send private message
3 years ago
Sep 22, 2021, 3:38:08 PM

Hello


Thanks to your answer, I managed to create something similar to dark Matter Manipulators, but for hacking speed. Sadly, it doesn't seem to work : the game can't load and in the custom faction screen all factions (including premade) lose all traits and get some default values ("duck communists, duck land, duck monarchy") instead.


After some tests, the problem seems to be with this precise line in the SimulationDescriptors[Empire] file of ther mod (when I remove the line the game works fine, except for the intended mechanism of the trait) :


<BinaryModifier TargetProperty="ProcessingPowerForHacking" Operation="Addition" Left="$(EmpireProcessingPowerStock)" BinaryOperation="Multiplication" Right="$(PassiveProcessingPowerHackingRate)"/> 


I can't seem to find a problem with it. Maybe a problem because no path is specified ?


Can someone help me find where the problem is located ? I can't seem to figure it out.





I created a SimulationDescriptors[Empire] file,  with the following properties and operations :
 

   <SimulationDescriptor Name="ClassEmpire" Type="Class">

<Property Name="PassiveProcessingPowerHackingRate" BaseValue="10" MaxValue="100"/>
<Property Name="ProcessingPowerForHacking" BaseValue="0"/>

<BinaryModifier TargetProperty="ProcessingPowerForHacking" Operation="Addition" Left="$(EmpireProcessingPowerStock)" BinaryOperation="Multiplication" Right="$(PassiveProcessingPowerHackingRate)"/>


<Modifier TargetProperty="HackingWarpSpeed" Operation="Percent" Value="$(ProcessingPowerForHacking)" Path="../ClassEmpire"/>
<Modifier TargetProperty="HackingNonWarpSpeed" Operation="Percent" Value="$(ProcessingPowerForHacking)" Path="../ClassEmpire"/>
<Modifier TargetProperty="HackingNodeSpeed" Operation="Percent" Value="$(ProcessingPowerForHacking)" Path="../ClassEmpire"/>
    </SimulationDescriptor>


The "ProcessingPowerForHacking " is a property set at a base of 0. The first operation is supposed to add (EmpireProcessingPowerStock (which is the empire's unallocated bandwidth) * a second property, PassiveProcessingPowerHackingRate ) to this first property.


PassiveProcessingPowerHackingRate is a property set to a base value of 0, and set to 90 by a trait similar to Dark Matter Manipulators, so that a faction without this trait gets a result of 0, and a faction with the trait gets a bonus of (unallocated bandwidth * 90)  (This value of 90 hacking speed per unallocated bandwidth is extremely high, I use it for testing purposes to immediatly see if the trait works, as it should enhance hacking speed by absurd amounts if functional ; Once the formula works I'll set it to a reasonable value such as 0,5 per unallocated bandwidth).

The resulting operation sets the value of ProcessingPowerForHacking , and ProcessingPowerForHacking  is then supposedly added to the hacking speed of the empire by the three other operations.



The trait used to set PassiveProcessingPowerHackingRate  to a value other than 0 is scripted this way :  (it is correctly visible and selectionable in the custom faction screen, with the tooltip saying "sets Overcloaked processors (this is the title of the trait) to 90 (this is the correct value for testing purposes) on Empire "


    <FactionTrait Name="FactionTraitHackingSpeedFromProcessingPower"   SubCategory="FactionTrait" TraitCategory="TraitCategoryManpower" TraitSubCategory="TraitSubCategoryHackingSpeedFromProcessingPower" Family="FactionTraitFamilyMilitary" Hidden="false" Custom="true" Cost="10">
<SimulationDescriptorReference Name="FactionTraitHackingSpeedFromProcessingPower"/>
    </FactionTrait>


Its linked Simulation Descriptor is scripted thus :

    <!-- Processing Power from idle Bandwidth -->
<SimulationDescriptor Name="FactionTraitHackingSpeedFromProcessingPower" Type="FactionTrait">
<Modifier TargetProperty="PassiveProcessingPowerHackingRate" Operation="Addition" Value="90" Path="ClassEmpire"/>
    </SimulationDescriptor>







Can someone help ?


Many thanks !

Updated 3 years ago.
0Send private message
?

Click here to login

Reply
Comment