ThunderDodge Posted January 30, 2017 Share Posted January 30, 2017 Hey guys, today i want to bring you the high wanted wreckage cleaner. It's still in testing, but passed the first tests. I take no liability of any lost stuff. What does it do & how it works? When a player leaves a sector, wich is empty then, he will automatic trigger the cleanup. You can set a cooldown time, until the sector gets cleared, from that, what you defined. ( default: loot & wreckages ) The cleanup is getting corrupted, when another player HP-J in the sector and the cooldown isnt finished. THIS SCRIPT DOES NOT CLEAN UP SCRAPYARDS! How to install: 1. Download the Zip. 2. Open up the Zip and move "clean_sector.lua" to scripts/player/" 3. Open up the file and edit the config values, if you want to. CLEANUP.cleanup_activated = (getGlobal( "sector_cleanup" ) or 1) CLEANUP.cleanup_cooldown = 5 CLEANUP.set_limit = 20 CLEANUP.notify_admin = true CLEANUP.types = {EntityType.Wreckage, EntityType.Loot} Enums, that can be used to clean up: None Ship Drone Station Turret Asteroid Wreckage Anomaly Loot WormHole Fighter Unknown Other 4. Go to "scripts/server/server.lua" 5. Add "player:addScriptOnce("clean_sector.lua")" to the "onPlayerLogIn" function. Beneath the other scriptAddOnce. Image: 5. Enjoy - UPDATE - +Added abillity, to set maximum amount of wreckages. Will it count more than the limit, the sector wont get cleaned up. clean_sector.zip clean_sector_v1.1.zip Link to comment Share on other sites More sharing options...
Kane Hart Posted January 31, 2017 Share Posted January 31, 2017 Not something I needed but I know it was a request by someone. Hope they were happy with it and thanks for helping them and the community out :) Link to comment Share on other sites More sharing options...
Linkfish Posted February 7, 2017 Share Posted February 7, 2017 Hi ThunderDodge, your wreckage cleanup script works well. I've installed it on my server, UK - The Holy Checksum (30 players) So far it's running OK but I'll monitor it and if there's any feedback I'll be happy to give it to you. Hopefully it'll help with lag a bit :-) One tip; in your code example: CLEANUP.cleanup_activated = (getGlobal( "sector_cleanup" ) or 1) CLEANUP.cleanup_cooldown = 5 CLEANUP.notify_admin = true CLEANUP.types = {EntityType.Wreckage, EntityType.Loot} the cooldown is set to 5. This gives the assumption that it's also set to 5 in your .lua file, so after an hour of testing and finding it didn't work, I checked but it's set to 120 there. Might be worth changing that or notifying the people downloading the script in order to save some frustrations :-) Thanks! Link to comment Share on other sites More sharing options...
Linkfish Posted February 8, 2017 Share Posted February 8, 2017 So far the mod is running very stable on The Holy Checksum. I've set the time interval to 5 seconds, only using the enums wreckage and loot. It's greatly reduced the desync and lag on the server and loading times have gone down from 20 seconds, to about 2 seconds, to load a sector. Very nice mod, great work! Link to comment Share on other sites More sharing options...
ThunderDodge Posted February 9, 2017 Author Share Posted February 9, 2017 Thanks for your feedback :) Link to comment Share on other sites More sharing options...
Excelsior Posted February 10, 2017 Share Posted February 10, 2017 I like the idea of cleaning wreckage, but I did find an issue. There are sectors that I like to mark that have impressively large wrecked stations or a huge number of wrecks without being a scrapyard. I was hoping that it would not clean those out, but it seems to be doing that. I really wanted it to just cleanup the wreckage and loot that was leftover from the battles when someone left. I have disable the wreckage call for now. Link to comment Share on other sites More sharing options...
cy414 Posted February 11, 2017 Share Posted February 11, 2017 would it be possible to set this to clear and preserve wreckage based on a resource threshold? this way any just the low value trash gets cleared, but at the same time it could be set to preserve wreckage over a set limit too. Link to comment Share on other sites More sharing options...
ThunderDodge Posted February 15, 2017 Author Share Posted February 15, 2017 Updated the cleanup script. The old will still be available. See version 1.1 Link to comment Share on other sites More sharing options...
xorbis Posted March 5, 2017 Share Posted March 5, 2017 I get this error with the script, trying to fix it but haven't found how yet. could not execute function 'initialize' in '"data/scripts/player/clean_sector.lua"': Link to comment Share on other sites More sharing options...
Pob Posted April 5, 2017 Share Posted April 5, 2017 I like the idea of cleaning wreckage, but I did find an issue. There are sectors that I like to mark that have impressively large wrecked stations or a huge number of wrecks without being a scrapyard. I was hoping that it would not clean those out, but it seems to be doing that. I really wanted it to just cleanup the wreckage and loot that was leftover from the battles when someone left. I have disable the wreckage call for now. has this been fixed? is it possible to set a material limit? ie all wrecks containing less than X material get cleaned? So, you can then set X to say 5000, if we had a sector with 1x wreck 500titanium+6000iron, 1x wreck 4000iron, 10x wreckage bits each less than 100iron. When the cleanup script runs it would leave just the 1x wreck 500titanium+6000iron and delete the rest. Link to comment Share on other sites More sharing options...
Mutiegenesis Posted April 5, 2017 Share Posted April 5, 2017 Can you make something to do some garbage collection with the factions in memory? PUHLEEEEEESE? Server consistently gets real laggy as in-mem factions exceed 200 or so (I got the data to prove it). Link to comment Share on other sites More sharing options...
Wilponderoci Posted April 5, 2017 Share Posted April 5, 2017 I would like this script to work in single player is there a way to do that? Link to comment Share on other sites More sharing options...
Pob Posted April 6, 2017 Share Posted April 6, 2017 I would like this script to work in single player is there a way to do that? with the structure of Avorion there's no difference between multi-player and single-player, in single-player you're running both the client and server on your pc, the server is running on internal port addresses so no external connections. so mods are fully cross compatible. Link to comment Share on other sites More sharing options...
Wilponderoci Posted April 6, 2017 Share Posted April 6, 2017 Yes Pob, I am aware of this. How to I make it work. It's a triggered command. Link to comment Share on other sites More sharing options...
Pob Posted April 7, 2017 Share Posted April 7, 2017 Ahh I see what you mean . . . Not the simplest set of instructions. Link to comment Share on other sites More sharing options...
Andy-Blackknight Posted April 7, 2017 Share Posted April 7, 2017 ich denke mal CLEANUP.cleanup_cooldown = 5 sind in sekunden nachdem ein spieler den sector verlässt oder? Nur Serverseitiger mod? Link to comment Share on other sites More sharing options...
n1njaplague Posted July 8, 2017 Share Posted July 8, 2017 Will people be able to join my server without doing stuff to their client if I add this mod? Link to comment Share on other sites More sharing options...
ThunderDodge Posted August 13, 2017 Author Share Posted August 13, 2017 @Andy, Ja sind Sekunden. Yes, People will be able to join your server without the mod. Its Serverside only. Link to comment Share on other sites More sharing options...
Cynicus26 Posted May 21, 2018 Share Posted May 21, 2018 I'm not sure I understand where to add "player:addScriptOnce("clean_sector.lua")" in the server.lua file. Can anyone help? Link to comment Share on other sites More sharing options...
MrWilson13 Posted May 7, 2020 Share Posted May 7, 2020 Getting this on the server console: could not execute function 'leftSector' in '"data/scripts/player/clean_sector.lua"': data/scripts/player/clean_sector.lua:55: attempt to call global 'isScrapYard' (a nil value) stack traceback: data/scripts/player/clean_sector.lua:55: in function <data/scripts/player/clean_sector.lua:45> 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