Support Coding a UCGO vessel

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,732
Reaction score
2,701
Points
203
Location
Dallas, TX
I have successfully added the code for UCGO into my vessel. It loads and unloads the cargo. But the cargo is NOT seen in the cockpit view.

I know in the cfg you can set it:
:CARGO
;-------------------------------------------------------------
CargoSlotPos = -0.70 0.374 2.50 ; Front left pos of first cargo slot X Y Z (see doc).
CargoRowColumnNbr = 2 4 ; Number of slot row & column (max 20 slots, see doc).
CargoSlotInterval = 0.05 ; Interval between each slot in meters.
CargoReleasePos = 0 -4.00 ; X Z pos at wich cargo will be placed when released (see doc).
CargoShowInCockpit= 0 ; Force cargo to appear also in cockpit view (only external by default).
CargoGrappleDist = 20 ; Grapple radius from center of cars. By defaut 15 meters.
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,927
Reaction score
795
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
From UCGOCargoSDK.h:

Code:
// this set the cargo mesh visibility as defined in Orbiter SDK. 
// by defaut loaded cargo mesh have "MESHVIS_EXTERNAL". You can use
// this function for example to disable cargo display when door closed (optimisation)
// [COLOR="Red"]or to allow them to be visible also in cockpit or vc mode.[/COLOR] (case of the forklift cars for example)
// See SetMeshVisibilityMode() function in orbiter's SDK.
void SetCargoMeshVisibility(int Num,int iMeshVisibility);
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,732
Reaction score
2,701
Points
203
Location
Dallas, TX
Thanks I found it. Now I need to get it to get to MESHVIS_ALWAYS

void SetCargoMeshVisibility(int Num,MESHVIS_ALWAYS);
but get errors:
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,927
Reaction score
795
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Basic C++ knowledge would explain to you that changing the header reference will not help you here.

You need to call the function, not redefine it.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,732
Reaction score
2,701
Points
203
Location
Dallas, TX
Thanks got it:
Code:
hUcgo.SetCargoMeshVisibility(0,MESHVIS_ALWAYS);

I have just 1 slot.
 
Top