Purple fire...

  • tommig
    14th Feb 2012 Member 0 Permalink

    Hi guys

    I came up with an element idea for my mod, that, when it burns, set fire ctype to potassium (PTSM), and make the fire purple, I've looked through the graphics codes, but not found anything that can help me. Is it possible to do something like this, and how?

    Thanks

    Tommig

  • vanquish349
    14th Feb 2012 Member 0 Permalink
    @tommig (View Post)
    yes it is very possible to do this, in powder-sim we have code set up so we can change the ctype of fire depending on what is being burn't, and then you go into the fire.c and do something similar to this.


    if (cpart->tmp == PT_PTSM)
    {
    *firea = 255;
    *firer = (unsigned char)flm_data[caddress+1];
    *fireg = (unsigned char)flm_data[caddress+2];
    *fireb = (unsigned char)flm_data[caddress+1];
    }
    else
    {
    *firea = 255;
    *firer = (unsigned char)flm_data[caddress];
    *fireg = (unsigned char)flm_data[caddress+1];
    *fireb = (unsigned char)flm_data[caddress+2];
    }
  • tommig
    14th Feb 2012 Member 0 Permalink

    @vanquish349 (View Post)

    Thanks! Time to get cracking!

    error:

    I put the code into fire.c and was given this error

    1>facialturd-the-powder-toy-7f850ad\src\elements\fire.c(11): error C2181: illegal else without matching if

    But there's definitely an if there... 

  • tommig
    14th Feb 2012 Member 0 Permalink

    Bump:

    Bit o' help here? Please?

  • tian110796
    14th Feb 2012 Member 0 Permalink
    Try adding braces:

    if (cpart->ctype == PT_PTSM)
    {
    *firea = 255;
    *firer = (unsigned char)flm_data[caddress+1];
    *fireg = (unsigned char)flm_data[caddress+2];
    *fireb = (unsigned char)flm_data[caddress+1];
    }
    else
    {
    *firea = 255;
    *firer = (unsigned char)flm_data[caddress];
    *fireg = (unsigned char)flm_data[caddress+1];
    *fireb = (unsigned char)flm_data[caddress+2];
    }
  • tommig
    14th Feb 2012 Member 0 Permalink
    I may just have broken the fire colour... It is always red. What variables control the glowing colour?
  • vanquish349
    14th Feb 2012 Member 0 Permalink
    opps i am in idiot i forgot the braces.


    @tommig (View Post)
    is it like the normal fire colour or is it just a red
  • tommig
    14th Feb 2012 Member 0 Permalink

    @vanquish349 (View Post)

    All the glow effects are red. Unless I put loads down, at that point it can glow yellow

  • vanquish349
    14th Feb 2012 Member 0 Permalink
    @tommig (View Post)
    is it like normal fire?
  • tommig
    14th Feb 2012 Member 0 Permalink

    image

    See for yourself.