Logo Platform
logo amplifiers simplified

Removing all Science Produced by a Star System

Reply
Copied to clipboard!
7 years ago
Sep 1, 2018, 12:35:46 AM

I have been attempting to create an improvement that essentially functions the same as the other infinite conversion improvements except it converts science into industry, dust, etc. The part where the science is removed, or consumed if you will, has not been working correctly. I am wondering if anyone knows how I should set that up, if I need to do some property creating and/or forwarding or whatever else to get it working. Assuming it is possible, of course, to do it through a mod.


Another related question, is it possible to apply empire-wide effects, like increased movement points, through a star system improvement?

0Send private message
7 years ago
Sep 3, 2018, 8:41:35 AM

Hey ZZGashi,


I'm not sure an infinite improvement which increases Industry is possible, but here's how "industry to science" works:


The system has the following properties and modifiers in the SimulationDescriptor ClassColonizedStarSystem:

<Property Name="SystemProductionFromProductionConversion"   MinValue="Negative"/>
<Property Name="SystemResearchFromProductionConversion"     MinValue="Negative"/>
<Modifier TargetProperty="NetSystemProduction"      Operation="Addition"    Value="$(SystemProductionFromProductionConversion)"  TooltipHidden="false"  />
<Modifier TargetProperty="SystemResearch"           Operation="Addition"    Value="$(SystemResearchFromProductionConversion)" TooltipHidden="false" Priority="2"/>

When the Infinite improvement is at the top of the queue, it applies the following SimulationDescriptor on the system:

<SimulationDescriptor Name="StarSystemImprovementIndustryToScienceEffect" Type="StarSystemImprovement">
    <BinaryModifier TargetProperty="SystemResearchFromProductionConversion"      Operation="Addition" Left="0.25"   BinaryOperation="Multiplication" Right="$(SystemProduction)"   Path="ClassColonizedStarSystem" TooltipHidden="true"/>
    <BinaryModifier TargetProperty="SystemResearchFromProductionConversion"      Operation="Addition" Left="0.25"   BinaryOperation="Multiplication" Right="$(SystemProductionFromGrowth)"   Path="ClassColonizedStarSystem" TooltipHidden="true"/>
    <BinaryModifier TargetProperty="SystemProductionFromProductionConversion"    Operation="Addition" Left="-1"     BinaryOperation="Multiplication" Right="$(SystemProduction)"  Path="ClassColonizedStarSystem" TooltipHidden="true"/>
</SimulationDescriptor>

It simply moves 25% of SystemProduction and SystemProductionFromGrowth to SystemResearchFromProductionConversion, which is then added to NetSystemResearch with the modifiers we've seen above (this is the "final" science value).

It also moves -100% of SystemProduction to SystemProductionFromProductionConversion which is then added to NetSystemProduction, usually making it equal to 0.


You'll have to create similar properties and modifiers to have the same effect!

But instead of moving SystemProduction into SystemResearchFromProductionConversion and SystemProductionFromProductionConversion, you'll have to move SystemResearch into SystemProductionFromResearchConversion and SystemResearchFromResearchConversion, and finally add it to NetSystemProduction and NetSystemResearch respectively. 

Don't forget to create the corresponding GuiElements so that your tooltips work properly!

Updated 7 years ago.
0Send private message
7 years ago
Sep 3, 2018, 7:50:47 PM

So it would look something like this?


        <BinaryModifier TargetProperty="SystemResearchFromResearchConversion" Operation="Addition" Left="-1" BinaryOperation="Multiplication" Right="$(SystemResearch)" Path="ClassColonizedStarSystem"/>


Also, is the second thing I asked possible to do?

Updated 7 years ago.
0Send private message
7 years ago
Sep 4, 2018, 3:33:28 AM

For conversion of anything to Industry as an infinite conversion improvement to work you need a way for the industry to be stored. And preferably a way for it to be visible in an effective way (otherwise the player has to guess).


As for empire wide effects I'd look at how research works, and maybe extrapolate form there. There are plenty of improvements which do "empire wide" things already, just not ones that affect ships. Last I knew there was an empire movement modifier which reseacrh modifies. There shouldn't be any reason youcan't modify it with a building. But I don't actually mod the game :P

0Send private message
7 years ago
Sep 4, 2018, 8:05:05 AM

Your modifier is correct ZZGashi!


Also yes sorry, the effect you want is possible!

You'd just have to create a modifier which looks like this:

<Modifier TargetProperty="MaximumMovement"         Operation="Addition" Value="2" Path="../ClassEmpire/ClassGarrisonFleet/ClassShip" />
<Modifier TargetProperty="MaximumMovement"         Operation="Addition" Value="2" Path="../ClassEmpire/ClassColonizedStarSystem/ClassGarrison/ClassShip" TooltipHidden="true" />

