Game Development Community

character select in-game help!

by Xyno76 · in Technical Issues · 03/13/2011 (5:58 pm) · 1 replies

okay, so i got this character select gui addon when you select a mission, or join a mission, and i was able to move it onto options, but it won't change the dts/character file in-game, and i would like to know how i could change it so that it could please?

here is the code in optionsdlg.gui

new GuiPopUpMenuCtrl(jtPlayerBodyChoice) {
         canSaveDynamicFields = "0";
         Profile = "GuiPopUpMenuProfile";
         HorizSizing = "left";
         VertSizing = "bottom";
         position = "374 55";
         Extent = "110 23";
         MinExtent = "8 2";
         canSave = "1";
         Visible = "1";
         Variable = "pref::Player::jtPlayerBody";
         hovertime = "1000";
         text = "Orc";
         maxLength = "255";
         maxPopupHeight = "200";
      };
      new GuiTextCtrl() {
         canSaveDynamicFields = "0";
         Profile = "GuiTextProfile";
         HorizSizing = "right";
         VertSizing = "bottom";
         position = "399 28";
         Extent = "65 18";
         MinExtent = "8 2";
         canSave = "1";
         Visible = "1";
         hovertime = "1000";
         text = "Player select:";
         maxLength = "1024";
      };
   };
};
//jtmd**************************************************************************
//setup the pop up menu
jtPlayerBodyChoice.add("Be an Orc",0);
jtPlayerBodyChoice.add("The Yellow Man",1);
jtPlayerBodyChoice.add("Default",2);

function jtPlayerBodyChoice::onSelect(%this, %id, %text)
{
   echo("ID = " @ %id);
   if(%id != -1)
   {
      if(%id == 0)
      {
     
         //echo("you chose option 1--->");
         echo("jtPlayerBodyChoice="@jtPlayerBodyChoice.getSelected());
         echo("jtPlayerBodyChoice="@jtPlayerBodyChoice.getText());
         jtPlayerBodyChoice.setText("Orc");
         //jtPlayerBodyChoice.setText("PlayerBody");
         
         
      } else if(%id == 1)
      {
         //echo("you chose option 2");
         echo("jtPlayerBodyChoice="@jtPlayerBodyChoice.getSelected());
         jtPlayerBodyChoice.setText("Yellow Man");
         //jtPlayerBodyChoice.setText("PlayerBody2");
         
      } else if(%id == 2)
      {
         //echo("you chose option 3");
         echo("jtPlayerBodyChoice="@jtPlayerBodyChoice.getSelected());
         jtPlayerBodyChoice.setText("Dunno");
         //jtPlayerBodyChoice.setText("PlayerBody");
      }
   }
}
//jtmd**************************************************************************

About the author

Just a guy who is learning the basics of Torque, soon to learn the more difficult levels of Torque, & pretty good at Adobe Photoshop, & Adobe Flash (Sprite animation)


#1
03/14/2011 (10:24 pm)
oh to add on to the post... can i do something in the option choosing code that just switches it to the other one?

the code here:
//jtmd**************************************************************************  
//setup the pop up menu  
jtPlayerBodyChoice.add("Be an Orc",0);  
jtPlayerBodyChoice.add("The Yellow Man",1);  
jtPlayerBodyChoice.add("Default",2);  
  
function jtPlayerBodyChoice::onSelect(%this, %id, %text)  
{  
   echo("ID = " @ %id);  
   if(%id != -1)  
   {  
      if(%id == 0)  
      {  
       
         //echo("you chose option 1--->");  
         echo("jtPlayerBodyChoice="@jtPlayerBodyChoice.getSelected());  
         echo("jtPlayerBodyChoice="@jtPlayerBodyChoice.getText());  
         jtPlayerBodyChoice.setText("Orc");  
         //jtPlayerBodyChoice.setText("PlayerBody");  
           
           
      } else if(%id == 1)  
      {  
         //echo("you chose option 2");  
         echo("jtPlayerBodyChoice="@jtPlayerBodyChoice.getSelected());  
         jtPlayerBodyChoice.setText("Yellow Man");  
         //jtPlayerBodyChoice.setText("PlayerBody2");  
           
      } else if(%id == 2)  
      {  
         //echo("you chose option 3");  
         echo("jtPlayerBodyChoice="@jtPlayerBodyChoice.getSelected());  
         jtPlayerBodyChoice.setText("Dunno");  
         //jtPlayerBodyChoice.setText("PlayerBody");  
      }  
   }  
}  
//jtmd**************************************************************************  [


EDIT: okay, i believe this is in the wrong topic ^^' oops!