Skip Navigation
Resources
Group Information

Simple Scriptmover(part2:tank)

With our path mapped out we can now focus on what is going to move along it and how we want to move it. This part will get you to create the mover's brushwork and make a script that it can use.

Creating the tank's brushwork

  1. Import a .md3 model file which you will use as your script mover. For me i'm going to use the Jagdpanther that is in goldrush. Right click on main window, goto misc > misc_gamemodel. The Jagdpanther is located in ../etmain/models/tanks_sd/jagdpanther_africa_shell.md3, you might notice the jagdpanther is not in the tanks_sd folder when you try to find it, that is because Radiant hasn't installed the tank. However if you use winzip and open up pak0 in the etmain directory, it will be located there, along with many other models. So click cancel in the dialog screen, open up the entity window (n), and type in key model , value models/tank_sd/jagdpanther_africa_shell.md3. Press Enter, exit the entity window and you will see the tank(notice there is no need to include the path before the models folder).

    part2_pic_01

  2. Import the tank turret as an gamemodel located in models/mapobjects/tanks_sd/jagdpanther_africa_turret.md3, then the wheels, models/mapobjects/tanks_sd/jagdpanther_africa_tracks.md3. Try to place the models as precisely as you can to where they would appear on the tank.
  3. Now we are going to create a clip of tank which consists of brushes in the shape of the tank. We will use the previously imported models as a guide for our brushes. First load up the common textures and select clipweap_metal. Now create 2 brushes for the body of the tank, use one for the front half and the other for the back, then using the clipper tool to cut the angles of the body. You don't have to be too precise with the clip just make sure it resembles the shape of the model. Next create two brushes one for each track, then finally a brush for the turret.

    p2_pic_02

  4. Next we are going to add an origin brush which the mover uses to follow the spline path. In the texture window select the origin texture then where u see a cross inbetween the tank's wheels create a brush that is 16x16x16 units.

    p2_pic_03

  5. Now select and delete the tank's track model. Next select the tank's body model, open up the entity window and give it the following values.
    Key targetname value tank_shell
    Key scriptname value tank_shell.
    Close the entity window, deselect the body then select the turret model. Open the entity window and give it the following,
    key targetname value tank_turret
    key scriptname value tank_turret.
    You can move the two models away from the clip to make it less cluttered if you want to.
    p2_pic_02b

  6. Exit the entity window, deselect any models and select all the clip brushes and the origin brush then right click on the main window, goto script > script_mover. Open the entity window and give insert the fllowing,
    key targetname value tank
    key scriptname value tank
    key model2 value models/tank_sd/jagdpanther_africa_tracks.md3
    Tick the checkbox solid then exit the entity window.

    p2_pic_04

  7. Lastly we have to add an script_multiplayer which triggers a script to be run when the map is loaded. Right click in the main window, goto script > script_multiplayer. Then go into the entity window and give the key scriptname the value game_manager.
Creating a script for the tank
  1. Using notepad or a text editor create a script file in the etmain/maps directory named [mymapname].script .
  2. Copy the following script into notepad, any lines with // are annotations that are not read by the game.

    game_manager //this is triggered by the script multiplayer in your map
    {
     spawn
     {
      wait 200
     }
    }
    tank //scriptname of script_mover
     {
     spawn
     {
      wait 300
      
      followspline 0 spl_01 50000 length 32 wait //spawn the tank to here

      trigger self tank_path //goto tank_path
     }

     trigger tank_path
     {
      //here is the commands the mover will follow

      stopsound
      playsound sound/vehicles/tank/tank_move.wav looping volume 512
      //play a tank sound
      followspline 0 spl_01 100 wait length 304
      //this says goto spl_01 at a speed of 100 and don't look at
      //the next command until after waiting 304
      followspline 0 spl_02 100 wait length 304
      followspline 0 spl_03 100 wait length 304
      followspline 0 spl_04 100 wait length 304
      followspline 0 spl_05 100 wait length 304
      followspline 0 spl_06 100 wait length 304
      followspline 0 spl_07 100 wait length 304
      followspline 0 spl_08 100 wait length 304
      //add more lines for how many more splines u have
      //notice that you don't include scripting for spline controls

      trigger self tank_path
      //repeat tank_path part of the script, remove this line
      //if u don't won't it to loop
     }
    }
    tank_shell
    {
     spawn
     {
      wait 400
      attachtotag tank tag_tank
      //this attaches the tank_shell to the scriptmover tank
     }
    }
    tank_turret
    {
     spawn
     {
      wait 500
      attachtotag tank_shell tag_turret
      //this makes the turret attach to the tank_shell
     }
    }

  3. Finally compile your map, load up ET, and hopefully you will see a beautiful script mover.
  4. Here is a zip of the map and script. Also have a good look at the goldrush map and script to understand more and get ideas.


Problems, Comments, Queries > Forum

Tutorial by ausman
Surface mini-logo Surface mini-logo