How do I use parts in grphx?

  • Videogamer555
    16th May 2012 Member 0 Permalink
    I know that the parts array works in element update functions. But I need to use it in the graphics update function (not normal element update function). I need my PLSM to have a certain color glow ONLY when it was produced by burning a certain element. I've made it so BMTL burns with PLSM and sets the PLSM ctype to PT_BMTL, but now I need the plasma's graphics update function to handle the element properties (the ctype property to be specific) so it can produce a certain color of PLSM only when that PLSM is the result of burning the BMTL.

    I really need to know how to import the element update function variables (such as ctype) for PLSM into the graphics update function for PLSM.
  • tommig
    16th May 2012 Member 0 Permalink
    go to PLSM.c and add this starting from line 5:

    if (cpart->ctype == PT_BMTL) {
    int caddress = restrict_flt(restrict_flt((float)cpart->life, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
    *colr = (unsigned char)flm_data[caddress];
    *colg = (unsigned char)flm_data[caddress];
    *colb = (unsigned char)flm_data[caddress];
    }