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] Bulking up the Shops and Factories


mysteryx
 Share

Recommended Posts

With the additions and edits below the equipment dock is worth visiting it. And Turret factories can produce higher quality turrets.

And every shop has more items in stock now!

 

Ive posted the code for this, to edit the files by hand, in case you have to redo things or koonschi updated files.

 

----------

 

\data\scripts\entity\merchants\turretfactory.lua (client + serverside)

 

Starting Line 348

    rarityCombo:addEntry("Common"%_t)
    rarityCombo:addEntry("Uncommon"%_t)
    rarityCombo:addEntry("Rare"%_t)
    rarityCombo:addEntry("Exceptional"%_t)

 

Add

rarityCombo:addEntry("Exotic"%_t)

or even

rarityCombo:addEntry("Legendary"%_t)

When you want to to build these quality turrets

 

Screenshot: https://i.gyazo.com/248fcb74fb7a79cde329be96225c849c.png

----------

 

\data\scripts\lib\shop.lua (serverside)

 

Starting Line 529

    item.name = item.name or ""
    item.price = item.price or 0
    item.amount = amount

  item.amount = amount * x

Replace x for any wished number

(Thanks to LordHavoc! >> Link <<)

 

Screenshot: see below

----------

 

\data\scripts\lib\fightergenerator.lua (serverside)

 

Starting line 42

    rarities[5] = 0.2 -- legendary
    rarities[4] = 1 -- exotic
    rarities[3] = 4 -- exceptional
    rarities[2] = 8 -- rare
    rarities[1] = 16 -- uncommon
    rarities[0] = 64 -- common

Remove rarity you dont want  or set it to 0, and adjust the other values if needed/wanted.

All remove rarities will not shown in the shop again!

 

Screenshot: https://i.gyazo.com/c6cda516183f3bb8b92ba31c337dd88d.png

----------

 

\data\scripts\lib\turretgenerator.lua (serverside)

 

Starting line 42

    rarities[5] = 0.2 -- legendary
    rarities[4] = 1 -- exotic
    rarities[3] = 4 -- exceptional
    rarities[2] = 8 -- rare
    rarities[1] = 16 -- uncommon
    rarities[0] = 64 -- common

Remove rarity you dont want or set it to 0, and adjust the other values if needed/wanted.

All remove rarities will not shown in the shop again!

 

Screenshot: https://i.gyazo.com/539cf1a11918437576980ffa41ef88d5.png

----------

 

\data\scripts\lib\upgradegenerator.lua (serverside)

 

starting line 63

    table.insert(weights, 16)
    table.insert(weights, 48) -- common
    table.insert(weights, 16) -- uncommon
    table.insert(weights, 8) -- rare
    table.insert(weights, 4) --  exceptional
    table.insert(weights, 1) -- exotic
    table.insert(weights, 0.2) -- legendary

 

starting line 88

    table.insert(weights, 2 + pos * 14) -- 16 at edge, 2 in center
    table.insert(weights, 8 + pos * 40) -- 48 at edge, 8 in center, common
    table.insert(weights, 8 + pos * 8) -- 16 at edge, 8 in center, uncommon 
    table.insert(weights, 8) -- rare
    table.insert(weights, 4) -- exceptional
    table.insert(weights, 1) -- exotic
    table.insert(weights, 0.2) -- legendary

 

Set rarities you don't want to 0, adjust the other values if needed/wanted.

All remove rarities will not shown in the shop again!

 

Screenshot: https://i.gyazo.com/b6b7025c2d9645d6346b18f43ccf1af6.png

Link to comment
Share on other sites

One odd thing I noticed after making these changes is that when putting in more materials at turret factories or upgrade factories is that the stats go down, while it seems to me that they should go up when you put more materials in them.

Might be just a coïncidence but I didn't notice it before :p

Link to comment
Share on other sites

  • 1 month later...

As far as I know, changing turretgenerator.lua and upgradegenerator.lua will affect more than just the equipment dock. It will also affect boss loot, faction thank-you rewards and maybe ai ships? Can't tell.

 

There's a call to UpgradeGenerator.getSectorProbabilities(...) in equipmentdock.lua. Just change the weights variable after the call rather than globally.

 

For turrets, it seems they are using TurretGenerator.generate(...) in turretmerchant.lua. Unfortunately that will probably affect the turret merchant as well. I'm not sure if it's possible to make the equipment dock use a custom script. I think currently the equipment dock just has the turret merchant script slapped on. Either way, just pass the rarities to the generate function from turretmerchant.lua.

 

Also watch for the 0th element gotcha with the arrays. For whatever reason UpgradeGenerator uses an array starting with 1 and turret generation starts with 0.

 

EDIT: Apparently you can use a custom script for the turret part of the equipment dock; "createEquipmentDock" in SectorGenerator.lua but I haven't tested it.

Link to comment
Share on other sites

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...