Coding new life elements?

  • SuperRoy
    3rd Nov 2011 Member 0 Permalink
    just a little help needed. all i want to do is take an element like GoL and mess around with the rules for when pixels live and die, and keep the old GoL intact. do I just copy and paste some stuff then edit only a few things, or is it way harder than that?

    If you're going to tell me how, i will need step by step instructions
  • tommig
    3rd Nov 2011 Member 0 Permalink
    @SuperRoy (View Post)
    I've done it before, it's not to difficult

    Code as you would any other element, but on the major line of code where you see this in powder.h

    {"BRAN", PIXPACK(0xCCCC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Brian 6 S6/B246/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},

    put something like that in. Then go to powder.h line 807 - 925, and just fill in the stuff, it's pretty self explanitory
    at least it should be!
  • SuperRoy
    3rd Nov 2011 Member 0 Permalink
    you're assuming i actually have experience in this stuff. i don't :( hence the "i will need step by step instructions."
  • tommig
    3rd Nov 2011 Member 0 Permalink
    @SuperRoy (View Post)
    Have you coded any other elements yet?
    If not, try to get into the swing of thing before you start fiddling with the life stuff.
    And read this
  • cctvdude99
    3rd Nov 2011 Member 0 Permalink
    @SuperRoy (View Post)
    From reading tommig's post, it sounds like anyone without experience could do it. You just need to use your initiative.
    Self teaching yourself from other pieces of the source is probably the easiest way to learn. It's how I learnt.
    And I have little experience, yet I have made a mod (yea, it died, but oh well - I'm reviving it now).