xboxscene.org forums

Author Topic: Updated Dna  (Read 801 times)

evil_ted

  • Archived User
  • Newbie
  • *
  • Posts: 8
Updated Dna
« on: January 15, 2005, 04:29:00 AM »

Ive decided to rewrite this for everyone, it seems that things were getting really messy, and I was starting to get annoyed at not seeing the animation when UIX starts, instead I was seeing strands od DNA flying at me.
 
You will need 2 additional files for this too work, neither of which can be found inside one of the xip's that comes with UIX. The only Dash I know of that has it built-in is BlackstormX. Would be a good idea to get these files first.

Backing_dna.xm
Backing_dna_SIDES.xm

they come from the Skin_Menu.xip in BSX1.1

Next open up mainmenu.xip/default.xap and at the very top of this file add the following.

CODE


DEF theDNA1 Transform
{

children
[
Spinner
             {
               rpm 2
               axis 0 1 0
               children
               [

DEF DNA1 Transform
             {
                 children
                 [
                     Shape
                     {
                         appearance Appearance
                         {
                             material MaxMaterial
                             {
                                 name "MenuCell"
                             }
                         }
                         geometry DEF DNA1_Mesh Mesh { url "Backing_dna.xm" }
                     }
                 ]

translation 0 0 0
             }

DEF DNAString1 Transform
             {
                 children
                 [
                     Shape
                     {
                         appearance Appearance
                         {
                             material MaxMaterial
                             {
                                 name "FlatSrfc/PodParts"
                             }
                         }
                         geometry DEF DNAString1_Mesh Mesh { url "Backing_dna_SIDES.xm" }
                     }
                 ]
translation 0 0 0
             }

]
}
]
scale 12 12 12
rotation 0 0 .5 0.1745330
//translation -4400 0 -5100
translation -5400 0 -5100
}

DEF theDNA3 Transform
{
children
[

Spinner
             {
               rpm 2
               axis 0 1 0
               children
               [

DEF DNA3 Transform
             {
                 children
                 [
                     Shape
                     {
                         appearance Appearance
                         {
                             material MaxMaterial
                             {
                                 name "MenuCell"
                             }
                         }
                         geometry DEF DNA3_Mesh Mesh { url "Backing_dna.xm" }
                     }
                 ]

translation 0 0 0
             }

DEF DNAString3 Transform
             {
                 children
                 [


                     Shape
                     {
                         appearance Appearance
                         {
                             material MaxMaterial
                             {
                                 name "FlatSrfc/PodParts"
                             }
                         }
                         geometry DEF DNAString3_Mesh Mesh { url "Backing_dna_SIDES.xm" }
                     }


                 ]
translation 0 0 0

             }
]
                     }


]
scale 11 11 11
rotation 0 0 1 -.523599
translation 0 0 -5000
}



DEF theDNA5 Transform
{
children
[
Spinner
             {
               rpm 2
               axis 0 1 0
               children
               [

DEF DNA5 Transform
             {
                 children
                 [
                     Shape
                     {
                         appearance Appearance
                         {
                             material MaxMaterial
                             {
                                 name "MenuCell"
                             }
                         }
                         geometry DEF DNA5_Mesh Mesh { url "Backing_dna.xm" }
                     }
                 ]

translation 0 0 0
             }

DEF DNAString5 Transform
             {
                 children
                 [
                     Shape
                     {
                         appearance Appearance
                         {
                             material MaxMaterial
                             {
                                 name "FlatSrfc/PodParts"
                             }
                         }
                         geometry DEF DNAString5_Mesh Mesh { url "Backing_dna_SIDES.xm" }
                     }
                 ]
translation 0 0 0

             }
]
}

]
scale 11 11 11
rotation 0 0 .3 -0.1745330
//translation 3000 0 -5100
translation 4000 0 -5100
}

Save and close the xap.
Insert the 2 DNA*.xm files into the xip and save and close it.
That should get the DNA on the screen and in the background (for the foreground add the code above to the end of the file, not the begining - or mix it up), next some options so you can turn it on and off.

Open default.xip/default.xap and search for

CODE

function QuickLaunchA()


directly above this function add

CODE

