News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

How to script, what to use to script?

Started by doom3xbox, September 07, 2015, 08:10:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

doom3xbox

Hi,

So this scripting for Doom 3, if I want to edit an ingame computer key that opens a door, and then want to close that door, where can I get some example code to this? I can use dragon unpacker to open the Pak4 files.

Pak000 seems to have textures for the various levels in the game.

Is notepad an option for typing up a script, like the basic ones.

The Happy Friar

The pk4's are zip files so any zip reader will do. Win XP & new has built in zip explore but I still prefer 7zip.

I also like Notepad++ for editing scripts.  It lets me open multiples scripts at once in one window (tabs) and I can set it to "C" language so it has contex highlighting & autocomplete.  I've also used Editpad Lite. 

All the items you pick up are in ".def" files.  Well, most are. I know it's technically possible to make a new item in the level editor so it's never in a .def, but almost all are in the .def file.  The way a door works are normally handled in the .map file for the map in question, BUT, scripts can also control entities to make them behave just like doors. 

In the map you can use some console commands to tell you the entity's name your crosshair is on ("g_dragentity 1" I think, you might have to press the fire button) & then you can find that entity and change it's properties.

Normally for a door to close after it's open you change the properties for the door.  You would use the entity name you found in the game, then load the proper .map file in your text editor, do a search for that entity & change the key/value so the door closes again.  Or you could load the map in the editor & find that entity & do the same.

The basics of id map editing are the same between Quake and doom 3.  RAGE change things.

doom3xbox

I don't recall a standard window zip extractor opening a pak fole, unless you mean winzip and that other one.

I am refering to the key command, in some levels, the player will activate some event, like a bridge in the beginning. Just an opening and closing door by a sensor or whatever isn't what I need.

I have never run Quake. I have used GTKRadiant for Elite force, tried Elite force 2, but doesn't work on the XP system.

Actual script files will be in which Pak file? I won't need a .def files or anything like that.

Phrozo

Most of the text based assets are in pak000.pk4 in your Doom 3 base folder. The "script" folder will be in there. I use 7-Zip for extracting pak files.

doom3xbox

I've read one script. Hmm, looks fairly straight forward, any tutorials?

bkt

Tutorials? Yes.  Q4 Specific, but it's the same scripting language.

doom3xbox

I'm find this rather puzzeling.

I have my test map, an info_player_teleport and a monster_zombie_commando

I tried viewing one map script where one of these runs out of a hatch, that was the site 2 on the Monorail map for example.

I want the monster to appear after an action, so not right away. And then attack the player.

