API Question Get Vessel Type

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,697
Reaction score
1,357
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
If I wanted to check whether or not each vessel in a simulation was a Deltaglider (or any other type), what's the proper way to do it?

Code:
for (int i = 0; i < oapiGetVesselCount(); i++)
{
    OBJHANDLE hVessel = oapiGetVesselByIndex(i);
    //if(????)
    {

    }
}
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,938
Reaction score
2,950
Points
188
Website
github.com
Code:
VESSEL* pVessel = oapiGetVesselInterface( hVessel );
if (!_strnicmp( pVessel->GetClassName(), "DeltaGlider", 11 ))...

You should check if the DG class is exactly "DeltaGlider".
 

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,697
Reaction score
1,357
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
Last edited:
Top