I have added a exhaust stream to the tower. No problem. But because this exhaust stream needs to match the animation that is a problem.
I added an attachment to see if the values of the location changed and they do. But the exhaust remain at the starting point.
This just turns the exhaust on if a vessel is near and thruster off
sets the vaporlocation to match animation
---------- Post added at 11:04 AM ---------- Previous post was at 09:38 AM ----------
I got it to work. But it leaves multiple exhaust streams. So I may just have a key to turn on/off the exhaust.
---------- Post added at 01:22 PM ---------- Previous post was at 11:04 AM ----------
Added these line:
but it make the exhuast stream I turn it off and move the arm but the first one is present.
I added an attachment to see if the values of the location changed and they do. But the exhaust remain at the starting point.

Code:
vapourlocation[0] = _V(-16.88219, 6.607, -3.882331);
vapourlocation[1] = _V(-16.88219, 5.607, -3.882331);
vapourlocation[2] = _V(-16.88219, 6.607, -4.882331);
Code:
void SLSTOWER::clbkSetClassCaps(FILEHANDLE cfg)
{
...
//smoke
PROPELLANT_HANDLE ph_vernier = CreatePropellantResource(FUELMASS);
// lox vent
PARTICLESTREAMSPEC contrail_vapour = {
0, 0.4, 30, 0.5, 10, 1.5, 0.8, 4.0, PARTICLESTREAMSPEC::EMISSIVE,
PARTICLESTREAMSPEC::LVL_PSQRT, 0, 1,
PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
};
//// LOX vent streams
th_vapour = CreateThruster(_V(0, 0, 0), _V(1, 0, 0), PB_MAXHOVERTH, ph_vernier, PB_ISP);
AddExhaustStream(th_vapour, _V(-16.88219, 6.607, - 3.882331), &contrail_vapour);
//AddExhaustStream(th_vapour, _V(1.029, 0.47, 39.82), &contrail_vapour);
// big launch smoke
PARTICLESTREAMSPEC contrail_steam = {
0, 32, 20, 250, 1.2, 4, 12, 3.0, PARTICLESTREAMSPEC::EMISSIVE,
PARTICLESTREAMSPEC::LVL_PSQRT, 0, 1,
PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
};
// small launch smoke
PARTICLESTREAMSPEC contrail_steam2 = {
0, 10, 10, 40, 2, 3, 6, 5.0, PARTICLESTREAMSPEC::EMISSIVE,
PARTICLESTREAMSPEC::LVL_PSQRT, 0, 1,
PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
};
/// big flame duct smoke
th_steam[0] = CreateThruster(_V(-38.5, -9.7, 0), _V(0.866, 0.1, -0.5), PB_MAXHOVERTH, ph_vernier, PB_ISP);
AddExhaustStream(th_steam[0], &contrail_steam);
/// small pad smoke
th_steam[1] = CreateThruster(_V(0, 0, 4), _V(0, 0, -1), PB_MAXHOVERTH, ph_vernier, PB_ISP);
AddExhaustStream(th_steam[1], &contrail_steam2);
}
Code:
void SLSTOWER::clbkPreStep(double SimT, double SimDT, double MJD) {
ENGINESTATUS es;
VECTOR3 gpos, gpad;
/// global pos of point just above pad
Local2Global(_V(0, 20, 0), gpad);
for (DWORD i = 0; i < oapiGetVesselCount(); i++) // check each vessel in turn
{
OBJHANDLE hV = oapiGetVesselByIndex(i);
if (hV == GetHandle()) continue; // we don't want to check ourselves ...
oapiGetGlobalPos(hV, &gpos);
if (dist(gpos, gpad) < 150) // if vessel in range, get engine status
{
VESSEL *v = oapiGetVesselInterface(hV);
oapiGetEngineStatus(hV, &es);
break;
}
}
// if engine is on and umb. extended, retract umb. and stop LOX vent
if (es.main > 0.7 )
{
SetThrusterLevel(th_vapour, 0);
}
else
{
SetThrusterLevel(th_vapour, 1);
}
}
Code:
rms2_anim[0] = new MGROUP_ROTATE(0, CSFWDGrp, 4, _V(-4.186, 39.28096, -5.806), _V(0, 1, 0), (float)(180 * RAD)); // -2 .. +145
rms2_anim[1] = new MGROUP_TRANSLATE(0, CSFWDGrp1, 1, _V(0, 50, 0));
rms2_anim[2] = new MGROUP_ROTATE(LOCALVERTEXLIST, MAKEGROUPARRAY(vapourlocation), 3, _V(4.451, -7.793, 0), _V(0, 1, 0), (float)(894 * RAD));
hAC_arm = AddAnimationComponent(anim_CSFWD2, 0, 1, rms2_anim[2], parent);
anim_CSFWD = CreateAnimation(0.0);
anim_CSFWDT = CreateAnimation(0.0);
anim_CSFWD2 = CreateAnimation(0.0);
parent = AddAnimationComponent(anim_CSFWD, 0, 1, rms2_anim[1]); //engine
parent = AddAnimationComponent(anim_CSFWDT, 0, 1, rms2_anim[0], parent);
parent = AddAnimationComponent(anim_CSFWD2, 0, 1, rms2_anim[2], parent);
Code:
void SLSTOWER::clbkPostStep(double simt, double simdt, double mjd)
{
xp0 = vapourlocation[1] - vapourlocation[0]; normalise(xp0);
xr0 = vapourlocation[2] - vapourlocation[0]; normalise(xr0);
SetAttachmentParams(vapor1, vapourlocation[0], xp0, xr0);
SetThrusterRef(th_vapour, vapourlocation[0]);
AddExhaustStream(th_vapour, vapourlocation[0], &contrail_vapour);
...}
---------- Post added at 11:04 AM ---------- Previous post was at 09:38 AM ----------
I got it to work. But it leaves multiple exhaust streams. So I may just have a key to turn on/off the exhaust.
---------- Post added at 01:22 PM ---------- Previous post was at 11:04 AM ----------
Added these line:
Code:
if (vapouryes == 1) AddExhaustStream(th_vapour, vapourlocation[0], &contrail_vapour);//turn on exhuaust
if (vapouryes == 0) DelExhaustStream(th_vapour);//turn off exhuast
but it make the exhuast stream I turn it off and move the arm but the first one is present.
Last edited: