Jump to content

Recommended Posts

Posted (edited)

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

Posted

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

Posted

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

  • Recently Browsing   0 members

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