Plasma Ball

  • cyberdragon
    12th Jun 2013 Member 0 Permalink

    After stealing Jacob's BALL code and modifying it, it still won't compile. I put all the variables it needs in a special header and converted some functions to c++. Needs movement and cleaner explosion.

     

    http://pastebin.com/2TmxCpxk

  • boxmein
    12th Jun 2013 Former Staff 0 Permalink
    jacob1's mod is C, not C++ :)
  • cyberdragon
    12th Jun 2013 Member 0 Permalink

     I put all the variables it needs in a special header and converted some functions to c++

     

    1)I know, I changed any differences. 2)C++ is backwards compatable

  • jacob1
    12th Jun 2013 Developer 0 Permalink
    first, in c++ it's sim->eval_move, but I'm pretty sure my moving solids code doesn't directly call that anywhere.

    There's also update_moving_solids, there's some moving solid code at the very very end of update_particles_i, and there's a ton of moving solid code in save.c to save them properly

    Also there's even more in other places since I attempted to allow any solid to move with a lua function. Although that just made the code weird in some places.

    So I don't know if you will be able to copy it all, but you can try ...
  • cyberdragon
    12th Jun 2013 Member 0 Permalink

    That was all, it compiled. In fact, I'll probably need to get rid of some if not alot of your moving solid code because it's gravity based. I just can't figure out what makes BALL fall, whatever it is needs to go.

     

    EDIT: Big issue. It instantly exploded into random electronics.

     

    REDIT: stupid debugger didn't catch a massive undefined variable.

  • jacob1
    12th Jun 2013 Developer 0 Permalink
    @cyberdragon (View Post)
    the very end of update_particles_i makes moving solids fall.
    Also this line in update_moving_solids: msvy[bn] = msvy[bn] + .2;

    Also anything else is just errors in converting things to c++.
  • cyberdragon
    12th Jun 2013 Member 0 Permalink

    Like it failing to loop and vanishing?

  • mniip
    12th Jun 2013 Developer 0 Permalink

    cyberdragon:

    2)C++ is backwards compatable

    The language is, the interface isn't]
  • cyberdragon
    12th Jun 2013 Member 0 Permalink

    No, it was just the header.

     

    Rule: NEVER ACCESS HEADERS IN A LOOP

     

    But now it's diffusing and not staying together.

  • mniip
    13th Jun 2013 Developer 0 Permalink
    @cyberdragon (View Post)
    that's what header guards are for