My problem with this code is that he is using SmokeOffsetX and SmokeOffsetZ values to create effects and losing their basic purpose for positioning the smoke. I will find a way of creating fire independently of these values. My goal was to have a factory with a chimney which has smoke coming out
Mark Twain: I am quite sure now that often, very often, in matters concerning religion and politics a man's reasoning powers are not above the monkey's.
I am now of an age at which I no longer need to suffer fools gladly
SPT_SMOKE0, // 8 grey smoke SPT_SMOKE0A, // 9 grey smoke, alpha masked SPT_TRAIL0, //10 grey smoke trail SPT_SMOKE1, //11 black smoke SPT_SMOKE1A, //12 black smoke, alpha masked SPT_TRAIL1, //13 black smoke trail SPT_SMOKE2, //14 white smoke SPT_SMOKE2A, //15 white smoke, alpha masked
In his code Ralf specified "SPT_SMOKE0" which is 8 and grey smoke. You can also see the "SPT_SMOKE1" and "SPT_SMOKE2" for black and white smoke, 11 and 14 respectively. I do not think that the "Smoke" setting in the TModXYZ.dat file is the sprite number, but I will check further
Mark Twain: I am quite sure now that often, very often, in matters concerning religion and politics a man's reasoning powers are not above the monkey's.
I am now of an age at which I no longer need to suffer fools gladly
I have related the fire to the "Smoke" value, which also affects the size of the smoke. Above 50 there is fire The screenies are for 50, 51 and the max of 255 I could include a random factor to produce sprite values of 8, 11 or 14 to vary the smoke colour.
Mark Twain: I am quite sure now that often, very often, in matters concerning religion and politics a man's reasoning powers are not above the monkey's.
I am now of an age at which I no longer need to suffer fools gladly
if (pTarget->Type->Smoke)
{
smoke_sprite = 14; // white
if (pTarget->Type->Smoke > 17) smoke_sprite = 8; // grey
if (pTarget->Type->Smoke > 33) smoke_sprite = 11; //black
if (pTarget->Type->Smoke > 50) smoke_sprite = 8+ 3*(get_random()%3); // mixed, with fire
if (!(pTarget->Status & TAR_DESTROYED))
{
if (!(pTarget->Type->TargetType & TAR_TYPE_MGO))
{
if (smoke_counter%17==0)
{
smoke_counter = 0;
start_size = 2;
create_smoke(smoke_sprite, pTarget->X, pTarget->Y, pTarget->Z + pTarget->Type->SmokeOffsetZ, start_size, 0.8f, 0.001f * (pTarget->Type->Smoke), -0.01f/(pTarget->Type->Smoke), ((pTarget->Type->Smoke + 1)>>1), 0, FALSE);
if (pTarget->Type->Smoke > 50)
create_fire(pTarget->X, pTarget->Y, pTarget->Z, pTarget->Type->Smoke);
}
smoke_counter ++;
}
}
}
It uses the smoke value to determine the colour It starts with white smoke, but if it is bigger than 17 it uses grey smoke. Then if it is bigger than 33 it uses black smoke. If it is bigger than 50, it uses mixed smoke, and this condition also generates the fire.
The values in the four pics were 17, 20, 35 and 51
Last edited by MrJelly; 03/07/1710:37 AM. Reason: Pics added
Mark Twain: I am quite sure now that often, very often, in matters concerning religion and politics a man's reasoning powers are not above the monkey's.
I am now of an age at which I no longer need to suffer fools gladly
Mark Twain: I am quite sure now that often, very often, in matters concerning religion and politics a man's reasoning powers are not above the monkey's.
I am now of an age at which I no longer need to suffer fools gladly
What I have been working on for me is the railway rendering code. The old "train32.ter" is a 256*256 picture and the exe was programmed to use the top 256 x 32 area in order to render the track. All sorts of things are involved, but I have an axe which reads a file for a factor (f = 1 to 8) which applies to the current section being drawn. It now reads the top 256 x (32 x f) so it can read 256 x 32, or 256 x 64, or .............256 x 256 using the whole picture.
The files I have been working with are a dummy blank 256x256 "train32.ter" file which serves as a base for a corresponding "train32.BMP" file
The screenie is one where the factor is 8. The train is rendered in the middle, and the whole width is shown. The other pic is the "train32.BMP" converted to JPG for posting.
Where I am heading is to have wider roads for vehicle convoys, the trains are fine
Mark Twain: I am quite sure now that often, very often, in matters concerning religion and politics a man's reasoning powers are not above the monkey's.
I am now of an age at which I no longer need to suffer fools gladly
Sections with a flag exactly divisible by 5 are rendered, so the values correspond to section flags of 00, 05, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, and 95. The flag is a two digit value so 95 is the last one exactly divisible by 5 The section in the screenshot was flagged as 0, so the first value (8) was used..
That combination of a dummy ter/tpc file and the real "BMP" file is wonderful- it makes editing so easy
Mark Twain: I am quite sure now that often, very often, in matters concerning religion and politics a man's reasoning powers are not above the monkey's.
I am now of an age at which I no longer need to suffer fools gladly
Mark Twain: I am quite sure now that often, very often, in matters concerning religion and politics a man's reasoning powers are not above the monkey's.
I am now of an age at which I no longer need to suffer fools gladly