PyCoalTBaA or the PyCoal Touched by an Angel Compatibility Patch

Topics and discussion about specific mods
kinnom
Filter Inserter
Filter Inserter
Posts: 706
Joined: Fri Dec 26, 2014 4:20 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by kinnom »

D-TecT wrote:
kingarthur wrote:
romtos wrote:
aklesey1 wrote:When i'm playing with PYCP and angel's refining i have bug named - "something vent wrong"
And many many recipes where nexelit fuel rod are using - its looks like core of PYCP modding many recipes, may be its serious error in logic of mod
All those nexelit fuel rod recipes are dynamically generated as Advanced Foundry Recipes. It's possibly those "something went wrong" recipes also stem from that, but I'm not sure.
ya pycoal is trying auto gen a bunch of recipes for the advanced foundry for all of the different angel ores processing stages. i believe whats it used for will show those recipes although you cant actually use them. they shouldn't break anything as they are extra but as soon as i have time in the next few days ill look into fixing or hiding them.
To fix(hide) the "something went wrong" recipes you can put the following code at the end of "data-final-fixes.lua":

Code: Select all

-- disable recipes with "angels-void" or "slag" as main product
for name, recipe in pairs(data.raw.recipe) do
    if recipe.main_product == "angels-void" or recipe.main_product == "slag" then
        log("disable " .. name)
        data.raw.recipe[name].enabled = false
    end
end   
I haven't check if there is another need for the recipes, I just think that they're not needed an hide them.
That might break the flarestack in Angel's petrochem, as it uses hidden recipes which output the void item with a 0 percent chance.
no yes yes no yes no yes yes
D-TecT
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Sep 11, 2017 6:20 am
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by D-TecT »

kinnom wrote:
D-TecT wrote:
kingarthur wrote:
romtos wrote:
aklesey1 wrote:When i'm playing with PYCP and angel's refining i have bug named - "something vent wrong"
And many many recipes where nexelit fuel rod are using - its looks like core of PYCP modding many recipes, may be its serious error in logic of mod
All those nexelit fuel rod recipes are dynamically generated as Advanced Foundry Recipes. It's possibly those "something went wrong" recipes also stem from that, but I'm not sure.
ya pycoal is trying auto gen a bunch of recipes for the advanced foundry for all of the different angel ores processing stages. i believe whats it used for will show those recipes although you cant actually use them. they shouldn't break anything as they are extra but as soon as i have time in the next few days ill look into fixing or hiding them.
To fix(hide) the "something went wrong" recipes you can put the following code at the end of "data-final-fixes.lua":

Code: Select all

-- disable recipes with "angels-void" or "slag" as main product
for name, recipe in pairs(data.raw.recipe) do
    if recipe.main_product == "angels-void" or recipe.main_product == "slag" then
        log("disable " .. name)
        data.raw.recipe[name].enabled = false
    end
end   
I haven't check if there is another need for the recipes, I just think that they're not needed an hide them.
That might break the flarestack in Angel's petrochem, as it uses hidden recipes which output the void item with a 0 percent chance.
Ok, then it would be better to hide the recipes and not disable them:

Code: Select all

-- hide recipes with "angels-void" or "slag" as main product
for name, recipe in pairs(data.raw.recipe) do
    if recipe.main_product == "angels-void" or recipe.main_product == "slag" then
        log("hide " .. name)
        data.raw.recipe[name].hidden = true
    end
end 
edit: I took a quick look in the angels source code and the recipes should be hidden - so this modification shouldn't break anything
aklesey1
Smart Inserter
Smart Inserter
Posts: 1862
Joined: Sun May 18, 2014 3:45 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by aklesey1 »

Hey kingarthur, what ur plans for 0.4 version? What changes can we expect?
Nickname on ModPortal - Naron79
kingarthur
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Sun Jun 15, 2014 11:39 am
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by kingarthur »

aklesey1 wrote:Hey kingarthur, what ur plans for 0.4 version? What changes can we expect?
im got to still deal with those extra unneeded recipes that are broke. ive got the aromatics issue dealt with and and making some tweaks to science. been busy lately so it will mostly be uploaded sometime Monday
aklesey1
Smart Inserter
Smart Inserter
Posts: 1862
Joined: Sun May 18, 2014 3:45 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by aklesey1 »

