Purple fire...

  • vanquish349
    14th Feb 2012 Member 0 Permalink
    @tommig (View Post)
    ahh i see, i used the wrong varible change ctype to tmp

    and also you still need to make it so when somthing burns it tmp equals what is burning, i would tell you how but i forgot and i cant find the commit
  • tommig
    14th Feb 2012 Member 0 Permalink

    @vanquish349 (View Post)

    I simply used this:

    if ((r&0xFF)==PT_FIRE) {
    parts[r>>8].ctype =PT_PTSM;
    }

    That seems to work

  • tommig
    14th Feb 2012 Member 0 Permalink

    Bump:

    Guys, it's not magically fixed itself...

  • vanquish349
    14th Feb 2012 Member 0 Permalink
    @tommig (View Post)
    yes but i am confused, as you aren't really answering my questions
  • tommig
    14th Feb 2012 Member 0 Permalink

    ptsm.c:


    #include

    int update_PTSM(UPDATE_FUNC_ARGS) {
    int r, rx, ry, trade, np;
    for (rx=-2; rx<3; rx++)
    for (ry=-2; ry<3; ry++)
    if (x+rx>=0 && y+ry>0 && x+rx {
    r = pmap[y+ry][x+rx];
    if (!r)
    continue;
    if ((r&0xFF)==PT_FIRE) {
    parts[r>>8].ctype =PT_PTSM;
    }
    }
    return 0;
    }

    Fire.c
    #include

    int graphics_FIRE(GRAPHICS_FUNC_ARGS)
    {
    int caddress = restrict_flt(restrict_flt((float)cpart->life, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
    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];}

    *firea = 255;
    *firer = *colr;
    *fireg = *colg;
    *fireb = *colb;

    *pixel_mode = PMODE_NONE; //Clear default, don't draw pixel
    *pixel_mode = FIRE_ADD;
    //Returning 0 means dynamic, do not cache
    return 0;
    }
  • vanquish349
    14th Feb 2012 Member 0 Permalink
    @tommig (View Post)
    ahh i understand what you are doing, let me just have a think and i will get back to you,

    also you will have to change ctype to tmp as i think ctype is used for something else
  • tommig
    14th Feb 2012 Member 0 Permalink
  • tommig
    14th Feb 2012 Member 0 Permalink
    Well. I can work on other things for now. But I will need some help at a point. Whenever you find it, just bump this thread. Hopefully a solution can be formed.
  • tommig
    14th Feb 2012 Member 0 Permalink
    Bumping this. I've set it up so that when potassium burns, tmp is set to 187. Now what?
    if ((r&0xFF)==PT_FIRE) {
    parts[r>>8].tmp =187;
    }


  • jacob1
    14th Feb 2012 Developer 0 Permalink
    You could try doing this

    You just need to check it graphics_fire if it has the modified tmp, and then change the colr/g/b variables to whatever purple would be (before the line that puts those colors into the firer/g/b colors). You might not need to do the changes in pyro.c if you already have something in ptsm.c.