Bag Despawn Rate

.phase

Member
Member
Jul 29, 2014
58
12
8
Southern California
I don't believe there are currently any modifiers for bag (or item) despawn rate.

Can this be added?

When I run an Arena on my server, it quickly gets littered with a ton of bags that are only detrimental to server performance. Would be nice if bag timer was configurable, so that it's not the default 10 minutes before it disappears.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
I don't believe there are currently any modifiers for bag (or item) despawn rate.

Can this be added?

When I run an Arena on my server, it quickly gets littered with a ton of bags that are only detrimental to server performance. Would be nice if bag timer was configurable, so that it's not the default 10 minutes before it disappears.
Look in my homesystem, you may use BadZombi's timer solution, or see here, as adding the entity's instanceid as a parameter, and then removing it.
Or you may play around with time, like putting the current time into an ini, when you place a bed, and making a timer to check the times in every minute, from the ini. Ofc, we might able to add something also.
 
  • Informative
Reactions: .phase

.phase

Member
Member
Jul 29, 2014
58
12
8
Southern California
So, just to be clear, what I meant specifically were loot bags, from deaths. Sorry, might have confused you, seems like you're referring to sleeping bags?

Creating a timer for each bag drop, or logging every instance of it to check against a single timer may work, but I don't know that it'd help much on performance.

I was really hoping there was a parameter that could be tweaked, so that we can just adjust the timers that already exist on loot bag despawn. There's one for the lock time, so it seems intuitive to believe there's one for despawn rate somewhere.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
So, just to be clear, what I meant specifically were loot bags, from deaths. Sorry, might have confused you, seems like you're referring to sleeping bags?

Creating a timer for each bag drop, or logging every instance of it to check against a single timer may work, but I don't know that it'd help much on performance.

I was really hoping there was a parameter that could be tweaked, so that we can just adjust the timers that already exist on loot bag despawn. There's one for the lock time, so it seems intuitive to believe there's one for despawn rate somewhere.
Whooooooooooops.

Well i guess the lootbag is not an entity. @balu92 ?
 

mikec

Master Of All That I Survey
Retired Staff
Trusted Member
Jul 12, 2014
296
152
28
Los Angeles, California, USA
There are some places in the Rust code where different objects are given different handling on decay events. Furnaces and Campfires, for example, decay at different rates, and depending on whether they are placed on a structure or the ground. But these exceptions are coded by hand on a case-by-case basis. There isn't any "API" to set decay rates.

Loot bags are a subclass of LootableInventory and will appear in a FindObjectsOfType<LootableInventory>() return.
 
  • Informative
Reactions: .phase