Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 241 Guests
Online:

LATEST FORUM THREADS

»
New BF2 Mod
BF2 General

Tutorials

»
CoD4 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
How to spawn and move a M1A1 Abrams tank.
Versions: You must be logged in to view history.
I will explain to you how to spawn and move a tank.
For this tutorial I will be using the American main battle tank M1A1 Abrams.
In the future I will expand this tutorial, I just wanted to quickly show how to spawn a tank.
Spawning a tank is nothing special, you want it to aim at something and shoot or even blow up another vehicle with explosions and stuff - but that will come later!

Before we begin I assume you know how to make a basic map and how to compile it, if you don't then you shouldn't be reading this tutorial.

Step 1
Spawn the tank by rightclicking in your 2D grid and going to "script" -> "vehicle".
Now browse to your raw/xmodel folder and use the "vehicle_m1a1_abrams" model, do not use the one which has _static behind it.


Step 2
Position your tank, select it and press "N" - we need to a key/value for it:

KEY: vehicleType
VALUE: m1a1



Step 3
Now it's time to lay down a path that our tank will follow, this is identical to how you make paths for moving smaller vehicles like jeeps (check out my other tutorial on moving vehicles).
Create a vehicle node by rightclicking in your 2D grid and going to "info" -> "vehicle" -> "node"

Place the node infront of your tank, then press "N" and check the box "START_NODE" - this is where your tank will start moving.



Now deselect the node (press ESC) and select the tank, then select the node again and press "W" to connect them, a line should now appear indicating both are connected.

Step 4

Make a few more nodes to form your path, lets keep it simple by making it a straight path with no turns.
All the other nodes must NOT have the "START_NODE" box checked when you press "N", only the first node has this.
Once you have positioned all the nodes we must connect them.
Select the very first node we made (the start node), then select the second node and press "W" to connect them.
Now select the second node to the third, the third node to the fourth and so on untill all your nodes are connected.



Step 5

We need to give the nodes some key/values such as speed, this can be done easily by using the Vehicle Window.
Select all the nodes you used to make your path (not the tank!) and press "SHIFT+V"

On the bottom right you will see "Set Speed" - here you fill in "6", then click "Set Speed".
The window will automatically close, now open it again and set the lookahead to "1".

If you have done that correctly a line of red arrows will now appear along your path if one or more nodes are selected.

Step 6

Our last step in the editor is making a trigger to spawn the vehicle.
Before we do that however, don't forget to place a player spawn or you won't be able to play your map!
This can be done by rightclicking in your 2D grid and going to "info" -> "player_start", place it somewhere above the ground and make sure it's not touching anything.

We will spawn the tank through a trigger, make a trigger multiple by rightclicking in your 2D grid and going to "trigger" -> "multiple".
As soon as the player touches the trigger, the tank will spawn so put the trigger to where you want your tank to start moving etc.
I made my trigger around the player spawn, thus when the player spawns the tank will spawn with him instantly:



With the trigger selected, select the tank and press "W" to connect them.
With the trigger AND the tank selected, press "SHIFT+V" to open the Vehicle Window.
In the top left click on "Spawn Vehicle", the window will now close automatically.
Open the Vehicle Window again and now click on "Move Vehicle".

Step 7

That's everything we have to do in the editor!
Save your map and close Radiant, now make a .txt (text document) file and rename it to YOUR_MAP_NAME.gsc (change YOUR_MAP_NAME to the whatever your map name is - duh)
It will ask if you want to change the extension, say yes.
Now open your .gsc file in a texteditor (such as notepad) and copy this script into it:

#include common_scriptsutility;
#include maps_utility;

main()
{
 maps_m1a1::main( "vehicle_m1a1_abrams" );
 maps_load::main();
}


Save it and place the .gsc file in your maps folder located in: C:Program FilesActivisionCall of Duty 4 - Modern Warfarerawmaps

Step 8

Compile your map and run it, you will get several errors which have to do with missing zonefiles.
You can fix these by clicking on "4. Update Zonefile" in the compile tools, now you copy the following to the RIGHT SIDE of the zonefile:

weapon,sp/mp5
xmodel,weapon_mp5
xmodel,viewmodel_mp5
xanim,abrams_movement_backwards
xanim,abrams_movement
xmodel,vehicle_m1a1_abrams
fx,muzzleflashes/abrams_flash_wv
weapon,sp/m1a1_turret
xmodel,vehicle_m1a1_abrams_dmg
rawfile,shock/tankblast.shock
xmodel,vehicle_m1a1_abrams_PKT_Coaxial_MG
fx,muzzleflashes/mg42hv
material,gfx/icons/hud@mg42.tga
weapon,sp/m1a1_coaxial_mg
xmodel,viewmodel_base_viewhands
fx,distortion/abrams_exhaust
fx,dust/abrams_desk_dust
fx,explosions/large_vehicle_explosion

Once you've done that, click "Save" - in order for the changes to take effect you have to rebuild the fastfile, so click on "3. Build Fastfile"

You are now ready to run the map and see the tank move!



KNOWN ERROR:
In my other tutorial I noticed quite some people have the following error:
"Can't find vehicleinfo of vehicle type "m1a1"
Or something like that...
It can be fixed by running the converter, if you haven't done this then please do it or your vehicles won't work.
Go to the compiletools, click on the "Applications" tab and click "Run converter".

You will have 2 errors, ignore those.

Your map should work now.

If you still have errors please contact me on MSN or Xfire so I can help or if you want the map used in this tutorial:

Jeannotvb{at}hotmail{dot}com
Jeannotvb (X-fire)

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»