Page MenuHomeFeedback Tracker

Expand the bodyDisposeManager system to work with ai units
Closed, ResolvedPublic

Description

A quote from developer George_:

"The manager is trying to keep maximum number of allowed corpses in the scene. It works the way that the oldest corpse is removed from the scene if the current number of copses is bigger than corpseLimit but only if the oldest corpse is in the scene longer than corpseRemovalMinTime. It also removes corpses that are longer than corpseRemovalMaxTime (default is 1 hour).

The manager is used only for units that are respawned by in-game mechanic (AI in player slots and players, it's not used for units generated by scripts). We can expand the system for AI if you find it useful (but thats probably for another ticket :)"

So as it currently stands, the system only works with playable units.

My proposal is to provide mission makers more control over this system. The ability to add and remove units to/from the system via scripting commands would provide total control.

An optional parameter in description.ext for the system to blanket cover ai units would also provide us with more control.

Details

Legacy ID
766940611
Severity
None
Resolution
Fixed
Reproducibility
N/A
Category
Feature Request
Additional Information

Event Timeline

SilentSpike edited Additional Information. (Show Details)
SilentSpike set Category to Feature Request.
SilentSpike set Reproducibility to N/A.
SilentSpike set Severity to None.
SilentSpike set Resolution to Fixed.
SilentSpike set Legacy ID to 766940611.May 7 2016, 6:50 PM

Please add global command

addToDisposeManager obj

To take care of vehicles and units

As KK suggested, this would be a most welcome addition!

Alternatively:

obj allowDisposal bool

Latest dev branch changelog includes:

"Added: UnitRemoveManager for SP and MP"

This sounds interesting.

removefromremainscollector
isinremainscollector
addtoremainscollector

George is the man!

Awesome :)

Would also be useful to have the ability to set the system to include all units by default, but even if that's not possible/planned then the new commands sound great on their own!

vehicles and units placed in editor are included by default. it is those that are dynamically spawned after mission start need to be added.

George_ added a subscriber: George_.May 7 2016, 6:50 PM

Default behavior of the manager could be controlled by corpseManagerMode/wreckManagerMode value in description.ext where:
0 - AddsNone - None of the units are managed by default.
1 - AddsAll - All units are managed by default
2 - AddsNoneButRespawned - Only units that can respawn are added
3 - AddsAllButRespawned - All units are managed with exception of respawned (opposite to mode 2).
Example manage all corpses:
corpseManagerMode = 0;
When not defined, the manager is in mode 0 for SP mission and in mode 2 for MP (for compatibility reasons the behavior is same as before the manager).
This is default behavior, it could be always be overridden by removefromremainscollector/addtoremainscollector script functions to flag additional units to be or not to be processed by manager when they are destroyed.

That sounds perfect to me. Thanks for working on expanding this system, makes things a lot more convenient for mission creators.

If I were to use one of the new commands on a building I had placed down or some other destructible object that isn't a unit, how would the system handle that? Would the command simply be ignored or would it also clean those after death?

It currently works only with units (people and vehicles). It should be possible to expand the manager to other types. What objects do you have in mind? You mean like other objects placeable from editor?

Yeah, just other objects which can be destroyed in general. I think it would be nice if the system could handle them when added by the new commands, but personally see no reason for them to be supported by default.

Edit: These kind of things are what I mean https://community.bistudio.com/wiki/Arma_3_CfgVehicles_EMPTY

I'm curious as well to what kind of objects would benefit from disposal collector. Adding buildings to it makes 0 sense as disappearing ruins would look really weird. Small (empty) objects? Many get deleted upon death anyway. So what exactly do you have in mind SilentSpike?

Xeno added a subscriber: Xeno.May 7 2016, 6:50 PM
Xeno added a comment.Aug 21 2014, 8:51 PM

Well, if you make addons/mods and missions then you'll spawn quite a lot of various classes during a mission (sometimes ten thousands of objects and not only CfgVehicles).

So what's also needed, beside removing dead objects, is some kind of FIFO system and some kind of time limit system.

First one would be something like, if 200 objects of class x exist (doesn't matter if alive or not) then if object number 201 is spawned remove the first spawned object.
Second one would be something like object x will be deleted after 600 seconds, no matter if it is still alive or not (for alive vehicles some kind of check would be needed if the crew is still alive, if so, don't delete the vehicle yet).

What's not so nice about (non playable) AI disposal currently is that the weapons won't get deleted. Means, the dead AI unit vanishes but the weapon will remain and stay on the ground (and launchers are standing on the ground, bug). So a mission maker has to take care about removing those weapon holders again. A not wanted side effect.

@KK, nothing specific in mind right now. It would just be handy in more dynamic cases where perhaps you want spawned objects to be cleaned up without hassle. It's certainly a more of an edge case usage, but it never hurts to have less limitation so long as it's not at the cost of something else.

That said, I'm extremely content with the current improvements and see no reason to add support for objects if the devs' time could be better spent! :)

I think a proper sheduler where you can insert timed tasks one off or repeating would take care of many things. Then you can cue any object for deletion alive or dead. You should be able to add scripted task and remove it. addScriptedTask [interval, boolrepeat, code] returns id of then task for removal. Maybe even add it to an object? obj addScriptedTask?

Just spoke to dwarden and it sounds like having weaponholders added to the collector is not a bad feature, to remove dropped items after some time. Will need a bunch of description ext params though, holderxxxxmaxtime etc.

Also I have a question to George. How difficult this would be to add event handler "collectorDeleted" to fire when unit or vehicle is removed. Would make respawning scripted vehicles very straight forward as well as will help to dynamically adjust mission events. Example destroy tank. After tank burnt for a bit it gets collected and either new tank is spawned instead or new mission task added, all right from event handler.

R3vo added a subscriber: R3vo.May 7 2016, 6:50 PM
R3vo added a comment.Aug 30 2014, 11:21 AM

@George

Would it be possible to create a module, which is available even for people without scripting knowledge? That would be fantastic!

kind regards
R3vo

Would it be worth it though? As there's already the parameter to handle all editor-placed units. The only non-scripted thing not handled by that parameter (that I can think of) would be zeus.

(I mean non-scripted as in it can be set up purely through the editor)

This can probably be closed as resolved