home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 58 / pcpp58b_TRIBES.iso / Tribes / base / scripts.vol / move.cs < prev    next >
Encoding:
Text File  |  1998-12-16  |  5.6 KB  |  134 lines

  1. // check which version should be loaded..
  2. if( $ME::Loaded == "true" )
  3. {
  4.    function ME::Move( %speed, %rot )
  5.    {
  6.       if( %speed == "" ) 
  7.          %speed = 2;
  8.       if( %rot == "" )
  9.          %rot = 0.2;
  10.       $ME::CameraMoveSpeed = %speed;
  11.       $ME::CameraRotateSpeed = %rot;
  12.    }
  13.  
  14.    newActionMap( "editor.sae" );
  15.    bindAction( keyboard, make, a, TO, IDACTION_MOVELEFT, 1 );
  16.    bindAction( keyboard, break, a, TO, IDACTION_MOVELEFT, 0 );
  17.    bindAction( keyboard, make, d, TO, IDACTION_MOVERIGHT, 1 );
  18.    bindAction( keyboard, break, d, TO, IDACTION_MOVERIGHT, 0 );
  19.    bindAction( keyboard, make, s, TO, IDACTION_MOVEBACK, 1 );
  20.    bindAction( keyboard, break, s, TO, IDACTION_MOVEBACK, 0 );
  21.    bindAction( keyboard, make, w, TO, IDACTION_MOVEFORWARD, 1 );
  22.    bindAction( keyboard, break, w, TO, IDACTION_MOVEFORWARD, 0 );
  23.    bindAction( keyboard, make, e, TO, IDACTION_MOVEUP, 1 );
  24.    bindAction( keyboard, break, e, TO, IDACTION_MOVEUP, 0 );
  25.    bindAction( keyboard, make, c, TO, IDACTION_MOVEDOWN, 1 );
  26.    bindAction( keyboard, break, c, TO, IDACTION_MOVEDOWN, 0 );
  27.  
  28.    bindCommand( keyboard, make, f1, to, "MEHide();");
  29.    bindCommand( keyboard, make, f2, to, "MEShowInspector();");
  30.    bindCommand( keyboard, make, f3, to, "MEShowCreator();");
  31.    bindCommand( keyboard, make, f4, to, "MEShowTed();");
  32.    bindCommand( keyboard, make, f5, to, "MEGameMode();");
  33.    bindCommand( keyboard, make, f9, to, "METoggleHelp();" );
  34.    bindCommand( keyboard, make, o, to, "METoggleOptions();");
  35.  
  36.    //
  37.    bindCommand( keyboard, make, control, delete, to, "MEDeleteSelection();" );
  38.    bindCommand( keyboard, make, control, c, to, "MECopySelection();" );
  39.    bindCommand( keyboard, make, control, x, to, "MECutSelection();" );
  40.    bindCommand( keyboard, make, control, v, to, "MEPasteSelection();" );
  41.    bindCommand( keyboard, make, control, d, to, "MEDuplicateSelection();" );
  42.  
  43.    bindCommand( keyboard, make, control, n, to, "ME::CreateGroup();" );
  44.  
  45.    //
  46.    //    bindCommand( keyboard, make, control, y, to, "MERedo();" );
  47.    bindCommand( keyboard, make, control, z, to, "MEUndo();" );
  48.    bindCommand( keyboard, make, control, s, to, "MESave();" );
  49.  
  50.    // 
  51.    bindAction( keyboard, make, control, TO, IDACTION_ME_MOD1, 1 );
  52.    bindAction( keyboard, break, control, TO, IDACTION_ME_MOD1, 0 );
  53.    bindAction( keyboard, make, shift, TO, IDACTION_ME_MOD2, 1 );
  54.    bindAction( keyboard, break, shift, TO, IDACTION_ME_MOD2, 0 );
  55.    bindAction( keyboard, make, alt, TO, IDACTION_ME_MOD3, 1 );
  56.    bindAction( keyboard, break, alt, TO, IDACTION_ME_MOD3, 0 );
  57.  
  58.    //
  59.    bindAction(mouse, xaxis, TO, IDACTION_YAW, scale, 0.002, flip);
  60.    bindAction(mouse, yaxis, TO, IDACTION_PITCH, scale, 0.002, flip);
  61.  
  62.    // bookmark binds
  63.    for( %i = 0; %i < 10; %i++ )
  64.    {
  65.       bindCommand( keyboard, make, control, %i, to, "ME::PlaceBookmark(" @ %i @ ");");
  66.       bindCommand( keyboard, make, alt, %i, to, "ME::GotoBookmark(" @ %i @ ");");
  67.    }
  68.  
  69.    // movement binds
  70.    bindCommand( keyboard, make, 0, to, "ME::Move(1024);");
  71.    for( %i = 1; %i < 10; %i++ )
  72.       bindCommand( keyboard, make, %i, to, "ME::Move(" @ ( 1 << %i ) @ ");" );
  73.  
  74.    // toggle key for plane movement
  75.    bindCommand( keyboard, make, capslock, to, "METogglePlaneMovement();" );
  76. }
  77. else
  78. {
  79.    // Set up a default movement action map file
  80.    function move( %speed, %posRot )
  81.    {
  82.       if( %speed == "" ) {
  83.          $MoveSpeed = 2;
  84.       }
  85.       else {
  86.          $MoveSpeed = %speed;
  87.       }
  88.  
  89.       if( %posRot == "" ) {
  90.          $PosRotation = 0.2;
  91.       }
  92.       else {
  93.          $PosRotation = %posRot;
  94.       }
  95.  
  96.       %NegRotation = strcat( "-", $PosRotation );
  97.  
  98.       newActionMap("move.sae");
  99.       bindAction( keyboard, make, a, TO, IDACTION_MOVELEFT, $MoveSpeed );
  100.       bindAction( keyboard, break, a, TO, IDACTION_MOVELEFT, 0 );
  101.       bindAction( keyboard, make, d, TO, IDACTION_MOVERIGHT, $MoveSpeed );
  102.       bindAction( keyboard, break, d, TO, IDACTION_MOVERIGHT, 0 );
  103.       bindAction( keyboard, make, s, TO, IDACTION_MOVEBACK, $MoveSpeed );
  104.       bindAction( keyboard, break, s, TO, IDACTION_MOVEBACK, 0 );
  105.       bindAction( keyboard, make, w, TO, IDACTION_MOVEFORWARD, $MoveSpeed );
  106.       bindAction( keyboard, break, w, TO, IDACTION_MOVEFORWARD, 0 );
  107.       bindAction( keyboard, make, e, TO, IDACTION_MOVEUP, $MoveSpeed );
  108.       bindAction( keyboard, break, e, TO, IDACTION_MOVEUP, 0 );
  109.       bindAction( keyboard, make, c, TO, IDACTION_MOVEDOWN, $MoveSpeed );
  110.       bindAction( keyboard, break, c, TO, IDACTION_MOVEDOWN, 0 );
  111.  
  112.       //
  113.       bindAction( keyboard, make, left, TO, IDACTION_YAW, $PosRotation );
  114.       bindAction( keyboard, break, left, TO, IDACTION_YAW, 0 );
  115.       bindAction( keyboard, make, right, TO, IDACTION_YAW, %NegRotation );
  116.       bindAction( keyboard, break, right, TO, IDACTION_YAW, 0 );
  117.       bindAction( keyboard, make, up, TO, IDACTION_PITCH, $PosRotation );
  118.       bindAction( keyboard, break, up, TO, IDACTION_PITCH, 0 );
  119.       bindAction( keyboard, make, down, TO, IDACTION_PITCH, %NegRotation );
  120.       bindAction( keyboard, break, down, TO, IDACTION_PITCH, 0 );
  121.  
  122.       //
  123.       bindCommand( keyboard, make, 1, to, "move(1);");
  124.       bindCommand( keyboard, make, 2, to, "move(3);");
  125.       bindCommand( keyboard, make, 3, to, "move(6);");
  126.       bindCommand( keyboard, make, 4, to, "move(12);");
  127.       bindCommand( keyboard, make, 5, to, "move(24);");
  128.       bindCommand( keyboard, make, 6, to, "move(50);");
  129.       bindCommand( keyboard, make, 7, to, "move(100);");
  130.       bindCommand( keyboard, make, 8, to, "move(200);");
  131.       bindCommand( keyboard, make, 9, to, "move(400);");
  132.       bindCommand( keyboard, make, 0, to, "move(5);");
  133.    }
  134. }