jptrrs / BurnItForFuel

Burn whatever you want on RimWorld.
https://steamcommunity.com/sharedfiles/filedetails/?id=1823276856
MIT License
0 stars 2 forks source link

separate fuel lists #3

Closed TinyGecko closed 4 years ago

TinyGecko commented 4 years ago

Is it possible to exclude specific buildings from the general fuel adding rule?

I have a chemfuel generator, stove and lights and want them to be fuelable by liquid fuels only while their non-chemfuel counterparts should not accept these fuel types.

What would be the most efficient way to achieve this?

jptrrs commented 4 years ago

Well, the easiest way would be to pick those fuels for each building in-game... But if you're looking for a way to patch that in, maybe there is a way. You can try changing the general rule to exclude any liquid fuel then adding a patch for the generator, stove and lights to just use that. It would look just like that one you tried on that passive cooler issue a while back:

`

/Defs/ThingDef[defName = "PassiveCooler" or defName = "ImprovedPassiveCooler" or defName = "AdvancedPassiveCooler"]/comps/li[@Class = "CompProperties_Refuelable"]/../../building/fixedStorageSettings/filter/thingDefs
  <value>
        <li>Mizu_ClearWater</li>
        <li>Mizu_NormalWater</li>
        <li>Mizu_RawWater</li>
        <li>Mizu_SeaWater</li>
        <li>Mizu_MudWater</li> 
  </value>

`

When you build anything that asks for some fuel that isn't on the general rule, the mod shuts down the fuel selection for that thing. I think it could work.

TinyGecko commented 4 years ago

By changing the general rule you mean excluding chemfuel from the Patch.xml? Btw fuel selection does work for fuels that are not on the general fuels list, my water coolers accept only water now and I can use the fuel tab to chose the water types. :)

I was just looking for a way to edit the chemfuel buildings without excluding chemfuel for all other buildings at the same time, but your solution seems to be the best, thank you! :)

jptrrs commented 4 years ago

By changing the general rule you mean excluding chemfuel from the Patch.xml?

Exactly!

Btw fuel selection does work for fuels that are not on the general fuels list, my water coolers accept only water now and I can use the fuel tab to chose the water types. :)

Really? Cool, then when I coded this I've anticipated something I didn't even realize... Maybe this is happening because your fuel list has more than one item. Glad the mod is behaving as expected!

I was just looking for a way to edit the chemfuel buildings without excluding chemfuel for all other buildings at the same time,

Well, I suggested it because you said "their non-chemfuel counterparts should not accept these fuel types". To exclude specific fuel items for a particular building, you could try "PatchOperationRemove" instead of "PatchOperationAdd".

TinyGecko commented 4 years ago

Just in case anyone else wants to do the same, here are the instructions to separate solid and liquid fuels.

-Open Patches.xml and uncomment chemfuel (replace <li>Chemfuel</li> with <!-- <li>Chemfuel</li> -->) -Now go to Patches_VegetableGarden.xml, uncomment <li>VG_Biofuel</li> and instead add the following lines before </Patch>:

<!-- add liquid fuels -->

<Operation Class="PatchOperationSequence">
    <success>Always</success>
    <operations>
        <li Class="PatchOperationAdd">
            <xpath>*/ThingDef/comps/li[@Class = "CompProperties_Refuelable" and fuelFilter/thingDefs/li[text() = "Chemfuel"]]/fuelFilter/thingDefs</xpath>
            <value>
                <li>VG_Biofuel</li>
            </value>
        </li>
    </operations>
</Operation>

-Repeat the second step in Patches_SmokeleafInd.xml for <li>Hempoline</li>

Now all your buildings that usually use chemfuel will only accept liquid fuels in the fuel settings, while everything else will work with solid fuels only.

jptrrs: I don't know if you get notified about new messages in closed issues, please check the issue about caravan errors. :)

TinyGecko commented 4 years ago

Hello jptrrs, with the introduction of mod settings my method of separating fuel lists for liquid fuels does not work anymore. Currently the result is that all buildings can only be powered with liquid fuels when I disable chemfuel in the settings. What can I do to make it work again?

Maybe this would be a popular official feature for your mod, too. I have noticed that many people asked for this already.

jptrrs commented 4 years ago