function DNAOnBootCheck()
{
   var IniFile = new Settings;
   IniFile.SetIniSection( "DNA On Boot" );
   var a = IniFile.GetIniValue( "Enabled" );
   IniFile.CloseIniFile();
   
   if( a == "true" ) { ShowDNA();}
   else if( a == "false" ) { HideDNA1();}
   else { return; }
}


next search for

CODE

DEF theMainMenu Level


you will see an entry just below it called "MusicOnBootCheck();"  just below it add

CODE

  DNAOnBootCheck();


just below this you will come accross a line that reads
CODE

     control DEF theMainMenuJoy Joystick
    {
        function OnADown()
        {
            PlaySoundA();
            if(nCurMainMenuItem == 0)
            {
                theMusicMenuIn.Play();
                GoToMusic();
            }
            else if(nCurMainMenuItem == 1)
            {
                theSettingsMenuIn.Play();
                GoToHardDrive();
            }
            else if(nCurMainMenuItem == 2)
            {
  GoToFileManager();
            }
            else if(nCurMainMenuItem == 3)
            {
                theSettingsMenuIn.Play();
                GoToSettings();
            }
        }


you want to add the next bit to this section. It doesnt matter where in this section just as long as you match the {} you should be ok.

CODE

   function OnXDown()
   {
  if(bDNAVisable == false){ ShowDNA();}
  else if(bDNAVisable == true){ HideDNA(); }
  }

the function "OnXDown()" can be anything on the controller or remote - eg
OnLeftThumbDown()
On1()
etc

next, below the last } of "DEF theMainMenuJoy" you will see

CODE

var bBackToDVDPlayer;
var bGoToCDPlayer;
var bBackToLauncher;
var bShowErrorPanel;

This is the first few entries to a list of var's which is just below the last "}" in "DEF theMainMenu Level"  Add this to the end of that list

CODE

var bDNAVisable;


NOw scroll to the very bottom of the file and add this to the end....

CODE

function HideDNA()
{
   bDNAVisable = false;
   var w = theMainMenu.children[0].children[0];
   w.theDNA1.SetRotation(0, 2, .5, 0.1745330);
   w.theDNA3.SetRotation(0, 0, -.5, 0.1745330);
   w.theDNA5.SetRotation(0, 1, .5, 0.1745330);
   w.theDNA1.fade = 1.0;
   w.theDNA3.fade = 1.0;
   w.theDNA5.fade = 1.0;
   w.theDNA1.SetTranslation(285.900002, -89.261000, -40.399994);
   w.theDNA3.SetTranslation(285.900002, -89.261000, -40.399994);
   w.theDNA5.SetTranslation(285.900002, -89.261000, -40.399994);

   w.theDNA1.fade = 0.75;
   w.theDNA3.fade = 0.75;
   w.theDNA5.fade = 0.75;

   w.theDNA1.SetAlpha(0);
   w.theDNA3.SetAlpha(0);
   w.theDNA5.SetAlpha(0);
   thePlayerPanelIn.Play();
}

function HideDNA1()
{
   bDNAVisable = false;
   var x = theMainMenu.children[0].children[0];
   x.theDNA1.SetAlpha(0);
   x.theDNA3.SetAlpha(0);
   x.theDNA5.SetAlpha(0);
}

function ShowDNA()
{
   bDNAVisable = true;
   var x = theMainMenu.children[0].children[0];
   x.theDNA1.SetRotation(0, 0, .5, 0.1745330);
   x.theDNA3.SetRotation(0, 0, 1, -.523599);
   x.theDNA5.SetRotation(0, 0, .3, -0.1745330);
   x.theDNA1.fade = 1.0;
   x.theDNA3.fade = 1.0;
   x.theDNA5.fade = 1.0;
   x.theDNA1.SetTranslation(-5400, 0, -5100);
   x.theDNA3.SetTranslation(0, 0, -5000);
   x.theDNA5.SetTranslation(4000, 0, -5100);

   x.theDNA1.fade = 0.75;
   x.theDNA3.fade = 0.75;
   x.theDNA5.fade = 0.75;

   x.theDNA1.SetAlpha(1);
   x.theDNA3.SetAlpha(1);
   x.theDNA5.SetAlpha(1);
   thePlayerPanelOut.Play();
}


That should be it for Default.xip/default.xap, so save and close the file.
Next open default.xip/config.xap
Search for
CODE

function BuildMainList()

