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

[Release][Script] Wreckage Cleanup v1.1 * Updated


ThunderDodge
 Share

Recommended Posts

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:

install.png

 

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

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

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

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

  • 3 weeks later...
  • 5 weeks later...

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

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

  • 3 months later...
  • 1 month later...
  • 9 months later...
  • 1 year later...

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

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