Need Help With Code!

  • AngrySpam
    20th May 2012 Member 0 Permalink
    Hello, I'm trying to make an element for the Unrealist Science Mod (we call it URSM :P) and I'm having troubles with 1 little thing:
    if ((r&0xFF)==PT_PHOT){
    parts[i].life += 1;
    }
    I'm trying to have this element's life go up by 1 at collision with PHOT...but it just stays at 0. :( Anybody know how to fix? If so peas help me!
    --thanks!
  • Ximon
    20th May 2012 Administrator 2 Permalink

    Photons cannot be detected in the same way that other elements are, since most elements have they indexes stored in pmap, Photons, Neutrons and Electrons are stored in photons, to fix the issue, you need to change

    r = pmap[y][y];

    to

    r = photons[y][x];

  • AngrySpam
    20th May 2012 Member 0 Permalink
    DELETED - LIFE IS A LIE
  • Ximon
    20th May 2012 Administrator 1 Permalink

    Then that's another problem, can you post you entire source for the element function?

  • AngrySpam
    20th May 2012 Member 0 Permalink
    Dont look at my smexy code :(
  • mniip
    20th May 2012 Developer 1 Permalink
    you're a fool
  • AngrySpam
    20th May 2012 Member 0 Permalink
    @mniip (View Post)
    i know but i learn by looking at shit - i have no better way xD
    EDIT: i fixed my problem :D
  • boxmein
    20th May 2012 Former Staff 0 Permalink
    @AngrySpam (View Post) Now post how you did it. Because else this thread will be useless for future help seekers. image
  • AngrySpam
    20th May 2012 Member 0 Permalink
    @boxmein (View Post)
    I would...but really there is no need >.<
  • boxmein
    20th May 2012 Former Staff 0 Permalink
    @AngrySpam (View Post) Didn't the illustration motivate you? :<
Locked by cracker64: rawr