Jump to content

Unable to Remove spawned Crate


Ciribob

Recommended Posts

If I spawn a crate as below

 


local _point = PointFromSomeUnit

local _crate = {
           ["category"] = "Cargo",
           ["shape_name"] = "ab-212_cargo",
           ["type"] = "Cargo1",
           ["unitId"] = 1000,
           ["y"] = _point.z,
           ["x"] = _point.x,
           ["mass"] =100 ,
           ["name"] =  "Cargo Crate 1",
           ["canCargo"] = true,
           ["heading"] = 0,
       }


 coalition.addStaticObject(1, _crate)

 

I can't remove it using the destroy method as below

 


    local _crateStatic = StaticObject.getByName(_crateName)
            
      _crateStatic:destroy() -- remove!
               

 

Unless i'm missing something?

 

Version 1.2.16.38741


Edited by Ciribob

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

To further add to this, the crate is impervious to all weapons and even when sling loading and it marked as destroyed, it never disappears.

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

I knew that for scenery objects the destroy function didn't work since few patches. Maybe also for statics is the same?

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Ah right thanks for the info. I tried to make a new static at a different position with the same ID and name, which the doc says will replace the old one but I get an error about lua not being able to modify object from luaClass. :(

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

  • Recently Browsing   0 members

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