and add this too it
CODE

  configList = "Enable the DNA on Startup:";
   configValues = "c-DNA On Boot-Enabled";
   configSelect = "ToggleTF()";
   i = i + 1;


"configList" is the start of an entry and "i = i + 1;" is the end so after a "i = i + 1;" but before a "configList" and you should be goood, this is the order that you will see it on the screen (in the settings part of the dash)
thats it.
Like I said I have updated the show/hide to make the DNA not fly away on the booting of the dash, but rather to not be present... you can do similar thingz for the clocks...

Oh yeah almost forgot. Open UIX.ini file and add the following

CODE

[DNA On Boot]
Enabled=false                 (or true - you choose)


Hope that clears anything up.....
Logged

MIDDERMAN

  • Archived User
  • Newbie
  • *
  • Posts: 10
Updated Dna
« Reply #1 on: January 15, 2005, 01:09:00 PM »

ok i got this working the only problem i have is i can see it in setting but cannot turn dna off
Logged

MIDDERMAN

  • Archived User
  • Newbie
  • *
  • Posts: 10
Updated Dna
« Reply #2 on: January 15, 2005, 11:16:00 PM »

aftr a few hours trying to get this to work it dont found a few errors in the code
it shows the dna fine but refuses to let you deactivate and activate it on pressing Xdown, and you are unable to change true to false in settings.
Logged

evil_ted

  • Archived User
  • Newbie
  • *
  • Posts: 8
Updated Dna
« Reply #3 on: January 16, 2005, 02:02:00 AM »

Hey sorry about that... I wrote that last post at like 4am.. anyways theres 2 things missing

I forgot to add the bit just under the var list... it should be

CODE

bDNAVisable = false;


and goes in the "function initialize()" located in  "DEF theMainMenu Level"

with the INI file I have had problems. If you add the code to the top of the file it should work, otherwise change the line that reads
CODE

 configSelect = "ToggleTF()";

to
CODE

   configSelect = "ConfigKeyB()";

this will allow u to input the setting using the keyboard from within UIX. After this has been set u can change it back...
Logged

HomicidalMo0se

  • Archived User
  • Jr. Member
  • *
  • Posts: 87
Updated Dna
« Reply #4 on: January 16, 2005, 02:36:00 AM »

nice code, ted.
Logged

MIDDERMAN

  • Archived User
  • Newbie
  • *
  • Posts: 10
Updated Dna
« Reply #5 on: January 16, 2005, 06:21:00 AM »

very nice took a while but worth the wait :)
Logged

xzenor

  • Archived User
  • Full Member
  • *
  • Posts: 226
Updated Dna
« Reply #6 on: January 16, 2005, 10:00:00 AM »

QUOTE(evil_ted @ Jan 16 2005, 10:26 AM)


with the INI file I have had problems. If you add the code to the top of the file it should work, otherwise change the line that reads
CODE

 configSelect = "ToggleTF()";

to
CODE

   configSelect = "ConfigKeyB()";

this will allow u to input the setting using the keyboard from within UIX. After this has been set u can change it back...
*



Where is this INI file?? is it the uix.ini??  If so....where do we put this??
Logged

evil_ted

  • Archived User
  • Newbie
  • *
  • Posts: 8
Updated Dna
« Reply #7 on: January 16, 2005, 10:23:00 AM »

yes thats the right INI file... UIX.INI  - its the only ini file that UIX has.......

the code  that you quoted me goes in the default.xip/config.xap and replaces only the toggle command....

CODE

configList = "Enable the DNA on Startup:";
configValues = "c-DNA On Boot-Enabled";
configSelect = "ToggleTF()";
i = i + 1;


do you see the second last line??       "ToggleTF();"  
thats what you need to change to       "ConfigKeyB()";

you will need to do this only if you DONT add the lines to the top of the INI file. If you put the 2 lines of code at the top of the INI file, UIX should read them with out any problems (at least this has been my experience). You can verify by going into the dash settings, if the true or false shows up then you wont need to change the toggleTF. If its not there the configkeyb allows you to enter the command from within the dash and will store anything you enter in the INI file.  Another way is by setting the INI file to false (like below) that way when you reboot the DNA should not be there!

the code for the INI file - put this at the top of the file...
CODE

 [DNA On Boot]
Enabled=false

Logged