Page 4 of 4

Re: 3D Models Animation Preset

Posted: October 26th, 2011, 11:22 pm
by jSoftApps
chocolatepie33 wrote:not to interrupt you guys (sorry justanother1), just mentioning that like jsoft said, the playermodel list is in the render.cpp file. Now, to expand on what he said, the specific list is creating via a C++ array, meaning we can add as many player models as we want. An array is a series of values of any data type. They're pretty easy to use, as long as you understand what goes in the array. This is the specific code for the playermodel array:

Code: Select all

static const playermodelinfo playermodels[8] =
    {
        { "rc", "rc/blue", "rc/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "rc", "rc_blue", "rc_red", true, true },
        { "rc/blue", "rc/blue", "rc/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "rc_blue", "rc_blue", "rc_red", true, true },
        { "rc/red", "rc/blue", "rc/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "rc_red", "rc_blue", "rc_red", true, true },
        { "rc/pink", "rc/blue", "rc/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "rc_pink", "rc_blue", "rc_red", true, true },
        { "ogre", "ogre/blue", "ogre/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "ogre", "ogre", "ogre", false, true },
        { "ogre/blue", "ogre/blue", "ogre/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "ogre", "ogre", "ogre", false, true },
        { "ogre/red", "ogre/blue", "ogre/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "ogre", "ogre", "ogre", false, true },
        { "uh/chars/man", "uh/chars/man", "uh/chars/man", NULL, NULL, NULL, { NULL, NULL, NULL }, "uh/chars/man", "uh/chars/man", "uh/chars/man", false, true }
    };
for some more stuff on arrays: http://www.cplusplus.com/doc/tutorial/arrays/
personally, it'd be better if the playermodel list was a vector array, which could be expanded/reduced as needed. But alas, I believe that would likely require recompiling anyways. http://www.cplusplus.com/reference/stl/vector/
Good job CP!
I recommend Code::Blocks for the compiler (because Hirato broke the vcpp files (he really needs to fix them) :evil: )