JohnnySinclair Posted April 5, 2017 Share Posted April 5, 2017 Hi there! I've modified the ai-script-file "salvage.lua". Now your captained salvage ship should break down all wreckages. Server-Version: 0.11.0.7854 Usage: replace your orginal salvage.lua with the attached one Path should be: ..\Steam\steamapps\common\Avorion\data\scripts\entity\ai If you use a Dedi-Server, you have to replace the script-file there. Reason for this MOD: Sometimes (about 5-10%) generated wreckages do not have the property "material" e.g. Iron. You can check that by yourself by selecting wreckages that are not salvaged by your ai-ship / autotargeting salvage-laser. In this case the salvage script will not pick up this wreckages. The original script is using "getEntitiesByComponent(ComponentType.MineableMaterial)" to find wreckages. This kind of wreckages are not listed there. I've modified this line into "getEntitiesByType(EntityType.Wreckage)". Also I've commented out the part wich is checking if the wrackages have MinableResources. [edit] Because of the idea of Splutty I've edited the script again. Your Salvageship goes to "sleep" after all wreckages are salvaged. You'll be informed about this. If a new wreckage appears your Salvageship goes back to work by itself. You'll be informed again. Download in this post [/edit] o/ Johnny PS: Does anyone know where the auto-turret scripts are in? ;) salvage.lua.zip = this version just stops after work is done salvage_restless.lua.zip = this version will search again and again for wreckages until you order something else restore.ip = the origonal version of this file salvage.lua.zip restore.zip Link to comment Share on other sites More sharing options...
Wilponderoci Posted April 5, 2017 Share Posted April 5, 2017 Stoked to try this out! Link to comment Share on other sites More sharing options...
Splutty Posted April 6, 2017 Share Posted April 6, 2017 Another good adjustment of the script is removing these lines of code: ShipAI(ship.index):setPassive() ship:invokeFunction("craftorders.lua", "setAIAction") terminate() Those will cause the ship to stop salvaging when there's nothing left, normally. But you have to manually set them to salvage again. Removing these lines will keep them searching for salvage, so when any new salvage appears, they'll go right for it. Link to comment Share on other sites More sharing options...
JohnnySinclair Posted April 6, 2017 Author Share Posted April 6, 2017 In this case you would send the script in a endless loop with no breaks. That should be a massive performance impact, shouldn't it? Nevermind, I've made that changes and now I'm testing it. Done, here it goes: salvage_restless.lua.zip Link to comment Share on other sites More sharing options...
Splutty Posted April 6, 2017 Share Posted April 6, 2017 In this case you would send the script in a endless loop with no breaks. That should be a massive performance impact, shouldn't it? Nevermind, I've made that changes and now I'm testing it. Done, here it goes: Hehe. I'll address the part you crossed out regardless. The check for salvageable materials happens every 'tick'. And yes, this is not ideal. The mods I run myself have variable ticks generally, depending on what's going on. But in this case, it happens every second, so it's not that huge of an impact if there's nothing to actually find to salvage. Link to comment Share on other sites More sharing options...
Feye Posted April 9, 2017 Share Posted April 9, 2017 This is great, it annoyed me quite a lot that salvage lasers don't actually salvage stuff that's right in front of them. Definitely going to try this! Link to comment Share on other sites More sharing options...
Ravic Posted May 3, 2017 Share Posted May 3, 2017 This is great, it annoyed me quite a lot that salvage lasers don't actually salvage stuff that's right in front of them. Definitely going to try this! This mod is great and clever, thank you for posting it! :) But I'm pretty sure it doesn't solve your salvage laser problem, as it didn't solve mine either. Shame :( Any luck finding the auto-turret AI script to do the same modification? :) Link to comment Share on other sites More sharing options...
JohnnySinclair Posted May 4, 2017 Author Share Posted May 4, 2017 ... Any luck finding the auto-turret AI script to do the same modification? :) nope ;( Link to comment Share on other sites More sharing options...
Stavinsky Posted May 21, 2017 Share Posted May 21, 2017 Thanks for the change in the salvage AI. I did use your work to modify the Mining AI. So far it work perfectly. And with the Regenerative Asteroid Fields, it's a good way to have someone reset a whole mining area without having the others from your server forced to come back to order their ships around. Link to comment Share on other sites More sharing options...
Feye Posted July 24, 2017 Share Posted July 24, 2017 Can someone else confirm or deny that this still works in v12? It seems that something has changed, because I'm getting wrecks without material info again... Link to comment Share on other sites More sharing options...
Valhar2000 Posted August 26, 2017 Share Posted August 26, 2017 This doesn't seem to work with v12. There are still wreckages that do not have a material associated with them, and are not targeted automatically by salvaging turrets; no noticeable difference between using this mod and not using it. Link to comment Share on other sites More sharing options...
Valhar2000 Posted September 14, 2017 Share Posted September 14, 2017 I am using version 0.13 of Avorion now, and it looks like the devs have fixed the problem themselves (at least partially). My independent-targeting turrets and my autonomous salvaging ships now salvage a lot of smaller wreckages that they used to just ignore. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now