Tweaks to science? Oh that's sounds interesting - yeah these 3 first science packs some complicated but it's alright all good for now i think
And what are u planning to change? May be 3 last science packs?
Nickname on ModPortal - Naron79
User avatar
ZombieMooose
Filter Inserter
Filter Inserter
Posts: 289
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by ZombieMooose »

You're doing the Lord's work.
"men will literally learn everything about ancient Rome instead of going to therapy"
aklesey1
Smart Inserter
Smart Inserter
Posts: 1862
Joined: Sun May 18, 2014 3:45 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by aklesey1 »

aklesey1 wrote:Tweaks to science? Oh that's sounds interesting - yeah these 3 first science packs some complicated but it's alright all good for now i think
And what are u planning to change? May be 3 last science packs?
Idea for science tweaking
aklesey1 wrote:think pyanodon already have some ideas for production science pack
I think it can be
Battery + Methanol canister + niobium pipe + fuel rod

How do u like this idea of production science pack reworking?
Nickname on ModPortal - Naron79
aklesey1
Smart Inserter
Smart Inserter
Posts: 1862
Joined: Sun May 18, 2014 3:45 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by aklesey1 »

pyanodon wrote:
aklesey1 wrote:What can be the general between aromatics and natural gas?
I can suggest aromatics could be brokrn to natural gas and vice versa with the use of some catalyst or strong acid.
Any ideas about this people? Just asking i'm curious
Nickname on ModPortal - Naron79
User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by Shenpen »

I need to understand the compatibility issues better.
kingarthur
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Sun Jun 15, 2014 11:39 am
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by kingarthur »

Shenpen wrote:I need to understand the compatibility issues better.
what do you mean. like what issues they have working together?
User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by Shenpen »

kingarthur wrote:
Shenpen wrote:I need to understand the compatibility issues better.
what do you mean. like what issues they have working together?

I need to understand how I make my own mod fit in with the mods that people often use allready. Say Bob's Mods or Angel's Ores.

These mods have lots of items in common with my mod. So it should not be a huge problem to have them co-exist in the same campaign.
But I need to understand how to manage item names, recipe names and so on.

Idealy we would have a set of items that could be common to mods that need say purified water, manganese ore or carbon dioxide.
I would like to know how far we are from a situation like that, and what is needed for that to be realized.
kingarthur
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Sun Jun 15, 2014 11:39 am
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by kingarthur »

well the easiest part would be merging similar items by just having them have the same name and the game should add them together automagicly. recipes and tech are a bit harder and depending on how they need to merge you would need an optional dependency setup to adjust recipes based on other loaded mods. or just make sure your recipes dont use the same names as other mods if you dont want them changed.

i dont think its very likely that there will ever really be a core items mod that all others are based on. the cost weve got so far is bobs library mod as getting a standard in place would be rather difficult to setup with so many mods already out there. there was i discussion on it somewhere in the forums but im not sure where its at now.

im sorry if this isnt the most helpful explanation but if youve got any specific issues with something pm me and i can help you get it taken care of with more concrete answers
User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by Shenpen »

So what you are saying is that items should always have similar names and recipes always different names -
And this will have the effect that "same-named" items can work in both mods -
And that the recipes can produce the items in different ways while not interfering with each other -

Is that correct?
kingarthur
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Sun Jun 15, 2014 11:39 am
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by kingarthur »

Shenpen wrote:So what you are saying is that items should always have similar names and recipes always different names -
And this will have the effect that "same-named" items can work in both mods -
And that the recipes can produce the items in different ways while not interfering with each other -

Is that correct?
yes. that exactly it.

just fyi if you didn't already know.

be aware by name i mean the names used inside the .lua files. not the name that displays in game based on localization files.

also if you use different icons form a mod that shares items depending on how the load order is it might not use your icon if the other mod is loaded later and would need a dependency setup to make sure yours loads after that mod
User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by Shenpen »

