Another question about colors

  • star400040
    23rd Nov 2011 Member 0 Permalink
    sorry if I am still a bit confused here, let me just explain exactly what I am trying to do. I have a sulfur element, I want that element to produce a flame that is blue when it burns. What would be the best way to do this? Please provide a detailed description.
  • jacob1
    23rd Nov 2011 Developer 0 Permalink
    You would probably have to change the fire code a little then. You could add this in pyro.c after line 56:
    if (rt == PT_SULF)
    parts[r>>8].ctype = PT_SULF; (fire uses ctype already, but I don't think it does anything with it, so it's okay to use)
    Then in fire.c, at line 9 do:
    if (cpart->ctype == PT_SULF)
    {
    *colr = xxx;
    *colg = xxx;
    *colb= xxx;
    }
    This will make the fire it produces turn blue, and you don't even need to create a new graphics/update function this way
  • star400040
    23rd Nov 2011 Member 0 Permalink
    since I don't have the most recent version of the code is it after the two brackets because that would be line 58? Either way I am going to give it a shot
  • jacob1
    23rd Nov 2011 Developer 0 Permalink
    You would put that before the two brackets. I tested this code a while ago, and so i'm sure that it works now.
  • star400040
    23rd Nov 2011 Member 0 Permalink
    still doesn't seem to be working for me here are my pyro.c and fire.c pastebins



    Maybe it has to do with my powder.h code or I need to put something in the sulfur code because right now its only burning when I ignite it with fire.
  • jacob1
    23rd Nov 2011 Developer 0 Permalink
    You should put '= rt' in line 59
    Also, in line 58, it just says || PT_SLFS, you should change that to || rt == PT_SLFS
  • star400040
    23rd Nov 2011 Member 0 Permalink
    there we go :)