Still can't get my mod to work!

  • DeathHammer000
    22nd May 2014 Member 0 Permalink

    I am still having a lot of trouble with getting my custom elements to change when in contact with other elements.

     

    My code:

     

    BANG: http://pastebin.com/KqTMNQ22

    BBNG: http://pastebin.com/iK16QSYS

     

    BANG should make BBNG on contact with EXOT. MBNG should be formed when BBNG meets NEUT. I also am having trouble with case-by-case reactions (BBNG reacting differently to PROT and ELEC, for example) and tinkering with the explosive powers of the elements. I have not given the code for MBNG as it works.

  • jacob1
    23rd May 2014 Developer 1 Permalink
    For the first problem, change line 70 "if ((r&0xFF)==PT_EXOT && (r&0xFF)==PT_BBNG)" to "if ((r&0xFF)==PT_BBNG)"
    Although I thought I told you to do that already ...

    For the second one, it's a bit strange. phot/neut/elec/prot actually aren't stored in pmap, they are stored in a similar thing called photons. Change the code around 62-64 to:r = pmap[y+ry][x+rx];
    if (!r)
    r = photons[y+ry][x+rx];
    if (!r)
    continue;

    For the possible third problem, i'm not sure what exactly it is but it might depend on how the PROT or ELEC are moving? idk.
    Edited 2 times by jacob1. Last: 23rd May 2014
  • DeathHammer000
    23rd May 2014 Member 0 Permalink

    @jacob1 (View Post)

     

    Got this error:

     

    http://pastebin.com/ghBWXgDc

     

    How does one declare "photons" in a way that evades the error?

     

    I also changed the code that you said would fix problem 1 (used outdated paste) and it still didn't work.

     

    Regarding the third problem, nucular has made a case-reaction system. Their mod is in the Powder Toy mods discussion. Use the link to the repository and find the element RVRS (reversium).

    Edited once by DeathHammer000. Last: 23rd May 2014
  • boxmein
    23rd May 2014 Former Staff 0 Permalink
    @DeathHammer000 (View Post)
    Declaring means that you'd have to create another data structure named photons, but that's not an okay solution, you need to access an existing one. In a simulation function you can access pmap with
    pmap
    but you'll have to access photons by the simulation object, aka replace every instance of
    photons
    in your code with
    sim->photons
  • DeathHammer000
    24th May 2014 Member 0 Permalink

    Okay, so no build errors, but the elements are still not changing - instead, they disappear. Why is this happening?

     

    This is my second try at modding TPT (I tried once but I didn't decide to use the forums); I originally gave up due to errors of this sort that I could not fix.