Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam

[MOD] All Production Chains


Laserzwei
 Share

Recommended Posts

The current game is missing 2 (supply-)factories that prevent you from building fully independent Productionchains:

 

1) Diamonds

2) Gems*

 

This small addon adds

A different way of getting Biogas:

Bio Gas Fermenter

40xPlant -> 4xBio Gas + 10xWater + garbage: 1xToxic Waste

 

Version M

1) Diamond Mine

 

Version S

1)Diamond Factory

2xEnergy Cell + 2xCoal -> 2xDiamond

 

*Gems are not provided.

 

You can only install one Version at a time!

From Avorion 0.23 on, this mod will be continued in the workshop

S (https://steamcommunity.com/sharedfiles/filedetails/?id=1692693432)

M (https://steamcommunity.com/sharedfiles/filedetails/?id=1692693709)

Since 0.23+ became the main gameversion, there is no download here.

 

Version History

 

 

-- 1.4 for beta 0.21 [2019-02-26]

  - renamed modfile to productionChains

  - added names for special factories (vanilla)

-- 1.3 for 0.20.x [2018-12-04]

  - anti-grav -> antigrav

  - removed 2 double Noble metal mines (vanilla)

-- 1.2

  - double silicon removed

  - using vanilla Raw Oil and Coal production

  - adjusted Diamond production

-- 1.1

  - 0.15 economy update compatibility

-- 1.0

  - Cink->Zinc(0.12)

-- 0.99

  - release

 

 

Installation: like any other mod drop the content of the zip file into your /Avorion/ installation folder. By default Version S is selected.

To swtich to Version M you have to uncomment line 130 and comment line 131 out:

 

if not pcall(require, "mods/extraminesM/scripts/lib/productionsindex") then print("Failed to load extraminesM") end
--if not pcall(require, "mods/extraminesS/scripts/lib/productionsindex") then print("Failed to load extraminesS") end

There should only be 2 if at the end of the file.

 

Files

/data/scripts/lib/productionsindex.lua

 

Uninstall: just replace /data/scripts/lib/productionsindex.lua with the Vanilla one.

Already build Player/NPC stations will KEEP the mod's Production.

 

License

Public Domain

Link to comment
Share on other sites

  • 2 weeks later...

I've been thinking about this same problem. The issue is that Raw Oil and Coal from an asteroid are silly, since both are products from bio degradation. So unless the asteroid is from an exploded Earth type planet, they're not going to have either.

 

So what I thought was to make a Coal Compressor type factory that takes Carbon and makes it into Coal.

 

For Oil, we can use bio oils, but that wouldn't make sense for a lot of things like Plastic factories, so I added some things for Plastic, based on: https://en.wikipedia.org/wiki/Polyamide_11

 

In goodindex.lua:

goods["Castor Bean"] = {name="Castor Bean", plural="Castor Beans", description="Beans mostly used in the production of Polyamide 11 bioplastics.", icon="data/textures/icons/coffee-beans.png", price=321, size=0.2, level=5, importance=0, illegal=false, dangerous=false, }

 

In productionsindex.lua:

table.insert(productions, {factory="${good} Manufacturer ${size}", ingredients={{name="Castor Bean", amount=1, optional=0}, {name="Energy Cell", amount=1, optional=1}}, results={{name="Plastic", amount=5}}, garbages={}})
table.insert(productions, {factory="${good} Farm ${size}", ingredients={{name="Energy Cell", amount=1, optional=1}, {name="Water", amount=10, optional=0}}, results={{name="Castor Bean", amount=12}}, garbages={{name="Oxygen", amount=1}}})

 

I've just added a Coal Mine for now :)

Link to comment
Share on other sites

I've been thinking about this same problem. The issue is that Raw Oil and Coal from an asteroid are silly, since both are products from bio degradation. So unless the asteroid is from an exploded Earth type planet, they're not going to have either.

 

So what I thought was to make a Coal Compressor type factory that takes Carbon and makes it into Coal.

 

For Oil, we can use bio oils, but that wouldn't make sense for a lot of things like Plastic factories, so I added some things for Plastic, based on: https://en.wikipedia.org/wiki/Polyamide_11

 

In goodindex.lua:

goods["Castor Bean"] = {name="Castor Bean", plural="Castor Beans", description="Beans mostly used in the production of Polyamide 11 bioplastics.", icon="data/textures/icons/coffee-beans.png", price=321, size=0.2, level=5, importance=0, illegal=false, dangerous=false, }

 

In productionsindex.lua:

table.insert(productions, {factory="${good} Manufacturer ${size}", ingredients={{name="Castor Bean", amount=1, optional=0}, {name="Energy Cell", amount=1, optional=1}}, results={{name="Plastic", amount=5}}, garbages={}})
table.insert(productions, {factory="${good} Farm ${size}", ingredients={{name="Energy Cell", amount=1, optional=1}, {name="Water", amount=10, optional=0}}, results={{name="Castor Bean", amount=12}}, garbages={{name="Oxygen", amount=1}}})

 

I've just added a Coal Mine for now :)

I have no plans to change the current setup. If you think that your changes are worth to be used by other players, then pack them into a mod and publish it in a seperate new Topic.

Link to comment
Share on other sites

Hmm. We might want to make a thread with all these factory additions, not specifically one mod, just what people could add or change.

 

Right now I'm too busy building stuff, though!

 

Edit: On a different note, have you been able to figure out how the price for a factory/mine is being calculated? My bean farm is costing tons of money to build..

Link to comment
Share on other sites

from tradingmanager.lua

buying:

-- empty stock -> higher price
    local factor = getNumGoods(goodName) / getMaxStock(good.size) -- 0 to 1 where 1 is 'full stock'
    factor = 1 - factor -- 1 to 0 where 0 is 'full stock'
    factor = factor * 0.4 -- 0.4 to 0
    factor = factor + 0.8 -- 1.2 to 0.8; 'no goods' to 'full'

    local relationFactor = 1
    if sellingFaction then
        local sellerIndex = nil
        if type(sellingFaction) == "number" then
            sellerIndex = sellingFaction
        else
            sellerIndex = sellingFaction.index
        end

        if sellerIndex then
            local relations = Faction():getRelations(sellerIndex)

            if relations < -10000 then
                -- bad relations: faction pays less for the goods
                -- 10% to 100% from -100.000 to -10.000
                relationFactor = lerp(relations, -100000, -10000, 0.1, 1.0)
            elseif relations >= 50000 then
                -- very good relations: factions pays MORE for the goods
                -- 100% to 120% from 80.000 to 100.000
                relationFactor = lerp(relations, 80000, 100000, 1.0, 1.15)
            end

            if Faction().index == sellerIndex then relationFactor = 0 end
        end
    end

    return round(good.price * relationFactor * factor * buyPriceFactor)

 

selling:

local factor = getNumGoods(goodName) / getMaxStock(good.size) -- 0 to 1 where 1 is 'full stock'
    factor = 1 - factor -- 1 to 0 where 0 is 'full stock'
    factor = factor * 0.4 -- 0.4 to 0
    factor = factor + 0.8 -- 1.2 to 0.8; 'no goods' to 'full'


    local relationFactor = 1
    if buyingFaction then
        local sellerIndex = nil
        if type(buyingFaction) == "number" then
            sellerIndex = buyingFaction
        else
            sellerIndex = buyingFaction.index
        end

        if sellerIndex then
            local relations = Faction():getRelations(sellerIndex)

            if relations < -10000 then
                -- bad relations: faction wants more for the goods
                -- 200% to 100% from -100.000 to -10.000
                relationFactor = lerp(relations, -100000, -10000, 2.0, 1.0)
            elseif relations > 30000 then
                -- good relations: factions start giving player better prices
                -- 100% to 80% from 30.000 to 90.000
                relationFactor = lerp(relations, 30000, 90000, 1.0, 0.8)
            end

            if Faction().index == sellerIndex then relationFactor = 0 end
        end

    end

    return round(good.price * relationFactor * factor * sellPriceFactor)

Link to comment
Share on other sites

That's the buying of the goods for NPC factories and such. What I was looking for was the actual price when you build a factory.

 

I'll continue looking if I ever stop building stuff... >< Money isn't really a serious issue either way.

 

Edit: Thanks for those code snippets, though, I'm going to have to look into those as well if I want to finish my little trader code.

Link to comment
Share on other sites

price variance broken down is roughly price*0.5*relationfactor for full stock and price*1.5*relationfactor for empty stocks.

 

building a factory is defined in stationfounder.lua and Minefounder.lua:

 

local diff = resultValue - ingredientValue

    local costs = 3000000 -- 3 mio minimum for a factory
    costs = costs + diff * 4500

where resultValue is the accumulated Value (good.price) of produced goods and ingredientValue is the accumulated Value of all ingredients.

Link to comment
Share on other sites

price variance broken down is roughly price*0.5*relationfactor for full stock and price*1.5*relationfactor for empty stocks.

 

building a factory is defined in stationfounder.lua and Minefounder.lua:

 

local diff = resultValue - ingredientValue

    local costs = 3000000 -- 3 mio minimum for a factory
    costs = costs + diff * 4500

where resultValue is the accumulated Value (good.price) of produced goods and ingredientValue is the accumulated Value of all ingredients.

 

Yep. I found it and adjusted the price of my beans to a more reasonable level. I'm still working my way through all the scripting and documentation, but I'll get there, sooner or later!

 

Thanks for the help :)

Link to comment
Share on other sites

  • 4 months later...

As of the most recent updates, I'm not sure why but I installed this and the found a mine menu's completely blank. It has no mine options what-so-ever. Mod conflict? Maaaaybe? But I removed this mod and restored the original productionsindex.lua back in it's place and the mines show up again.

Link to comment
Share on other sites

Hello,

 

Same situation here. Blank mine menu after update.

 

It is beacause of the fixed spelling of zinc, mod needs to be updated.

But you can also easily do by yourself until mod gets updated:

 

Open the modfile with any texteditor like notepad and replace all "Cink" entries by "Zinc", then it will work again.

Link to comment
Share on other sites

  • 2 months later...

Forgive me the noobish questions, this is the first mod I'm thinking of applying to the server I run.

 

Is that productionindex file one that gets updated much?  Would it only get updated when stations are added to the game? 

 

I'm technically adept, but never really done this sort of thing precisely.  The last thing I want to do is skrag the server, or be stuck waiting for a mod to be updated before I can run a new patch.

Link to comment
Share on other sites

Well I guess that depends a little on how you plan to update your server. If you want to keep it up-to-date always, then I advise you to keep a copy of your most recent version of the Steam\...\Avorion\data folder and always make a copy before you apply a new patch, then diffcheck the newly patched files against your older copy, and see if any files were affected that are being altered / interacted with by your mods.

 

If so, you can read in the diffcheck what exactly changed, and try to make an informed decision on whether or not the update would break the mods, and if you don't trust it, just hold back on the update (i.e. "patch" your game back down using the older copy you preserved) and ask around on these fora whether the mod authors think the update will have a negative impact on the way the mod functions.

 

I know that all sounds rather obtuse and like a lot of work to have to do each time there's an update, and you're right. It's why I'm currently feverishly trying to create a mod manager to remedy that and do all of that for you, and why we'll be super happy once modding gets integrated into the Steam Workshop like the devs say they plan on doing at some point, and the installation of mods becomes a much more streamlined process.

Link to comment
Share on other sites

Forgive me the noobish questions, this is the first mod I'm thinking of applying to the server I run.

 

Is that productionindex file one that gets updated much?  Would it only get updated when stations are added to the game? 

 

I'm technically adept, but never really done this sort of thing precisely.  The last thing I want to do is skrag the server, or be stuck waiting for a mod to be updated before I can run a new patch.

Since I released this mod, the file was never changed. This is highly unlikely to change and even if it did, you should still be able to use the modded file.

Link to comment
Share on other sites

Since I released this mod, the file was never changed. This is highly unlikely to change and even if it did, you should still be able to use the modded file.

 

*smartassmode on* Cink > Zinc *smartassmode off*  :P

 

But its true, this file usely never changes.

darn forgot about it :D

Link to comment
Share on other sites

  • 5 weeks later...
  • 1 month later...

Can't seem to find a production source for Gems in the game.

 

Jewelry production chain seems a relatively sweet mid tier chain, and it needs Gems/Diamonds. This mod covers Diamons, and that's great!

 

Can you maybe add Gems too?  ::)

 

Edit: actually the whole chain might need some additional work, since there's no place for Jewelry to be sold except random Trading Posts. This is a problem with some other production chains as well I believe.

Link to comment
Share on other sites

  • 11 months later...
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...