SDK Question "CreateThrusterGroup" Sanity Check **[SOLVED]**

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
670
Reaction score
89
Points
43
Location
Happy Wherever
Shouldn't this be controlled by the generic Main Thruster, or am I missing something...?
Code:
thg_main[0] =  CreateThruster (_V(0,-0.1580385, 4.602197), _V(0,0,1), PB_MAXMAINTH,hpr, PB_ISP);
thg_main[1] =  CreateThruster (_V(0,-0.1580385,-4.602197), _V(0,0,1), PB_MAXMAINTH,hpr, PB_ISP);
	CreateThrusterGroup (thg_main, 2, THGROUP_MAIN);

Main Thrust controls thg_main[0] but does nothing with thg_main[1].
Any ideas?
I just wanna be sure I'm not missing a basic truth here cause I've done this before with hover thrusters but never with main.
 
Last edited:
Wait, scratch that. I think I understood you wrong.

Is the problem that you think nothing should happen to thg_main[1], or that you think something should happen but nothing happens? Because in the later case, I'd have to agree... something should definitely happen with it.
 
Last edited:
Yeah, something should happen.
The exact same thing as in Shuttle-A with the pods, I want to have two independently controlled n pointed thrusters.
But no thrust comes from thg_main[1] .....
 
Try adding them separately, to see if thg_main[1] is being set up correctly
Code:
thg_main[0] = CreateThruster(args);
thg_main[1] = CreateThruster(args);
CreateThrusterGroup(thg_main, 1, THGROUP_MAIN);
CreateThrusterGroup(thg_main + 1, 1, THGROUP_MAIN);
 
Sorry to ask the obvious: is thg_main defined as a thruster handle or as a thrustergroup handle by mistake?
 
I guess it is like fred18 suspects. First the individual thrusters must be defined, then they can be grouped. Proposal:

THRUSTER_HANDLE th[2];
th[0] = CreateThruster (_V(0,-0.1580385, 4.602197), _V(0,0,1), PB_MAXMAINTH,hpr, PB_ISP);
th[1] = CreateThruster (_V(0,-0.1580385,-4.602197), _V(0,0,1), PB_MAXMAINTH,hpr, PB_ISP);
CreateThrusterGroup (th, 2, THGROUP_MAIN);
 
Sorry to ask the obvious: is thg_main defined as a thruster handle or as a thrustergroup handle by mistake?

Usually, the compiler should complain first about the wrong type.

But I see no other fault there, the source code snippet shown looks like my own code, just the thgxxx suggests a thruster group handle not a thruster handle array (which would have thxxxxx in my standard)
 
It's solved - I'm adjusting a very lengthy code and had missed a buried SetThrusterMax0 (thg_main[1] ,0); set earlier.
Apologies, and thanks for the help.
JMW
 
Back
Top