I'm not really sure how best to describe what I'm trying to do but I'll give it my best shot...
The addon I am working (AAPO) on has a bunch of common spacecraft elements that are shared across multiple VESSEL-derived classes.
At the moment this is accomplished through lots of copying and pasting but what I'd like to do is have a was that I can write the code for a given element once and then have a function along the lines of "AddCommandModule()" or "AddSIVbStage ()" that would add all the of that element's associated thrusters, propellant resources, meshes, functions etc... to the existing vessel. My problem is that I am unsure how best to accomplish this, and could use some input and advice from some of the more experienced coders.
Expressed in pseudo-code i'd like to be able to do something along the lines of the following.
or
ETA:
Along similar lines I'd also like to be able to...
and have it automatically add the appropriate thruster, exhaust/particle streams, mesh, and gimbal animations to the stage.
any assistance will be greatly appreciated. Thank you and
The addon I am working (AAPO) on has a bunch of common spacecraft elements that are shared across multiple VESSEL-derived classes.
At the moment this is accomplished through lots of copying and pasting but what I'd like to do is have a was that I can write the code for a given element once and then have a function along the lines of "AddCommandModule()" or "AddSIVbStage ()" that would add all the of that element's associated thrusters, propellant resources, meshes, functions etc... to the existing vessel. My problem is that I am unsure how best to accomplish this, and could use some input and advice from some of the more experienced coders.
Expressed in pseudo-code i'd like to be able to do something along the lines of the following.
Code:
// --------------------------------------------------------------
// Constructor
// --------------------------------------------------------------
ApolloCSM::ApolloCSM (OBJHANDLE hObj, int fmodel) : VESSEL3 (hObj, fmodel)
{
cm = AddCommandModule (hObj, fmodel);
sm = AddServiceModule (hObj, fmodel);
}
or
Code:
SaturnC5::SaturnC5 (OBJHANDLE hObj, int fmodel) : Saturn (hObj, fmodel)
{
Stage1 = AddStageSIc (hObj, fmodel);
Stage2 = AddStageSIIc (hObj, fmodel);
Stage3 = AddStageSIVb (hObj, fmodel);
}
ETA:
Along similar lines I'd also like to be able to...
Code:
ThrusterHandle = AddEngineJ2 (pos, dir, rot, prophandle);
and have it automatically add the appropriate thruster, exhaust/particle streams, mesh, and gimbal animations to the stage.
any assistance will be greatly appreciated. Thank you and
Last edited: