Reading config file

streb2001

Addon Developer
Addon Developer
Donator
Joined
Feb 9, 2008
Messages
326
Reaction score
0
Points
16
Location
North Yorkshire
The Orbiter developer docs state that it is possible to add custom entries to the vessel's config file. I can't find an API function that allows these to be read. Does anyone know how to do this?

Thanks
 

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
Look in the Orbiter SDK folder.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,628
Reaction score
2,345
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Look for oapiRead_xxxx in the API Reference.
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
You can read the scenario files and vessel configuration files, but only inside clbkSaveState, clbkLoadState, opcSaveState, opcLoadState, clbkSetClassCaps, and sorry if I am forgetting any others.

You need to have the file handle, and the above functions provide you that. You can read parameters using:
oapiReadItem_bool, oapiReadItem_float, oapiReadItem_int, oapiReadItem_string, oapiReadItem_vec, oapiReadItem_nextline
 

streb2001

Addon Developer
Addon Developer
Donator
Joined
Feb 9, 2008
Messages
326
Reaction score
0
Points
16
Location
North Yorkshire
Computerex to the rescue again! Yes, clbkSetClassCaps(FILEHANDE cfg) is passed the config file handle. I missed that one.

ED doesn't help that I am reading my huge printout of the Orbiter 060503 API doc rather than the latest version! I don't want to print it all again, it took me hours to file it all! /ED
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
Top