Jump to content

Recommended Posts

Posted (edited)

The StaticObject.destroy() method makes a cargo explode, and a S_EVENT_DEAD event is created.

This has two unwanted side effects:

 

  1. Any unit near the cargo that explodes, is affected. These units will contain damage.
  2. The S_EVENT_DEAD is generated, which causes troubles doing a consistent logic.

The point also of this post is that when in DCS a destroy() is called on other objects, it won't explode or have an S_EVENT_DEAD being generated.

 

  • Group.destroy() won't explode the unit.
  • Unit.destroy() won't explode the unit.
  • StaticObject.destroy() on a structure or a non cargo static won't explode the static.

You see that for cargo statics, the :destroy() behaviour is not consistent with the other objects in the DCS sim, and also prevents a cargo object from being removed without an explosion. So there is a confusion in DCS ...

I see two possible solutions to this problem:

 

  1. Remove the S_EVENT_DEAD being generated from a StaticObject.destroy().
  2. Extend the current DCS world API, by creating a new API called :clean() (or another name), which will clean the object from the sim, without exploding and generating an S_EVENT_DEAD. Maybe this is a good idea for the other objects also, as having a clean method would make it much more clear when to explode or when not to explode.

So for example:

 

  • Group:clean() would not explode and Group:destroy() would explode and create an S_EVENT_DEAD.
  • Unit:clean() would not explode and Unit:destroy() would explode and create an S_EVENT_DEAD.
  • ...

I have a feeling why ED dev team is generating a S_EVENT_DEAD because of internal logic for the cargo manager... when a destroy happens, probably the S_EVENT_DEAD is used to track the state of the cargo in the cargo manager. But this implementation is wrong. Can it be corrected. Please consider the above 2 suggestions ...

See a demonstration mission attached...

BUG-012 - StaticObject destroy method explodes cargo and erroneously generates an S_EVENT_DEAD -.miz

Edited by BIGNEWY
TITLE

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Posted

Sorry, you can't simulate the explosion??? Does that mean on your version that there isn't an explosion?

 

Check the test mission i attached. Pls do a screen copy of the fuel tank after the destroy(), and paste it here if you can...

 

Sven

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Posted

I didn't test your mission, I used one when cargos removal was previously bugged. The explosion is dependent on the type of object and the core problem of the bug in that cargos are being "killed" instead of removed. It makes sense that a fuel tank explodes but a bunch of logs don't. This isn't KSP where literally anything will explode.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

I agree Grimes.

 

Thanks for picking this up. I already got a confirmation that this bug is fixed internally. So this is good news.

 

But I try to always provide a test mission where possible as a lot of people are involved and also for the community. So people can double check, and also, it provides a good documentation of the error situation.

 

Sven

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...