Element limit with latest code

  • PizzaPlatypus
    23rd Jan 2011 Member 0 Permalink
    what other bit?
    And yes, to make something explode into flames on contact with NEUT Put this code:
    if(t==PT_BOOM)
    {
    for(nx=-1; nx<2; nx++)
    for(ny=-1; ny<2; ny++)
    if(x+nx>=0 && y+ny>0 &&
    x+nx<XRES && y+ny<YRES && (nx || ny))
    {
    r = pmap[y+ny][x+nx];
    if((r>>8)>=NPART || !r)
    continue;
    {
    if((r&0xFF)==PT_NEUT
    {
    parts[r>>8].type=FIRE;
    pv[x/CELL][y/CELL]+=5.0f
    }
    }
    }
    }
    PT_BOOM being the explosive
    Also set explosivity and flammability high in powder.h
  • Made2Shred
    23rd Jan 2011 Member 0 Permalink
    @PizzaPlatypus
    i mean make it like plutonium
  • PizzaPlatypus
    23rd Jan 2011 Member 0 Permalink
    oh well replace PT_FIRE with PT_NEUT
    and add if (1>(rand()%30)) before parts[r.>>8].type (the higher the number after % the slower the reaction)
  • Made2Shred
    23rd Jan 2011 Member 0 Permalink
    so:

    if(t==PT_FRAN)
    {
    for(nx=-1; nx<2; nx++)
    for(ny=-1; ny<2; ny++)
    if(x+nx>=0 && y+ny>0 &&
    x+nx<XRES && y+ny<YRES && (nx || ny))
    {
    r = pmap[y+ny][x+nx];
    (1>(rand()%5))
    if((r>>8)>=NPART || !r)
    continue;
    {
    if((r&0xFF)==PT_NEUT
    {
    parts[r>>8].type=NUET;
    pv[x/CELL][y/CELL]+=5.0f
    }
    }
    }
    }
  • PizzaPlatypus
    23rd Jan 2011 Member 0 Permalink
    yep
    can you try and solve my problem now
  • Made2Shred
    23rd Jan 2011 Member 0 Permalink
    1 more thing. does it matter what line i put it on in powder.c?
  • PizzaPlatypus
    23rd Jan 2011 Member 0 Permalink
    find the part where everything says else if before it (line 2000ish) and put it there adding else before the if.
  • PizzaPlatypus
    23rd Jan 2011 Member 0 Permalink
    no around line 2000
  • Made2Shred
    23rd Jan 2011 Member 0 Permalink
    ok, at the start of end of where else if is?