Code Problem

  • Rdogg112
    26th Aug 2010 Member 0 Permalink
    im trying to add a new element , just for testing but im getting
    powder.c(811): error C2078: too many initializers

    line 811 is:
    /* BLOD */ {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1},
  • Xenocide
    26th Aug 2010 Former Staff 0 Permalink
    It's a good idea to check a couple of lines either side of an error because bad syntax can show as an error where there isn't one. Post lines 807 to 816.
  • Rdogg112
    26th Aug 2010 Member 0 Permalink
    /* LCRY */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    /* STKM */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    /* SWCH */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    /* SMKE */ {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 0,0,1,0,0,1,0,0,0,0,0,0,0,0,0},
    /* BLOD */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
    };

    #define FLAG_STAGNANT 1
    typedef struct
    {
  • Xenocide
    26th Aug 2010 Former Staff 0 Permalink
    just copy/pasted your code into gedit, only problems I've found are spaces in each line and SMKE is missing a ",0"

    remove the spaces and it should be fine
  • Rdogg112
    26th Aug 2010 Member 0 Permalink
    i removed all the spaces and added ,0 to SMKE and it still gives me
    1>powder.c(811): error C2078: too many initializers
  • DarkSpikeX
    26th Aug 2010 Member 0 Permalink
    did u add PT_BLOD to line 60x (the long list of PT_???)
    and below {"SMKE", PIXPACK(0x222222), 0.9f,.............
    ? because blod is working fore me after i added those 2
  • Rdogg112
    26th Aug 2010 Member 0 Permalink
    yeah
    #define PT_BLOD 59
    and
    {"BLOD", PIXPACK(0x990000), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, SC_LIQUID, R_TEMP+-2.0f, 30, "Blood."},
  • Felix
    26th Aug 2010 Member 0 Permalink
    Remove the , after the last initializer.
  • Rdogg112
    26th Aug 2010 Member 0 Permalink
    Nope Felix, Still nothing
  • Felix
    26th Aug 2010 Member 0 Permalink
    Rdogg112:
    Nope Felix, Still nothing

    What nothing? What error message are you getting?