SDK Question how to delete a vessel

Woodylepic

New member
Joined
Dec 29, 2009
Messages
71
Reaction score
0
Points
0
I have a mainchute on my little joe boiler plate and I want it to desapear to be replaced by a new chute on the ground the new chute on the ground work ok
but I got a cdt whene I try to delete the oldy one ?

oapiDeleteVessel ("Mainchute", "LittleJoeII/LJ_mainchute");


how to delete this chute vessel ?

thank.
 
Last edited:
From API_Reference.chm:
Code:
OAPIFUNC bool oapiDeleteVessel  ( OBJHANDLE  hVessel,  
  OBJHANDLE  hAlternativeCameraTarget = 0   
 )
You need to pass the function handles to the objects, not the names of the objects. You can use oapiGetObjectByName to get the handles.
 
Got it !

first I need to creat an Handle
static
OBJHANDLE hMainchute;

then put the handle to the mesch
hMainchute =oapiCreateVessel (
"Mainchute", "LittleJoeII/LJ_mainchute", vs);

and delete the handle
oapiDeleteVessel (hMainchute);

thank ! :thumbup:


 
Last edited:
That'll work too.

As a matter of interest, why create the chute as a separate vessel anyway? Why not just create the chute using VESSEL::AddMesh? When the vessel lands, you can delete one mesh (use VESSEL::DelMesh) and replace it with the mesh of the chute on the ground. It is safer to do that since you are not deleting objects that other addons might be holding handles to.
 
Back
Top