void matt_mover()
   {
      $arm.time (1);
      $top.time (0.75);
      $bottom.time (0.5);
      
      while (1)
      {
         // Should be centered here - Moving right next...
         $arm.rotateOnce ('0 90 0');
         $top.rotateOnce ('0 0 90');
         sys.waitFor ($arm);

         $rotator.rotateOnce ('0 360 0');
         $bottom.move (UP, 24);
         
         sys.waitFor ($bottom);
         
         sys.wait (0.5);
      
         $rotator.rotateOnce ('0 -360 0');
         $bottom.move (DOWN, 24);
         sys.waitFor ($bottom);
         
         $arm.rotateOnce ('0 -90 0');
         $top.rotateOnce ('0 0 -90');
         sys.waitFor ($arm);

         // Should be centered here ... about to move left.
         
         $arm.rotateOnce ('0 -90 0');
         $top.rotateOnce ('0 0 -90');
         sys.waitFor ($arm);

         $rotator.rotateOnce ('0 360 0');
         $bottom.move (UP, 24);
         
         sys.waitFor ($bottom);

         sys.wait (0.5);

         $rotator.rotateOnce ('0 -360 0');
         $bottom.move (DOWN, 24);
         sys.waitFor ($bottom);
         
         $arm.rotateOnce ('0 90 0');
         $top.rotateOnce ('0 0 90');
         sys.waitFor ($arm);
      }

This is what I found from the level script.


doom3xbox

#7
I also read a bit of the script I used as an example, interesting.

I tried to enable weapons on the Monorail tram, but no lock, there is a snippet which states something about a radiant.

I even tried to remove the worker on the tram, but the level freezes a quarter of the way through.

Quotenamespace map_monorail
{
   #define TRAIN_SPEED 250
   #define CAGE_SPEED 150
   #define TRAIN_FINAL_SPEED 700
   #define   TRAIN_ANCHOR   monorail_anchor
   #define   TRAIN_BLINK      0.1
   #define TRAIN_BLINK2   0.1

   float   TURRETS_ACTIVE = 0;
   float   TRAIN_MOVING = 0;
   float   TRAIN_PHASE = 1;      //   1 = 1st stretch, 2 = 2nd stretch
   float   LLIGHT_STATE = 1;      //   1 = ON, 2 = OFF
   float   LIGHT_FADEIN_TIME = 8;
   float   LIGHT_FADEOUT_TIME = 0.05;
   float   GO_PATTERN_1 = TRUE;
   float   GO_PATTERN_3 = TRUE;
   float   gf_Site2_Warning = TRUE;
   float warning_speaker = 1;

   void loop_site2_warning()
   {
      while (gf_Site2_Warning)
      {
         sys.wait (60);
         if (gf_Site2_Warning == FALSE)
            return;
         sys.trigger ($speaker_site2_warning);
      }
   }

   void turret_active_speaker()
   {
      float   sound_length;

      while (warning_speaker == 1)
      {
         sound_length = $speaker_165.startSoundShader ("monorail_computer_turrets_on", SND_CHANNEL_VOICE2 );
         sys.wait (sound_length);
         if ( warning_speaker == 0)
            //thread turret_deactivate_speaker();
            return;
         sys.wait( 10 );
      }
   }

   void turret_deactivate_speaker()
   {
      $speaker_165.stopSound ( SND_CHANNEL_VOICE2, false );
      sys.wait (0.75);
      $speaker_165.startSoundShader("monorail_computer_turrets_off", SND_CHANNEL_VOICE2);
   }

   void activate_turret()
   {
      if (TURRETS_ACTIVE == 1)
         return;
         
      //sys.print (" !!!!!   ENTERING ACTIVATE_TURRETS()   !!!!!\n");
      $tunnel_anchor_1.rotate ('0 360 0');
      $light_tunnel_1.On();
      $light_tunnel_1_spin.On();
      sys.trigger ($monster_turret_1);
      sys.trigger ($turret_speaker);      
      TURRETS_ACTIVE = 1;
   }

   void deactivate_turret()
   {
      if ( TURRETS_ACTIVE == 1 )
      {
         //sys.print (" !!!!!   DEACTIVATING TURRETS   !!!!!\n");
         GO_PATTERN_1 = FALSE;
         GO_PATTERN_3 = FALSE;
         $security_light.setColor (0.5,0.5,0.5);

         $tunnel_anchor_1.rotate ('0 0 0');
         $light_tunnel_1.Off();
         $light_tunnel_1_spin.Off();
         sys.trigger ($monster_turret_1);
         sys.trigger ($turret_speaker);
         sys.trigger ($target_entity_setcolor_1);
         warning_speaker = 0;
         thread turret_deactivate_speaker();
         //will this remove the scanner beam???
         $bs1_start.remove ();
         $bs1_end.remove ();
         $bs2_start.remove ();
         $bs2_end.remove ();
         
      }
   }
   
   void pattern1()
   {
      float   x, y, i, tmp;
      entity   px, py;
      entity   ox, oy;
      vector   vec_ox, vec_oy;
      
      while (GO_PATTERN_1)
      {
         for (i=1; i<=16; i++)
         {
            tmp = ( i + 4 );
            y=tmp;
            if ( (i+4) > 16 )
               y = (i+4) - 16;
            
            x=i;
            //sys.print ("x=" + x + " :: y=" + y + "\n");
            
            ox = sys.getEntity ("fp" + i);
            oy = sys.getEntity ("fp" + y);
            
            vec_ox = ox.getOrigin();
            vec_oy = oy.getOrigin();
            
            sys.trigger ($bs1_start);      // Turn off
            
            $bs1_start.setOrigin (vec_ox);
            $bs1_end.setOrigin (vec_oy);
            
            sys.trigger ($bs1_start);      // Turn on
            sys.wait (TRAIN_BLINK);
            sys.trigger ($bs1_start);      // Make sure we turn off the last beam
         }
      }   
   }

   void pattern3()
   {
      float   x, y, i, tmp;
      entity   px, py;
      entity   ox, oy;
      vector   vec_ox, vec_oy;
      
      while (GO_PATTERN_3)
      {
         // -- Horizontal Movement   
         ox = sys.getEntity ("fp1");
         oy = sys.getEntity ("fp12");
         
         vec_ox = ox.getOrigin();
         vec_oy = oy.getOrigin();
         
         sys.trigger ($bs2_start);   // Turn off
         
         $bs2_start.setOrigin (vec_ox);
         $bs2_end.setOrigin (vec_oy);
         
         sys.trigger ($bs2_start);   // Turn On
         
         sys.wait (TRAIN_BLINK2);
         
         ox = sys.getEntity ("fp2");
         oy = sys.getEntity ("fp11");

         vec_ox = ox.getOrigin();
         vec_oy = oy.getOrigin();
         
         sys.trigger ($bs2_start);   // Turn off
         
         $bs2_start.setOrigin (vec_ox);
         $bs2_end.setOrigin (vec_oy);
         
         sys.trigger ($bs2_start);   // Turn On
         
         sys.wait (TRAIN_BLINK2);

         ox = sys.getEntity ("fp3");
         oy = sys.getEntity ("fp10");

         vec_ox = ox.getOrigin();
         vec_oy = oy.getOrigin();
         
         sys.trigger ($bs2_start);   // Turn off
         
         $bs2_start.setOrigin (vec_ox);
         $bs2_end.setOrigin (vec_oy);
         
         sys.trigger ($bs2_start);   // Turn On
         
         sys.wait (TRAIN_BLINK2);
         
         ox = sys.getEntity ("fp4");
         oy = sys.getEntity ("fp9");

         vec_ox = ox.getOrigin();
         vec_oy = oy.getOrigin();
         
         sys.trigger ($bs2_start);   // Turn off
         
         $bs2_start.setOrigin (vec_ox);
         $bs2_end.setOrigin (vec_oy);
         
         sys.trigger ($bs2_start);   // Turn On
         
         sys.wait (TRAIN_BLINK2);
         
         // -- Vertical Movement         

         ox = sys.getEntity ("fp16");
         oy = sys.getEntity ("fp5");

         vec_ox = ox.getOrigin();
         vec_oy = oy.getOrigin();
         
         sys.trigger ($bs2_start);   // Turn off
         
         $bs2_start.setOrigin (vec_ox);
         $bs2_end.setOrigin (vec_oy);
         
         sys.trigger ($bs2_start);   // Turn On
         
         sys.wait (TRAIN_BLINK2);
         
         ox = sys.getEntity ("fp15");
         oy = sys.getEntity ("fp6");

         vec_ox = ox.getOrigin();
         vec_oy = oy.getOrigin();
         
         sys.trigger ($bs2_start);   // Turn off
         
         $bs2_start.setOrigin (vec_ox);
         $bs2_end.setOrigin (vec_oy);
         
         sys.trigger ($bs2_start);   // Turn On
         
         sys.wait (TRAIN_BLINK2);

         ox = sys.getEntity ("fp14");
         oy = sys.getEntity ("fp7");

         vec_ox = ox.getOrigin();
         vec_oy = oy.getOrigin();
         
         sys.trigger ($bs2_start);   // Turn off
         
         $bs2_start.setOrigin (vec_ox);
         $bs2_end.setOrigin (vec_oy);
         
         sys.trigger ($bs2_start);   // Turn On
         
         sys.wait (TRAIN_BLINK2);
         
         ox = sys.getEntity ("fp13");
         oy = sys.getEntity ("fp8");

         vec_ox = ox.getOrigin();
         vec_oy = oy.getOrigin();
         
         sys.trigger ($bs2_start);   // Turn off
         
         $bs2_start.setOrigin (vec_ox);
         $bs2_end.setOrigin (vec_oy);
         
         sys.trigger ($bs2_start);   // Turn On
         
         sys.wait (TRAIN_BLINK2);
      }      
      sys.trigger ($bs2_start);      // Turn the last one off
   }

   void train_proceed()
   {
      TRAIN_MOVING = 3;
/*
      $TRAIN_ANCHOR.speed (TRAIN_FINAL_SPEED);
      $TRAIN_ANCHOR.accelTime (8);
      $TRAIN_ANCHOR.decelTime (0);
*/
      $rd_1_1.close();
      $rd_3_1.close();            

      $TRAIN_ANCHOR.time (20);
      $TRAIN_ANCHOR.accelTime( 10 );
      $TRAIN_ANCHOR.decelTime( 0 );

      //$player1.enableWeapon();
      
      $TRAIN_ANCHOR.startSpline( $spline2 );

      sys.trigger ($movement_speaker);      // Turn movement speaker on
      sys.trigger ($squeal_speaker);         
      
      sys.waitFor ($TRAIN_ANCHOR);

      //$player1.enableWeapon();
      
      sys.trigger ($squeal_speaker);
      sys.trigger ($movement_speaker);      // Turn movement speaker off
      
      TRAIN_MOVING = 4;
   }

   // FIXME: This does not work at all. Cannot hide the monorail rider...
   void swap_trainzombie()
   {
      $monorail_rider.hide();
      $monorail_rider.remove();
      sys.trigger ($monorail_zombie);
   }

   void bind_objects()
   {

   }

   void init_world()
   {
      float   i;
      float   j;
      entity   ent;

      float   ftemp;
      // Disable all the airlock doors for the monorail tracks
      for (i=1; i<=12; i++)
      {
         for (j=1; j<=3; j++)
         {
            ent = sys.getEntity ( "d" + i + "_" + j );
            ent.disable();
         }
      }

      $d11a_1.disable();
      $d11a_2.disable();
      $d11a_3.disable();

      $d12a_1.disable();
      $d12a_2.disable();
      $d12a_3.disable();

      $TRAIN_ANCHOR.speed (TRAIN_SPEED);
      
      //$rot1.time ( CalcTimeForRotationAroundEntity( 1576, 90, TRAIN_SPEED) );
      //$rot2.time ( CalcTimeForRotationAroundEntity( 1576, 90, TRAIN_SPEED) );

      $ld_1_1.disable();
      $ld_1_2.disable();
      $ld_2_1.disable();
      $ld_2_2.disable();
      $ld_3_1.disable();
      $ld_3_2.disable();
      $ld_4_1.disable();
      $ld_4_2.disable();

      $rd_1_1.disable();
      $rd_1_2.disable();
      $rd_2_1.disable();
      $rd_2_2.disable();
      $rd_3_1.disable();
      $rd_3_2.disable();
      $rd_4_1.disable();
      $rd_4_2.disable();

      $indoor_3.disable();      //Opened up by a script later on...
      $indoor_4.disable();      //^---- Yeah, what he said...

      $ld_1_1.open();
      //$ld_3_1.open();      //As per discussion with Tim, lets leave the back doors locked.

      //$light1_green.Off();
      $boomlight.Off();
      $boomlight2.Off();
      $boomlight3.Off();
      
      $light_tunnel_1.Off();
      $light_tunnel_1_spin.Off();
      
      //hide door clips at start of map
      $doorclip_rightFront.hide();
      $doorclip_leftFront.hide();
      $doorclip_rightRear.hide();
      $doorclip_leftRear.hide();
   }

   void fadein_lights()
   {
      entity   ent;
      float   i;
      
      for (i=1; i<=10; i++)
      {
         ent=sys.getEntity ("llight_" + i);
         ent.fadeInLight (LIGHT_FADEIN_TIME);
         
         ent=sys.getEntity ("rlight_" + i);
         ent.fadeInLight (LIGHT_FADEIN_TIME);

         ent=sys.getEntity ("alight_" + i);
         ent.fadeInLight (LIGHT_FADEIN_TIME);
      
         ent=sys.getEntity ("tlight_" + i);
         ent.fadeInLight (LIGHT_FADEIN_TIME);
      }
      
      $last_extralight.fadeInLight (LIGHT_FADEIN_TIME);

   }

   void toggle_llights()
   {
      entity   ent;
      float   i;
      
      for (i=1; i<=10; i++)
      {
         ent=sys.getEntity ("llight_" + i);
         if (LLIGHT_STATE == 1)
            ent.Off();
         else
            ent.On();
         
         ent=sys.getEntity ("rlight_" + i);
         if (LLIGHT_STATE == 1 )
            ent.Off();
         else
            ent.On();

         ent=sys.getEntity ("alight_" + i);
         if (LLIGHT_STATE == 1)
            ent.Off();
         else
            ent.On();

         ent=sys.getEntity ("tlight_" + i);
         if (LLIGHT_STATE == 1)
            ent.Off();
         else
            ent.On();
      }
      
      if (LLIGHT_STATE == 1)
      {
         $TRAIN_ANCHOR_flare_0.hide();
         $TRAIN_ANCHOR_flare_2.hide();
         $TRAIN_ANCHOR_flare_3.hide();
         $TRAIN_ANCHOR_flare_4.hide();
      }
      else
      {
         $TRAIN_ANCHOR_flare_0.show();
         $TRAIN_ANCHOR_flare_2.show();
         $TRAIN_ANCHOR_flare_3.show();
         $TRAIN_ANCHOR_flare_4.show();
      }

      if ( LLIGHT_STATE == 1)
      {
         LLIGHT_STATE = 0;
      }
      else
         LLIGHT_STATE = 1;
   }

   void thud_1()
   {
      sys.trigger ($tspeaker);
      //toggle_llights();
      sys.fadeOut ('0 0 0', LIGHT_FADEOUT_TIME);
      sys.wait (0.5);
      sys.fadeIn ('0 0 0', LIGHT_FADEOUT_TIME);
      //toggle_llights();
   }

   void thud_2()
   {
      sys.trigger ($tspeaker_1);
      //toggle_llights();
      sys.fadeOut ('0 0 0', LIGHT_FADEOUT_TIME);
      sys.wait (0.5);
      sys.fadeIn ('0 0 0', LIGHT_FADEOUT_TIME);
      //toggle_llights();
   }

   //After the train crashes, we need to hide stuff and pop in alternate models
   void hide_train()
   {
      sys.trigger ($inside_ambience);   // Turn it off
      sys.trigger ($xian_speaker_2);   // This one too...
      
      $movement_speaker.remove();
      $squeal_speaker.remove();
      
      //sys.trigger ($movement_speaker); // Can't forget this one either...
      
      sys.trigger ($train_burning);   // Turn on flame sounds
      sys.trigger ($train_burning2);   // Turn on flame sounds

      $bm_monorail.remove();

      $ld_1_1.hide();
      $ld_1_2.hide();
      $ld_2_1.hide();
      $ld_2_2.hide();
      $ld_3_1.hide();
      $ld_3_2.hide();
      $ld_4_1.hide();
      $ld_4_2.hide();
      
      sys.wait (0.05);
      
      $rd_1_1.hide();
      $rd_1_2.hide();
      $rd_2_1.hide();
      $rd_2_2.hide();
      $rd_3_1.hide();
      $rd_3_2.hide();
      $rd_4_1.hide();
      $rd_4_2.hide();
      
      sys.wait (0.05);
      
      $xtlight_1.remove();
      sys.wait (0.05);
      $xtlight_2.remove();
      sys.wait (0.05);
      $xtlight_3.remove();
      sys.wait (0.05);
      $xtlight_4.remove();
      
      sys.wait (0.05);
      
      $ilight_1.remove();
      sys.wait (0.05);
      $ilight_2.remove();
      sys.wait (0.05);
      $ilight_3.remove();
      sys.wait (0.05);
      $ilight_4.remove();

      sys.wait (0.05);

      $intlight_1.remove();
      sys.wait (0.05);
      $intlight_2.remove();
      sys.wait (0.05);
      $intlight_3.remove();

      sys.wait (0.05);

      $indoor_3.hide();
      sys.wait (0.05);
      $indoor_4.hide();
      
      $monobox_1.hide();
      $monobox_2.hide();
      $monobox_3.hide();
      
      $fire_particle_1.show();
      $fire_particle_2.show();
      $fire_particle_3.show();
      $monorail_debris_1.show();
      $monorail_debris_2.show();
      sys.trigger ($fire1_paintrigger);
   }

   void thud_crash()
   {
      sys.trigger ($crash_speaker);
      sys.fadeOut ('0 0 0', 0.05);
      //toggle_llights();
      //$last_extralight.Off();
      //$last_extralight_1.Off();
      sys.wait (2);
      
      //swap out broken airlock door and overhead light
      $crashdoor_broken.show();
      $crashdoor_left.hide();
      $crashdoor_middle.hide();
      $crashdoor_right.hide();
      $crashsite_light_on.hide();
      $crashsite_light_damaged.show();
      
      sys.trigger ($door_spark1);
      sys.trigger ($door_spark2);
      sys.trigger ($door_spark3);
      sys.trigger ($door_spark4);
      sys.trigger ($door_spark5);
      
      
      $track.hide();
      sys.wait (0.1);
      $broke_1.show();
      sys.wait (0.1);
      //$broke_2.show();
      //sys.wait (0.1);

      sys.trigger ($crash_destination);      // Lets get the player out of the train.

      hide_train();

      $boomtrain.show();
      $boomlight.On();
      $boomlight2.On();
      $boomlight3.On();
      sys.wait(2);
      //fadein_lights();
      sys.fadeIn ('0 0 0', LIGHT_FADEIN_TIME);
      sys.wait (9);
      sys.trigger ($speaker_track_malfunction);
   }


   void open_d1()
   {   $d1_1.open();   }

   void close_d1()
   {   $d1_1.close();   }

   void open_d2()
   {   $d2_1.open();   }

   void close_d2()
   {   $d2_1.close();   }

   void open_d3()
   {   $d3_1.open();   }

   void close_d3()
   {   $d3_1.close();   }

   void open_d4()
   {   $d4_1.open();   }

   void close_d4()
   {   $d4_1.close();   }

   void open_d5()
   {   $d5_1.open();   }

   void close_d5()
   {   $d5_1.close();   }

   void open_d6()
   {   $d6_1.open();   }

   void close_d6()
   {   $d6_1.close();   }

   void open_d7()
   {   $d7_1.open();   }

   void close_d7()
   {   $d7_1.close();   }

   void open_d8()
   {   $d8_1.open();   }

   void close_d8()
   {   $d8_1.close();   }

   void open_d9()
   {   $d9_1.open();   }

   void close_d9()
   {   $d9_1.close();   }

   void open_d10()
   {   $d10_1.open();   }

   void close_d10()
   {   $d10_1.close();   }

   void open_d11()
   {   $d11_1.open();   }

   void close_d11()
   {   $d11_1.close();   }

   void open_d11a()
   {   $d11a_1.open();   }

   void close_d11a()
   {   $d11a_1.close();   }

   void open_d12()
   {   $d12_1.open();   }

   void close_d12()
   {   $d12_1.close();   }

   void open_d12a()
   {   
      $d12a_1.open();
      sys.trigger ($speaker_brakesqueal);
   }

   void close_d12a() {   
      $d12a_1.close();   }

   void open_d105() {
      $d105_1.open();
   }

   void close_d105() {
      $d105_1.close();   
   }

   void open_d106() {
      $d106_1.open();
   }

   void close_d106() {
      $d106_1.close();   
   }


   void reset_door()
   {
      //$light1_green.setColor ();
      //$light1_yellow.setColor ()
      //$light1_red.setColor();

      $light1_red.setColor (0.168627, 0.000000, 0.000000);
      $light1_yellow.setColor (0.819608, 0.792157, 0.070588);
      sys.wait (0.5);

      $light1_yellow.setColor (0.160784, 0.152941, 0.011765);
      $light1_green.setColor (0.105882, 0.898039, 0.184314);

      sys.wait (0.5);

      sys.trigger ($speaker_overide);

      sys.trigger ($unlock_objective);
      gf_Site2_Warning = FALSE;         // Stop playing the warning loop if they have
                                          // been in the area for longer than 60 seconds
      sys.trigger ($monorail_gui);         // Trigger the gui to resume operation
      TRAIN_MOVING = 2;
      
      $rd_1_1.open();
      $rd_3_1.open();
      
      //turn on trigger for tram rider swap with gibs
      sys.trigger ($trigger_once_28);
   }

   void move_train()
   {
      /*
         State is 0 upon loading the level
         State is 1 when it's travelling along the first stretch
         State is 2 after the button is pressed to open the two blocked doors
         State is 3 after the train resumes the last leg of it's trip
      */
      
      if (TRAIN_MOVING == 1) return;

      if (TRAIN_MOVING == 2)
      {
         train_proceed();
         return;
      }
      
      $ld_1_1.close();
      //$ld_3_1.close();//already closed
      $rd_3_1.close();
      //turn on door player clips
      $doorclip_rightFront.show();
      $doorclip_leftFront.show();
      $doorclip_rightRear.show();
      $doorclip_leftRear.show();
      sys.waitFor ($ld_1_1);//changed from 3_1 to 1_1
      
      sys.wait (1);
      
      $TRAIN_ANCHOR.time (70);
      
      $TRAIN_ANCHOR.accelTime( 3 );
      $TRAIN_ANCHOR.decelTime( 3 );
      
      //$player1.enableWeapon(); //changed to target_enableweapons in radiant
      
      $TRAIN_ANCHOR.startSpline ( $spline1 );
      $TRAIN_ANCHOR.removeInitialSplineAngles();
      TRAIN_MOVING = 1;
      
      //trigger sounds
      sys.trigger ($movement_speaker);
      sys.trigger ($squeal_speaker);
      sys.waitFor ($TRAIN_ANCHOR);
      //trigger sounds
      sys.trigger ($steamchuff);
      sys.trigger ($squeal_speaker);
      sys.trigger ($movement_speaker);
      
      //hide door clips after train reaches site2 dock
      $doorclip_rightFront.hide();
      $doorclip_leftFront.hide();
      $doorclip_rightRear.hide();
      $doorclip_leftRear.hide();
      
      //$player1.enableWeapon(); //changed to target_enableweapons in radiant
      $rd_1_1.open();
      sys.wait (3);
      sys.trigger ($item_objective_5);   // Trigger the objective after the train stops.
   }

   void close_tram_doors()
   {
      $rd_1_1.close();
      $rd_3_1.close();
   }
   
   //void open_tram_doors()
   //{
   //   $rd_1_1.open();
   //   $rd_3_1.open();
   //}

   void squeal_monorail()
   {
      sys.trigger ($squeal_stop_speaker);
   }
   void voc_1()
   {
      sys.trigger ($speaker_voc1);
   }
   void voc_2()
   {
      sys.trigger ($speaker_voc2);
   }
   void voc_3()
   {
      sys.trigger ($speaker_voc3);
   }
   void voc_4()
   {
      sys.trigger ($speaker_voc4);
   }
   void voc_5()
   {
      sys.trigger ($speaker_voc5);
   }
   void voc_6()
   {
      sys.trigger ($speaker_voc6);
   }
   void voc_7()
   {
      sys.trigger ($speaker_voc7);
   }
   void voc_8()
   {
      sys.trigger ($speaker_voc8);
   }
   void voc_evil()
   {
      sys.trigger ($speaker_chant);
   }
   // Simplified version of Matt's E3_2 Machine
   void spawn_exit()
   {
      if ( TRAIN_MOVING == 2 )
      {
         sys.trigger ($monster_demon_trite_1);
         sys.trigger ($monster_demon_trite_2);
      }   
   }

   void matt_mover()
   {
      $arm.time (1);
      $top.time (0.75);
      $bottom.time (0.5);
      
      while (1)
      {
         // Should be centered here - Moving right next...
         $arm.rotateOnce ('0 90 0');
         $top.rotateOnce ('0 0 90');
         sys.waitFor ($arm);

         $rotator.rotateOnce ('0 360 0');
         $bottom.move (UP, 24);
         
         sys.waitFor ($bottom);
         
         sys.wait (0.5);
      
         $rotator.rotateOnce ('0 -360 0');
         $bottom.move (DOWN, 24);
         sys.waitFor ($bottom);
         
         $arm.rotateOnce ('0 -90 0');
         $top.rotateOnce ('0 0 -90');
         sys.waitFor ($arm);

         // Should be centered here ... about to move left.
         
         $arm.rotateOnce ('0 -90 0');
         $top.rotateOnce ('0 0 -90');
         sys.waitFor ($arm);

         $rotator.rotateOnce ('0 360 0');
         $bottom.move (UP, 24);
         
         sys.waitFor ($bottom);

         sys.wait (0.5);

         $rotator.rotateOnce ('0 -360 0');
         $bottom.move (DOWN, 24);
         sys.waitFor ($bottom);
         
         $arm.rotateOnce ('0 90 0');
         $top.rotateOnce ('0 0 90');
         sys.waitFor ($arm);
      }
   }

   void cage_movement(entity ent)
   {
      //$rot1.time ( CalcTimeForRotationAroundEntity( 1576, 90, TRAIN_SPEED) );
      vector   vec;
      entity  cagepath;
      ent.time (CAGE_SPEED);
   }

   void activate_rider()
    {
      sys.trigger ($monorail_monster_zombie_commando_26);
      sys.wait(.1);
      $indoor_3.open();               // Open the door so we can see the monorail rider.
      $indoor_4.open();      
   }

   void cache_sounds() {
      $speaker_165.cacheSoundShader ("monorail_computer_turrets_on");
      $speaker_165.cacheSoundShader ("monorail_computer_turrets_off");
   }
   
   void main()
   {
      cache_sounds();
      bind_objects();
      init_world();
      thread pattern1();
      thread pattern3();
      thread matt_mover();
   }
}

I even tried adding a monster_zombie_commando_26 to replace the rider, the trigger is still in the tram, but not the rider as I deleted it from the map.

doom3xbox

#8
Also, not that important, sorry for double posting again.

I noticed that the xbox copy of the tram light must clearly have a 104 missing for light radius. As in the pc its a nine number value for the central part of it on the map.

I guess another attempt to see how to get the tram to stop somewhere along the way to site 2. That would be in the gui file, I imagine. In this script above it does mention some control over the tram, speed and movement direction.

I did eit the trigger which is front of the doors, could be that the commando must be where the monorider was standing for the whole script to read.

Its clearly the monster addin that causes the tram not to go any further beyond the first outside and then inside corner and then stop there. The tram is still bouncing a bit as it was moving with the gui running the map. The doors remain close.

Another discovery, the monoridetrigger

I've seen more to it, I've deleted all the pieces that were linked to the rider. So I guess the tram should get to its destination...

Update, now the rider is there, along with the monster_commando_26. I've deleted all the pieces that could of given the rider function. I also noticed some strange stiff of a figure at the back of the tram that doesn't appear. Almost sitting on the floor.

The tram stops a little earlier as it enters the first right turn on the line.

aphexjh

 
changing this:
//$player1.enableWeapon();
to this:
$player1.enableWeapon();

should enable weapons, but I can't tell from your description if you tried this already.

Scripts and editor objects (like triggers, relays, npcs) work in parallel, and often have a lot of interdependence. If you remove things from the editor, which are referred to in script, that will cause the script to stop working.

here is another link to some useful scripting information: http://wiki.thedarkmod.com/index.php?title=Scripting_basics

Triggering an enemy to emerge from a door shouldn't be too difficult and wouldn't require any scripting.

doom3xbox

#10
Some good news, that made it possible for the player to use fists. How ever no gun.

The monster_commando as idle is animated in the back, and the rider is sitting as if he'd finished talking.

The doors still won't open. They've only open with the rider as obvious, when I first placed Bernie it attacked the player when approached. But no running to the player.

From what I can see, the enemy at the end of the monorail map clearly has coordinates to attack once the player approaches the door. Once the player gets of the tram, the doors close so that the player can't hide in the tram for cover.

Unfortunately, the webpage information are not helpful for me.

Update, good news again, so fists, and the tram now gets to its destination. I changed the keyname on the trigger, that had to of been it, to the name I had typed up in the script.

anim was set to only if triggered the monster will spawn to look for the player, but that to even happen, the doors would of need to of opened.

doom3xbox

As to why only fists are available, could be that enableweapon by default is just that, must the actual keynames for the other weapons be place in the script to work on the tram?

doom3xbox

   void main()
   {
      cache_sounds();
      bind_objects();
      init_world();
      thread pattern1();
      thread pattern3();
      thread matt_mover();
   }

Well these are like variable declarations.

I set the daemon to ambush from previously being teleport which is suppose to appear once insight of the player and removed one of the tram doors, it attacks. How ever it freezes again a quarter of the way.

So when it isn't there and doors are there, the tram gets to its destination. Get the enemy there, and its a repeat like it was the first time.

Quotevoid activate_monster_zombie_commando_26()
    {
      sys.trigger ($monorail_monster_zombie_commando_26);
      sys.wait(.2);
      $indoor_3.open();               // Open the door so we can see the monorail monster.
      $indoor_4.open();

This and the door

I honestly, can't workout how this could work.  ::)

doom3xbox

#13
In addition to this experimental edit. Even if the doors do open, that doesn't change the fact that the daemon is the problem as to why the tram doesn't keep going.

I also noticed prior to joining, when I was on Doomforums, there was no actual topic about the Monorail. And when I did search for some modifications none have actually used the tram?

I guess I'm correct?

What I've found interesting about this monorail map and script is the fact that more was planned than ended up in the final release. Sure wouldn't mind getting that tram beyond that area that is blocked!

Perhaps this edit is merely more than a bit of script editing and mapping changes..it may be beyond my initial impression.

My modification inspiration came from the Monorail map, my plan was to use it to travel to Delta 4 and that was that, while taking a few other maps and connecting it with the monorail map. I never intended to use the monorail for anything just as the level works originally.

doom3xbox

Just as a test, I had removed the doors from the script, only for them to close once the tram was operated.

I had also tried a trigger_once_entity, so replace trigger_once_player1 I added that to here in the script, and that was hasn't work. Once the player1 walks into the tram, the trigger where the doors should close them. Unless I must add this elsewhere the sys.trigger part.

void close_tram_doors()
   {
      $rd_1_1.close();
      $rd_3_1.close();
             sys.trigger($trigger_once_player1);
   }