RimWorld

RimWorld

Advanced Power Plus
Klein 28 Oct, 2022 @ 7:20am
Modding: allow to use basePowerConsumption to rebalance
New version of advanced solar ignores basePowerConsumption just like stock. Is there way to adjust solar output using xml patch?

Details: all other stock power generators seem to read their max output from property <li Class="CompProperties_Power"><basePowerConsumption> (example from CompPowerPlantWind.cs: return base.PowerOutput / (-base.Props.basePowerConsumption * 1.5f);)
Stock solar power class is only exception: it hardcodes value "private const float FullSunPower = 1700f;" and ignores value in ThingDef making rebalancing difficult.

Previously your modded class allowed one to make patches like this:
<Operation Class="PatchOperationReplace"> <xpath>/Defs/ThingDef[defName="SolarGenerator"]/comps/li[@Class="CompProperties_Power"]</xpath> <value> <!-- <li Class="CompProperties_Power"> <compClass>CompPowerPlantSolar</compClass> <basePowerConsumption>-1</basePowerConsumption> <transmitsPower>true</transmitsPower> </li> 1700 W is hardcoded so let's switch to mod --> <li Class="CompProperties_Power"> <compClass>sd_adv_powergen.sd_adv_powergen_CompAdvPowerPlantSolar</compClass> <basePowerConsumption>-1000</basePowerConsumption> <transmitsPower>true</transmitsPower> </li> </value> </Operation>

But new version for 1.4 hardcodes 3400 :(.
< >
Showing 1-5 of 5 comments
Miguel V-DF  [developer] 29 Oct, 2022 @ 9:36am 
I got it. I am very busy right now, but when I can I will try to make it open to xml patching. In the meantime, can you use https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1084452457 to see if you can edit the energy output ingame at least?
Klein 1 Nov, 2022 @ 12:38pm 
Thanks for suggestion, it is interesting tool. Unfortunately, it allows to modify only construction resource cost and pathing of buildings, but not their power requirement/output.
Klein 8 Sep, 2023 @ 5:58am 
There is pull request to fix this issue: https://github.com/Meltup/Advanced-Power-Plus/pull/2
Miguel V-DF  [developer] 8 Sep, 2023 @ 1:59pm 
Originally posted by Klein:
There is pull request to fix this issue: https://github.com/Meltup/Advanced-Power-Plus/pull/2
Oh, I will take a look and test it and if I find no problems and conflicts with other mods I will merge it, thanks anyway!
Miguel V-DF  [developer] 29 Nov, 2023 @ 2:40am 
And I never got around to it, sorry, I will download Rimworld again and check it out
< >
Showing 1-5 of 5 comments
Per page: 1530 50