Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Reply
 
Thread Tools
Old 01-22-2018, 07:13 PM   #1
dbeachy1
O-F Administrator
 
dbeachy1's Avatar


Default Detecting a docked vessel's actual thruster count

I'm calling pVessel->GetThrusterCount() to detect whether another vessel has at least one thruster defined. It works fine unless the vessel happens to be docked to another vessel -- for example, when a payload vessel with no thrusters is docked to its parent vessel that does have thrusters. In that case, calling GetThrusterCount() on the payload vessel returns the parent vessel's thruster count (??). I assume this is by design since a docked vessel is part of a superstructure? So I'm trying to figure out a way to reliably detect if a given vessel has thrusters defined, even if it's docked. I keep thinking I'm missing something obvious...any ideas?? Thanks.
dbeachy1 is offline   Reply With Quote
Old 01-22-2018, 07:29 PM   #2
GLS
Addon Developer
 
GLS's Avatar
Default

Loop GetThrusterHandleByIndex() until it returns NULL?
GLS is offline   Reply With Quote
Thanked by:
Old 01-22-2018, 08:36 PM   #3
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Quote:
In that case, calling GetThrusterCount() on the payload vessel returns the parent vessel's thruster count (??).
Are you certain that you have the right vessel (It's a dumb question, I know, but... it's code. Better check twice for silly mistakes)? Going on the documentation, that would clearly be a bug.

Moreover, docking establishes flat relationships, not hierarchical ones, so there wouldn't even be a way for Orbiter to determine parent and child.
Orbiter 2016 has new handling for docked stacks, but nothing in the documentation suggests that GetThrusterCount() would be affected by this.
jedidia is offline   Reply With Quote
Thanked by:
Old 01-22-2018, 09:03 PM   #4
dbeachy1
O-F Administrator
 
dbeachy1's Avatar


Default

Thanks for the ideas, guys, I'll look into it more tonight and report back.

EDIT:
So I tracked down the issue: a payload vessel only shows a thruster count when its .cfg file specifies any of these settings (even setting them to 0):

Code:
MaxMainThrust = 0
MaxRetroThrust = 0
MaxHoverThrust = 0
MaxAttitudeThrust = 0
If a payload vessel specifies all of those, the Orbiter core creates a total of 21 thrusters for it. So it turns out that GetThrusterCount() is fine, and docking it to a vessel is not the issue. The fix in my case here was to edit these payload vessel .cfg files to remove those lines above.

Thanks the advice, guys, it was indeed a separate bug, and not Orbiter core-related!

Last edited by dbeachy1; 01-23-2018 at 03:26 AM. Reason: Added note
dbeachy1 is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 06:10 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.