How do you change the color of a Flame?

  • star400040
    22nd Nov 2011 Member 0 Permalink
    When I try to make different color flames they appear invisible rather than the color I set them to be.
  • jacob1
    22nd Nov 2011 Developer 0 Permalink
    Are you making a graphics update function in newgraphics.c and defining it in powder.h? If you are, try copying a similar function, like the one for heat flame or fireworks, and just modifying the color.
  • star400040
    22nd Nov 2011 Member 0 Permalink
    @jacob1 (View Post)

    How would I go about doing that? I found the newgraphics.c however I am not sure exactly where to change the colors part in the newgraphics.c,
  • jacob1
    22nd Nov 2011 Developer 0 Permalink
    @star400040 (View Post)
    In powder.h, there are graphics drawing functions. Create one in the same way as the others, it should look like graphics_xxxx(something). In the ptypes table, find your element, and scroll all the way to the left, past the description. Change the last NULL to &update_xxxx. Then, in newgraphics.c, make that function, just like the other ones in there. Add this:

    *firea = 255;
    *firer = xxx;
    *fireg = xxx;
    *fireb = xxx;

    *pixel_mode = PMODE_NONE; //Clear default, don't draw pixel
    *pixel_mode = FIRE_ADD;
    //Returning 0 means dynamic, do not cache
    return 0;

    If you are creating a gas, it should do something like this automatically, but maybe it wasn't the color you wanted.
  • star400040
    22nd Nov 2011 Member 0 Permalink
    ok but lets say I want to make the flame purple, what would I have to change in the function in newgraphics.c