"../ClassEmpire" means you go all the way up, then you can go back down and affect anything in the empire.

Note that in this specific example, there are ships in Fleets (ClassGarrisonFleet) and Hangars (ClassColonizedStarSystem/ClassGarrison), so there are two modifiers.

0Send private message
7 years ago
Sep 4, 2018, 9:43:05 PM

As far as properties go, is it possible to write a new one for the conversion of research into production? This is what I have so far:


<Property Name="SystemProductionFromResearchConversion"    MinValue="Negative"/>

<Modifier TargetProperty="SystemProduction"         Operation="Addition"     Value="$(SystemProductionFromResearchConversion)" TooltipHidden="false"  Priority="2"/>


It seems I might be missing a step somewhere, as it does not function, unless this is another code only thing.



Updated 7 years ago.
0Send private message
7 years ago
Sep 5, 2018, 7:53:36 AM

Yes, for this mod you'll have to not only create new SimulationDescriptors, but also copy the existing ones and add new Properties and Modifiers.

0Send private message
7 years ago
Sep 5, 2018, 10:48:37 PM

@MonAmiral


Is it possible to use the conversion, like SystemResearchFromProductionConversion or SystemResearchFromResearchConversion, effects on regular constructed star system improvements, or do they only work on improvements that are infinite? Largely because an infinite improvement is kind of useless for what I am attempting to do.

Updated 7 years ago.
0Send private message
7 years ago
Sep 6, 2018, 7:37:21 AM

Yep!


The only difference between infinite improvements and normal improvements is that the SimulationDescriptors of normal improvements are applied on the improvement (which is a child of the system) instead of the system itself! You'll just have to modify the Path of the Modifiers.

0Send private message
7 years ago
Sep 6, 2018, 11:19:56 PM
MonAmiral wrote:

Yep!


The only difference between infinite improvements and normal improvements is that the SimulationDescriptors of normal improvements are applied on the improvement (which is a child of the system) instead of the system itself! You'll just have to modify the Path of the Modifiers.

Okay, what would that look like? I have attempted several different iterations, on altering the Path, of getting something like this to work on a non-infinite improvement:


<BinaryModifier TargetProperty="SystemResearchFromResearchConversion"    Operation="Addition" Left="-1"   BinaryOperation="Multiplication" Right="$(SystemResearch)"  Path="ClassColonizedStarSystem"/>

But so far it refuses to function like that a regular constructed improvement, on an infinite improvement I can get it work just fine.

0Send private message
7 years ago
Sep 7, 2018, 12:23:20 PM

The BinaryModifier you sent would look like this on a non-infinite improvement:

<BinaryModifier TargetProperty="SystemResearchFromResearchConversion"    Operation="Addition" Left="-1"   BinaryOperation="Multiplication" Right="$(SystemResearch)"  SearchValueFromPath="true" Path="./ClassColonizedStarSystem"/>

The difference is "SearchValueFromPath" which says "properties to use as operands are on the target" and the path which earned a "./" to affect the improvement's parent, the system.

0Send private message
7 years ago
Sep 8, 2018, 2:14:06 AM

I attempted to do this:


<BinaryModifier TargetProperty="MaximumMovement"         Operation="Addition" Left="0.50" BinaryOperation="Multiplication" Right="$(SystemResearchFromResearchConversion)" SearchValueFromPath="true" Path="../ClassEmpire/ClassGarrisonFleet/ClassShip"/>

I forwarded SystemResearchFromResearchConversion into ClassEmpire, but what happens is that the movement points are not applied to any ships and double the amount of research the system produces is removed. Did I perhaps forward that property into the wrong class or does forwarding a property into another class and then using it from that class create a second instance. Especially when I have other modifiers calling the same propery from a different class.

Updated 7 years ago.
0Send private message
7 years ago
Sep 10, 2018, 7:47:23 AM

Hmm, where is this modifier located? 

If you use SystemResearchFromResearchConversion while targeting an object which does not have the property, do not use SearchValueFromPath! It would return in 0 all the time.


I highly suggest using the Simulation debugger to see everything that's going on!

Set the game launch options to "--enablemoddingtools" in Steam, then press Shift+F1 while in-game and you'll get access to a lot of cheats, tools and windows which will help you a great deal!

Using the simulation debugger you can see everything that affects anything in the empire:

0Send private message
7 years ago
Sep 10, 2018, 9:30:18 AM
MonAmiral wrote:

Hmm, where is this modifier located? 

