Author Topic: [MOD][Stations] Not Enough Stock 1.0b  (Read 2980 times)

NerArth

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    60
    • View Profile
on: May 09, 2018, 12:28:20 PM
Readme:

Created by NerArth, based on the mod request of http://www.avorion.net/forum/index.php/topic,4814.0.html and based on the info at http://www.avorion.net/forum/index.php/topic,1560.0.html

--Description

I created this mod based on a request by the forum user Echo-107. This mod modifies the following two files:
..\data\scripts\lib\shop.lua - where we add a random variation to the amount of any given item being stocked
..\data\scripts\entity\merchants\equipmentdock.lua - where we make the item generator iterations go higher, so that possibly more variety will exist

This mod's scope is only to increase quantities of stock, not quality. Below you can see how this was achieved.

--Installation and Technical stuff

Replace the two lua files mentioned above with the provided files.

Alternatively, if you already have modified files from another mod or modpack, this mod changes the following:

In the ..\data\scripts\lib\shop.lua file, at the function Shop:add(item_in, amount) we change the original
Code: [Select]
    item.amount = amountto
Code: [Select]
    item.amount = amount * math.random(2,5)here, we have made it so that the amount of any given stocked item is multiplied by a random value between 2 and 5

This is a smaller file, so you shouldn't get lost in it;
In the ..\data\scripts\entity\merchants\equipmentdock.lua file, at the function EquipmentDock.shop:addItems() we change the original
Code: [Select]
    while counter < 12 doto
Code: [Select]
    while counter < 36 doeffectively, this increases the amount of times the an upgrade generation is called; 36 is an arbitrary value of treble the original

--Version History
1.0.190214
Made sure the mod was compatible with Avorion v0.20

1.0.180509
Created the mod, modifies equipmentdock.lua and shop.lua files.



Download: 1.0b

Known issue: Equipment docks may generate a lot of systems available for purchase with this mod, but the default UI does not provide a way to scroll through the list, so the actual visible stock will be subjected and limited to the higher quality systems only (or until you buy out all the higher quality stock, which is easy enough in creative).
« Last Edit: February 14, 2019, 01:02:38 PM by NerArth »



Echo-107

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    13
    • View Profile
on: May 09, 2018, 09:16:48 PM
TEN THOUSAND THANKS to thee Senpai! Much much MUCH appreciated :)



NerArth

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    60
    • View Profile
on: May 09, 2018, 10:01:21 PM
TEN THOUSAND THANKS to thee Senpai! Much much MUCH appreciated :)

No problem, let me know if you have any further feedback down the line; I really want to fix the issue with not being able to see all the items in one page, but still trying to figure out how to add scrolling or pages (pages will probably be easier).



Echo-107

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    13
    • View Profile
on: May 13, 2018, 10:41:28 AM
For all intents and purposes the mod is fully functional. all stocks are up by 10 times allowing access to some serious firepower, at high cost, as in base game but ten times over. makes outfitting ships significantly easier. The fact you cant scroll in the menus is a downer but its still good.



NerArth

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    60
    • View Profile
on: February 14, 2019, 01:04:14 PM
Updated the mod to be compatible with Avorion v0.20



Luzgardeann

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    1
    • View Profile
on: March 04, 2019, 08:09:53 AM
Hi,

I took the liberty to add a pager to the code!
Feel free to decide whether you integrate it or not.
« Last Edit: March 04, 2019, 08:24:53 AM by Luzgardeann »



Simahn

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    12
    • View Profile
on: April 17, 2019, 12:59:34 PM
Updated it with the new icons, for the people who like to drag and drop.
Pager seems to be a standard feature now by the way. :)
« Last Edit: April 17, 2019, 02:46:59 PM by Simahn »