kingarthur wrote:[
...also if you use different icons from a mod that shares items, depending on how the load order is, it might not use your icon if the other mod is loaded later and would need a dependency setup to make sure yours loads after that mod
So the last mod loaded have final say in what icon is used for an item, correct?

Now for the more tricky parts:
Both Angel's and Bob's have some really nice entities (chemical plants, fast assemblers).
Would it be a problem if I added the crafting categories that these entities handle, to the recipes in my mod.
Ideally with the effect that the recipes would show up as options in the menu for said entities.
Are there technical problems in that?
Are any good rules of nice behavior ignored by doing so?
kingarthur
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Sun Jun 15, 2014 11:39 am
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by kingarthur »

Shenpen wrote:
kingarthur wrote:[
...also if you use different icons from a mod that shares items, depending on how the load order is, it might not use your icon if the other mod is loaded later and would need a dependency setup to make sure yours loads after that mod
So the last mod loaded have final say in what icon is used for an item, correct?
Yes thats right
Shenpen wrote: Now for the more tricky parts:
Both Angel's and Bob's have some really nice entities (chemical plants, fast assemblers).
Would it be a problem if I added the crafting categories that these entities handle, to the recipes in my mod.
Ideally with the effect that the recipes would show up as options in the menu for said entities.
Are there technical problems in that?
Are any good rules of nice behavior ignored by doing so?
with adding recipes to bobs or angels entity's you need to include either a hard dependency if your mod always requires their buildings or a soft dependency if you only want to use their stuff if the player has their mods installed.
it shouldn't be an issue to add any recipe to a entity and have it displayed if the dependency is setup.

on rules of good behavior i have no idea. it should be ok if your just adding the recipes to display in game as i know arch666angel doesn't want his entities used in other mods without permission but i would suggest asking bobingabout or arch666angel as its their stuff you would be messing with and they would be able to give you a better answer on that side of things
User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by Shenpen »

kingarthur wrote:


with adding recipes to bobs or angels entity's you need to include either a hard dependency if your mod always requires their buildings or a soft dependency if you only want to use their stuff if the player has their mods installed.
it shouldn't be an issue to add any recipe to a entity and have it displayed if the dependency is setup.

on rules of good behavior i have no idea. it should be ok if your just adding the recipes to display in game as i know arch666angel doesn't want his entities used in other mods without permission but i would suggest asking bobingabout or arch666angel as its their stuff you would be messing with and they would be able to give you a better answer on that side of things
So

1. How is a soft (optional) dependency defined in lua?

2. How is a hard (mandatory/necessary) dependency defined in lua?

3. I'm trying to tread carefully out of good manors, but also because drugs tend to be a hot subject for some people. Arch666Angel has been nothing but supportive of my efforts, but others might not feel the same way. I want to respect everybody, no matter what their take on drugs are, also because I know that it is quite a bit of work to put a fully functional mod together. Also, pure and simply nicking someone's entities and using them is simple theft unless you have a clear permission to do so. At the moment I'm trying to find out what I can and should do for the users that would like to use Bob's, Angels or other mods in combination with DrugLab. So good to get real clear about both the technical side and the rules for respectful behavior.
kingarthur
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Sun Jun 15, 2014 11:39 am
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by kingarthur »

Shenpen wrote:
So

1. How is a soft (optional) dependency defined in lua?

2. How is a hard (mandatory/necessary) dependency defined in lua?
dependencies.png
dependencies.png (36.82 KiB) Viewed 8607 times
here is an example from my pycoal/ angel compatibility mod. as you can see in the pic the normal/hard dependency just have the mod name in quotes. the soft dependency has a question mark in front of the name that makes it an optional file.
optional mod.png
optional mod.png (25.57 KiB) Viewed 8607 times
along with the soft dependency you need to add code to declare if that mod is found what changes need to take place. in my case i add a if statement in the data final fixes that says if aai industry was detected to load the updates.aai-updates file. so that any changes i made for that mod only was in its own file for organization.
User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by Arch666Angel »

Shenpen wrote:
kingarthur wrote:


with adding recipes to bobs or angels entity's you need to include either a hard dependency if your mod always requires their buildings or a soft dependency if you only want to use their stuff if the player has their mods installed.
it shouldn't be an issue to add any recipe to a entity and have it displayed if the dependency is setup.

on rules of good behavior i have no idea. it should be ok if your just adding the recipes to display in game as i know arch666angel doesn't want his entities used in other mods without permission but i would suggest asking bobingabout or arch666angel as its their stuff you would be messing with and they would be able to give you a better answer on that side of things
So

1. How is a soft (optional) dependency defined in lua?

2. How is a hard (mandatory/necessary) dependency defined in lua?

3. I'm trying to tread carefully out of good manors, but also because drugs tend to be a hot subject for some people. Arch666Angel has been nothing but supportive of my efforts, but others might not feel the same way. I want to respect everybody, no matter what their take on drugs are, also because I know that it is quite a bit of work to put a fully functional mod together. Also, pure and simply nicking someone's entities and using them is simple theft unless you have a clear permission to do so. At the moment I'm trying to find out what I can and should do for the users that would like to use Bob's, Angels or other mods in combination with DrugLab. So good to get real clear about both the technical side and the rules for respectful behavior.
You have to make one big decision: Do you want your mod to work on it's own, or do you understand it as an extension to others. The first case would require you to set a soft dependency in your info.json, which will load your mod after the ones you set your dependency on. For what you want to do this is probably not that important but it will show people that it is possible to combine these. The second case is rather simple, you add a hard dependency in the info.json and your mod wont be loaded without the dependencies present.
There are ups and downs to that both cases, if you go for the standalone plus mod support variant you have to go through several cases of combining the mods and make sure everything works as you want them to. Due to the way both bobs and my mods are setup you can create a lot of different combinations. You have to make sure that all the items/fluids/entities are there you want to use, the way I handle this is have either recipes that are initially loaded with a dummy item in data, which will then be replaced by the real results in data-updates depending on what mods are there (case building).
The only works in conjunction with mod xy variant is easier to setup in that regard because you can assume that certain things are always there, so you don't have to create them yourself and you don't have to create fallbacks if they are not.

It's the same decision I had to make when I started out with my mods, if I want to be dependent on bobs or do the standalone thingy, I decided to build on what bob already has and then progress into the second variant removing more and more dependencies on bobs stuff, that has been not only a progress for the mods to go through but me learning how modding and coding works for factorio. The difficulty is in finding a way to setup your stuff that it is dynamic and durable enough so it can handle a lot of cases, that you wont break other stuff in doing so and that it is still expandable.

On the matter of entities: The only thing I care about is that the GFX stay inside my mods and the larger part of the override functions because they are not my intellectual property, I give permission or make some custom GFX on occasion for people asking me, but I decide that on each case. If you add your recipes to entities ingame, modify them in a way the script allows for (changing stats, add crafting categories, etc) dear god please do so, I don't think that there will be anyone mad at you for doing so. And if you are unsure just ask :D
User avatar
Shenpen
Fast Inserter
Fast Inserter
Posts: 227
Joined: Sat Aug 27, 2016 2:46 pm
Contact:

Re: PyCoalTBaA or the PyCoal Angels Patch

Post by Shenpen »

1. Thank you!
2. Lots of info for me to diggest!
3. Angel: I want to ask for a design at some later point. The eastetics of the mod is not high on my list at the moment as there are still functional stuff to sort out. But soon....:D


Edit:

Found this:
How do I declare a dependency of my mod?
This is done in the info.json file of your mod. Under the dependency field, simply place the internal name (Not the pretty title!) of the mod you want to declare as a dependency. It is a json table, so multiple can be defined. If you want to declare it as an optional dependency, then put a question mark and space before the name. To define a minimum version, simply put a logic operator, such as >=, and a version. As an example:

"dependencies": ["? MAIN-DyTech-Machine", "? CORE-DyTech-Core", "bobenemies>=0.13.1", "bobores", "? 5dim_ores"],
Be careful with required dependencies, as they will cause your mod to be disabled if they are unmet or ill-defined. Dependencies also cannot be circular, if another mod requires yours, you cannot require it; Somebody has to load first.
https://wiki.factorio.com/Tutorial:Modding_FAQ
Post Reply

Return to “Mods”