Jump to content

[MOD] AutoResearch Version 1.0


Cypher

Recommended Posts

As the name suggests this mod adds the option to do automated research for both System Upgrades & Turrets. This is easily done by selecting the rarities in the Research Station window and selecting Automatic (See image below).

 

Currently it will only research exact matches for system upgrades. For turrets it will take into account the material, weapon type (e.g. Railgun) and the number of weapons. Research is done when atleast 3 of the items are available and add the 4th and 5th if possible.

 

It does Not mess around with the Xsotan Artifacts!

 

If you do come across bugs please take the time to let me know, i have tested it time and time again

but most likely did not try any sequence of events you guys might.

Furthermore if you have any suggestions or ideas feel free to share them. Also if it might be an idea for a different mod ;)

 

Enjoy!

 

Installation

 

To install:

Copy the data folder in AutoResearch to the Avorion install folder. This is usually located in your steam installation folder under: .../Steam/SteamApps/common/Avorion

 

To uninstall:

Copy the data folder in Restore to the Avorion install folder, and (optional) manually remove the autoresearch.lua in .../Steam/SteamApps/common/Avorion/data/scripts/entity/merchants

 

 

 

Planned features:

  • Setting for minimum amount needed before research is done
  • Setting for filling empty slots with lower or higher Rarity
  • Setting for filling emtpy slots with turrets of a different material/weapon count
  • Visualisation for items used in research[1]

[1] This is currently turned off to improve performance, also the inventory in the window will not be updated until all research is complete for the same reason.

 

Images

 

4d36ebdd67d972cc96bb459f6c6b190f.png

 

AutoResearch.zip

Link to comment
Share on other sites

  • Replies 78
  • Created
  • Last Reply

Top Posters In This Topic

Does the mod work on client side, or it needs to be installed on server as well?

 

The way modding currently works it does need some changes to the server side script for the researchstation.

I have tried to get around this but have not yet managed to do this succesfully. Currently the game developer is working

on better mod support so in the future it might be possible.

 

Also, is it really 1 line of code? Or it has issues with line ending chars?

 

No, it is a minified version of my code where variable names have been replaced and comments are removed including line endings. The reason i did this because in the past i have had code stolen without any credit given in another modding community. So i did it this way to atleast to some degree make it harder for the people who do steal other people's code, shamelessly modify it a tiny bit, and call it their own.

 

This however does not mean that i'm not willing to share my approach, ideas & solutions. If you (or anyone else) is interested in how i did certain things you are free to send me a PM about it :)

Link to comment
Share on other sites

That it only allows you to use it once is a bug that can happen, which i already fixed in the update im working on. Currently it only works when you have 3 to 5 of the same item. The update will have options to have it make matches with lower/higher rarities and different materials. This was already mentioned in the first post. I expect this update to be finished today or tomorrow.

Link to comment
Share on other sites

Nice Mode. Could You make it possible that You can say only turrents or Moduls and only stuff with quality to or with Level Green, pink etc? Would be nice advance. Somethink that i miss really in this game is to Mark stuff AS Blocked, or how sayed that it can Not ussed from Amy System and that You Not even can sell it without unblocking.

Link to comment
Share on other sites

Not sure if its just me or not, but my turrets seem to not auto research. And if i click the legendary box? it will remove the legendary turrets and not yield anything. Not sure what i expect to get but is there a reason for that?

 

edit: i guess legendaries combined will yield a different legendary, had to run some tests. But im still having trouble getting lower grade turrets to research.

Link to comment
Share on other sites

As i mentioned a bove, currently it only matches exact turrets. At this moment im implementing the option to combine higher/lower rarities and materials so more research can be done.

 

This mod does not change anything about the actual researching, it only automates the process the user normally does. The original research depends on what input it is given. Currently the mod already works with a minimum of 3, but for this a setting has been implemented which can be used in the next update of the mod to set the minimum amount possible.

 

To see what the chances of getting a better item are check the Avorion wiki page on research stations here: http://avorion.gamepedia.com/Research_station

 

I hope i can release the update to the mod soon

 

Link to comment
Share on other sites

When can we expect the update which allows one to set the minimum amount?

I don't want to wast 40% of the stuff that I only have 3 of.

I'd do the changes to your script myself but even after breaking it into lines it's still a pure nightmare to read.

(You were pretty successful in securing your script)

Link to comment
Share on other sites

When can we expect the update which allows one to set the minimum amount?

I don't want to wast 40% of the stuff that I only have 3 of.

 

I've modified the script by changing two parts of line one (the one and only line, the one line to rule them all and in the darkness automatically research them (so long as it's more than or equal to five)) as follows:

 

https://www.diffchecker.com/QWCPZwJs

 

Specifically, change "if#L>=3" to "if#L>=5", and "if#P>=3" to "if#P>=5". I tested on (a copy of) my current game and it worked perfectly well. This, of course, isn't adjustable in-game, but I don't think that's much of an issue until Cypher has a chance to update the mod.

 

I'd do the changes to your script myself but even after breaking it into lines it's still a pure nightmare to read.

(You were pretty successful in securing your script)

 

Yeah, when I first opened autoresearch.lua I was overwhelmed by the uhhh, let's call it lack of whitespace. Thankfully I understood the concept of what the script was doing (find three of the same item) and knew to search for the number three. I tried to read through what, exactly, the script was doing at those parts but I quickly gave up and just changed it to a five, and all was well.

 

Good luck, and thanks Cypher for the awesome mod!

Link to comment
Share on other sites

I also made a tiny tweak to allow research to use multiple types of the same weapon to be researched together(Single + Double + Quads, etc). Since the number of weapons has no impact on dps, there's no reason to not do this.

 

Change

if W[A].item.itemType==T and W[A].item.material==Z and W[A].item.weaponPrefix==_ and W[A].item.numWeapons==a0 then

 

To:

if W[A].item.itemType==T and W[A].item.material==Z and W[A].item.weaponPrefix==_ then

 

I haven't thoroughly tested it, but the few times I did it worked as I intended.

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

×
×
  • Create New...