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

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
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:

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
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:

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
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] .....
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
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);
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,666
Reaction score
100
Points
78
Sorry to ask the obvious: is thg_main defined as a thruster handle or as a thrustergroup handle by mistake?
 

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
1,060
Reaction score
864
Points
128
Website
francisdrakex.deviantart.com
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);
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
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)
 

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
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
 
Top