Difference between revisions of "How to add more player character models"

From Platinum Arts Sandbox Free 3D Game Maker
Jump to: navigation, search
(Created page with '*Before doing this tutorial, you need to understand how to use Code::Blocks to compile Sandbox. To do so, read the Compiling the source code tutorial first. *To start: Open …')
 
Line 2: Line 2:
  
 
*To start: Open up main/src/fpsgame/render.cpp. Scroll down a little bit, and you should find a list that looks like this:
 
*To start: Open up main/src/fpsgame/render.cpp. Scroll down a little bit, and you should find a list that looks like this:
 
+
<font size=2>
 
     static const playermodelinfo playermodels[8] =
 
     static const playermodelinfo playermodels[8] =
 
     {
 
     {
Line 14: Line 14:
 
         { "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 }
 
         { "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 }
 
     };
 
     };
 
+
</font>
This is the code which loads all of the playermodels. The first part, the "static const" is an array which holds all of the playermodel data. In the original code, there are 8 playermodels, (4 rcs, 3 ogres and the human), and that's within the brackets. To add a playermodel, simply
+
This is the code which loads all of the playermodels. The first part, the "static const" is an array which holds all of the playermodel data. In the original code, there are 8 playermodels, (4 rcs, 3 ogres and the human), and that's within the brackets. To add a playermodel, simply change the bracket number to 9 (or add however many playermodels you're adding), then add a line below the uh/chars/man line. The first part is the path of the model in quotes. I don't know about the next few parts. Just copy and paste the NULL area, as it appears to be the same throughout the code lines. The last three lines are the model names as they would show up in Sandbox. I think. I'm not sure about the true and false values, it may be whether the playermodel has all the animations ready (e.g. the RC has a swim animation whereas the ogre doesn't). Once you have your new models added, recompile via build and run.

Revision as of 16:53, 23 May 2012

  • Before doing this tutorial, you need to understand how to use Code::Blocks to compile Sandbox. To do so, read the Compiling the source code tutorial first.
  • To start: Open up main/src/fpsgame/render.cpp. Scroll down a little bit, and you should find a list that looks like this:

    static const playermodelinfo playermodels[8] =
   {
       { "rc", "rc/blue", "rc/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "rc", "rc_blue", "rc_red", true },
       { "rc/blue", "rc/blue", "rc/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "rc_blue", "rc_blue", "rc_red", true },
       { "rc/red", "rc/blue", "rc/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "rc_red", "rc_blue", "rc_red", true },
       { "rc/pink", "rc/blue", "rc/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "rc_pink", "rc_blue", "rc_red", true },
       { "ogre", "ogre/blue", "ogre/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "ogre", "ogre", "ogre", false },
       { "ogre/blue", "ogre/blue", "ogre/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "ogre", "ogre", "ogre", false },
       { "ogre/red", "ogre/blue", "ogre/red", NULL, NULL, NULL, { NULL, NULL, NULL }, "ogre", "ogre", "ogre", false },
       { "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 }
   };

This is the code which loads all of the playermodels. The first part, the "static const" is an array which holds all of the playermodel data. In the original code, there are 8 playermodels, (4 rcs, 3 ogres and the human), and that's within the brackets. To add a playermodel, simply change the bracket number to 9 (or add however many playermodels you're adding), then add a line below the uh/chars/man line. The first part is the path of the model in quotes. I don't know about the next few parts. Just copy and paste the NULL area, as it appears to be the same throughout the code lines. The last three lines are the model names as they would show up in Sandbox. I think. I'm not sure about the true and false values, it may be whether the playermodel has all the animations ready (e.g. the RC has a swim animation whereas the ogre doesn't). Once you have your new models added, recompile via build and run.