Can't get an element to change!

  • DeathHammer000
    17th May 2014 Member 0 Permalink

    Hi, now I want to get TNT to change into my own custom element upon contact with EXOT. Here is my code:

     

    http://pastebin.com/KqTMNQ22

     

    After I compile it successfully, it doesn't seem to work (it just won't change).

     

    I also want to increase explosion intensity and size. Can you teach me how to do this (first mod)?

     

    Thanks.

  • jacob1
    17th May 2014 Developer 1 Permalink
    Change this line: if ((r&0xFF)==PT_EXOT && (r&0xFF)==PT_BBNG)
    to this: if ((r&0xFF)==PT_EXOT)

    (r&0xFF) stores the type of an element around the tnt. You are checking if the element is both EXOT and BBNG at the same time, which can't happen. But you really just want to check if it's EXOT :P


    As for making it stronger, increase the pressure generated on this line: sim->pv[y/CELL][x/CELL] += 0.5f; You could also adjust the randomness below that, maybe making more PLSM appear or making more heat generate.
  • DeathHammer000
    17th May 2014 Member 0 Permalink

    @jacob1 (View Post)

    Still having problems. Now whenever TNT touches EXOT, it disappears. And when BBNG touches NEUT (which should make MBNG), still nothing happens, even though I modified both of my files.

     

    Here's the code for MBNG: http://pastebin.com/Nkj1XnSR

     

    I also want to make MBNG to emiot more than two elements when exploding and react to different elements differently (producing VIBR with PROT, or even making LIGH with WATR). Is it possible to do this?

    Edited once by DeathHammer000. Last: 17th May 2014
  • GreenFireDragon
    17th May 2014 Member 0 Permalink

    Can you also give the code from BBNG?

  • DeathHammer000
    18th May 2014 Member 0 Permalink

    @GreenFireDragon (View Post)

    I already did that; look at the link from the original post.

     

    I have also seen another modder (nucular) make some code which allows different reactions between one element and others (as mentioned in my previous post). I tried to use it, but it threw a bunch of errors.