If you use SystemResearchFromResearchConversion while targeting an object which does not have the property, do not use SearchValueFromPath! It would return in 0 all the time.


I highly suggest using the Simulation debugger to see everything that's going on!

Set the game launch options to "--enablemoddingtools" in Steam, then press Shift+F1 while in-game and you'll get access to a lot of cheats, tools and windows which will help you a great deal!

Using the simulation debugger you can see everything that affects anything in the empire:


The modifier I posted is located in the simulationdescriptor I use for the improvement I am creating. I think what is happening is that since I forwarded SystemResearchFromResearchConversion to ClassEmpire it is creating a seperate instance of the property and using that. While I have other modifiers that use the same property but from ClassColonizedStarSystem instead.

0Send private message
7 years ago
Sep 10, 2018, 3:57:30 PM

<SimulationDescriptor Name="ClassColonizedStarSystem" Type="ClassColonizedStarSystem">
   
    [...]

    <!-- Properties (SystemResearchFromResearchConversion already exists but you'll have to re-write the whole SimulationDescriptor anyway) -->
    <Property Name="SystemResearchFromResearchConversion"   MinValue="Negative"/>
    <Property Name="SystemProductionFromResearchConversion"   MinValue="Negative"/>
   
    <Property Name="BonusMovementOnAllShips"   MinValue="Negative"/>

    [...]
   
    <!-- Modifiers (note that NetSystemResearch is affected because SystemResearchFromResearchConversion uses SystemResearch and that would cause an infinite loop!) -->
    <Modifier TargetProperty="SystemProduction"     Operation="Addition"    Value="$(SystemProductionFromResearchConversion)" Priority="2"/>
    <Modifier TargetProperty="NetSystemResearch"    Operation="Addition"    Value="$(SystemResearchFromResearchConversion)" Priority="2"/>

    <!-- First modifier affects only the ships in the fleets, second one affects the ones in hangars! -->
    <Modifier TargetProperty="MaximumMovement" Operation="Addition" Value="$(BonusMovementOnAllShips)" Path="../ClassEmpire/ClassGarrisonFleet/ClassShip"/>
    <Modifier TargetProperty="MaximumMovement" Operation="Addition" Value="$(BonusMovementOnAllShips)" Path="../ClassEmpire/ClassColonizedStarSystem/ClassGarrison/ClassShip"/>

    [...]
   
</SimulationDescriptor>

<SimulationDescriptor Name="StarSystemImprovementIndustryFromScience" Type="StarSystemImprovement">
    <!-- Add 25% of SystemResearch to SystemProductionFromResearchConversion which is added to SystemProduction. -->
    <!-- Note the SearchValueFromPath="true": this means the property we're going to use as an operand (SystemResearch) is at the same place as the TargetProperty! -->
    <BinaryModifier TargetProperty="SystemProductionFromResearchConversion" Operation="Addition" Left="0.25"    BinaryOperation="Multiplication" Right="$(SystemResearch)"  Path="./ClassColonizedStarSystem" SearchValueFromPath="true" TooltipOverride="%StarSystemImprovementResearchEffectOverride"/>
    <!-- Remove 50% of SystemResearch to SystemResearchFromResearchConversion which is added to NetSystemResearch. -->
    <BinaryModifier TargetProperty="SystemResearchFromResearchConversion"   Operation="Addition" Left="-0.5"    BinaryOperation="Multiplication" Right="$(SystemResearch)"  Path="./ClassColonizedStarSystem" SearchValueFromPath="true" TooltipHidden="true" />

    <!-- Add 50% of "raw" science to bonus movement on ships, the System will apply the value on the ships. -->
    <!-- This must be done in several steps because the improvement says how much % is used, the system has the raw science value, and the ship has the movement points. -->
    <!-- An alternative would be to copy SystemResearch on this improvement (create the property and the modifier which copies its value) and apply the effect directly from here, without SearchValueFromPath. -->

    <BinaryModifier TargetProperty="BonusMovementOnAllShips" Operation="Addition" Left="0.5" BinaryOperation="Multiplication" Right="$(SystemResearch)" Path="./ClassColonizedStarSystem" SearchValueFromPath="true" TooltipOverride="%StarSystemImprovementResearchEffectOverride"/>
</SimulationDescriptor>

Here's how I would do it! I haven't tested if this works, but it should be fine.

Copy all the content of ClassColonizedStarSystem and add what I shared above, make sure all properties are before all modifiers (this is very important!!), reference the SimulationDescriptor StarSystemImprovementIndustryFromScience in your StarSystemImprovementDefinition, add some Localization for the TooltipOverrides, and it should work!

0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message