Hi TinyGecko! Sorry, but that won't work from 2.0 on. The mod was not designed to have separate fuel lists for each building definition, but to allow each one that is BUILT to have its own list. The update just follows that original concept, but allowing the player to choose from the options panel insetad of having to use XML. You can check the biofuel there, and it will be available on every fueled building. If you don't want to use biofuel on, say, a campfire, just unselect it form the campfire fuel tab! The effect is the same. But you can always use the older version: https://github.com/jptrrs/BurnItForFuel/releases/tag/v1.3

TinyGecko commented 4 years ago

That's unfortunate, but the new mod settings are very fancy of course! :) I have noticed that 1.3 was released today and thus it was never on the workshop. Does that mean it's on the same level concerning code and bugfixes as 2.x, just with the old XML system?

And something OT: I enjoy your other mods very much too and wanted to thank you for this!

jptrrs commented 4 years ago

That's because I forgot to mark it for "release" back when I first uploaded it. I just this did that now to make it easier for anyone to find the pre-mod setttings version, since you are bringing this up. But yes, at the moment there's not one bugfix present in version 2 that's not already there at 1.3. The only thing you'd be missing is the settings panel itself. Thanks!

João Pedro

On Tue, Feb 11, 2020 at 8:34 AM TinyGecko notifications@github.com wrote:

That's unfortunate, but the new mod settings are very fancy of course! :) I have noticed that 1.3 was released today and thus it was never on the workshop. Does that mean it's on the same level concerning code and bugfixes as 2.x, just with the old XML system?

And something OT: I enjoy your other mods very much too and wanted to thank you for this!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jptrrs/BurnItForFuel/issues/3?email_source=notifications&email_token=ALHBNPUBMPPZ7MYIIJR3TNDRCKEMTA5CNFSM4JJURE42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELMDBWQ#issuecomment-584593626, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHBNPXSJBGAQ2QRVBOTHNLRCKEMTANCNFSM4JJURE4Q .

TinyGecko commented 4 years ago

Hello again! :) I know this is a lot to ask, but would it be possible to update the 1.3 version of your mod to RW 1.1 too, please? Maybe it would even be popular in the workshop as an additional version of your mod for people who want separated fuel lists?

jptrrs commented 4 years ago

I know this is a lot to ask

Glad you know! Sorry, but if you want this mod on RW 1.1 you will just have to get used to selecting fuel on a per-building basis. Like I said before: The effect is the same.

TinyGecko commented 4 years ago

On the paper the effect is the same, but still it feels like having a cheat available in your game. On maps where wood is scarce, finally researching chemfuel and chemfuel powered buildings can make your life much easier and feels like a big achievement. When every building can use chemfuel from the very first second of the game it makes this milestone redundant, which feels like a cheat. When you don't want this cheat to happen, you have to proactively do something every time you build a new building. Much like a mod that adds a button which spawns 1.000 silver each time you push it, and the author says "just don't use it" I don't want to be tempted.

jptrrs commented 4 years ago

I understand. But hey, you're modding the game! The cheat line has been crossed a long time ago. It's up to you now, I can't prevent you form cheating yourself.

On Tue, Mar 10, 2020 at 9:49 AM TinyGecko notifications@github.com wrote:

On the paper the effect is the same, but still it feels like having a cheat available in your game. On maps where wood is scarce, finally researching chemfuel and chemfuel powered buildings can make your life much easier and feels like a big achievement. When every building can use chemfuel from the very first second of the game it makes this milestone redundant, which feels like a cheat. When you don't want this cheat to happen, you have to proactively do something every time you build a new building. Much like a mod that adds a button which spawns 1.000 silver each time you push it, and the mod author says "just don't use it" I don't want to be tempted.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jptrrs/BurnItForFuel/issues/3?email_source=notifications&email_token=ALHBNPWV2NYCFNOE2CSD63LRGYZL7A5CNFSM4JJURE42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOLIPJY#issuecomment-597067687, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHBNPSM4VRLOW3RU7ZTQDLRGYZL7ANCNFSM4JJURE4Q .

TinyGecko commented 4 years ago

I don't see it like that, but it is comprehensible that you don't want to maintain two different versions of your mod. If you should ever decide to reintroduce some sort of alternative to have separated fuel lists to version 2 of your mod, I would like that very much! :)

Also for the support of other mods (remember the water powered coolers..).