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

Members Online

»
0 Active | 158 Guests
Online:

LATEST FORUM THREADS

»
Mohaa maps on Cod2?
CoD2 MP Mapping
is this place alive?
CoDBO3 Mapping
Call of DutyŽ: WWII
CoD WW2 General

Tutorials

»
CoD Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Adding a Vehicle with AI to Your SP Map
Versions: You must be logged in to view history.
In this tutorial we will add a german truck,with guys in it ,that moves.
ADDING A GERMAN TRUCK WITH GUYS TO YOUR SINGLE PLAYER MAP
---------------------------------------------------------

Tutorial written by BODGER2

SPECIAL THANKS TO MY BROTHER BDBODGER, WHO FIGURED OUT HOW TO DO THIS.

In this tutorial we will add a german truck,with guys in it ,that moves.
The truck has sound,treads, and will blow up when shot with the panzerfaust.
When the truck reachs the end of it's path the guys will jump out.

So here we go

Step 1:Create a SCRIPT_VEHICLE
------------------------------
Right click in 2d view and select SCRIPT/VEHICLE

Give it these KEYS & VALUES

KEY:classname VALUE:script_vehicle
KEY:model VALUE:xmodel/vehicle_german_truck
KEY:vehicletype VALUE:GermanFordTruck
KEY:script_vehiclegroup VALUE:1


Step 2:Create INFO VEHICLE NODES
--------------------------------
Right click in 2d view and select INFO/VEHICLE_NODE

Check the first "info vehicle node" as the START NODE(KEY:spawnflags VALUE:1)
You can set other KEYS & VALUES for speed and lookahead,speed 10 seems to be a good speed.

Add more "info vehicle node" to create a path,DO NOT check them as start nodes.(2 nodes as min for a path,more is ok)

Use "info vehicle node rotate" nodes to make the truck turn on its path.
(eg> KEY:angle VALUE:0 225 0)


Step 3:Connect the truck to the nodes
-------------------------------------
Select the TRUCK then select the first node,the START NODE,then hit CTRL+K.
This will connect the two enities,and auto generate a targetname for the node.

Now select start node and then select the next node in the path,then hit CTRL+K.
And so on,till you get to the end of the path.


Step 4:Create guys to man the truck
-----------------------------------
Right click in 2d view and select ACTOR/any axis model

Give him these KEYS & VALUES

KEY:script_vehiclegroup VALUE:1
KEY:spawnflags VALUE:3 (do this by checking the checkboxs in the entity window,SPAWNER and FORCESPAWN)
KEY:targetname VALUE:truckguys

You can have UP TO 9 guys in the truck,inclueding the driver.
SO clone the first guy a few more times,they all have the same targetname.

Now make one of the guys the driver,select one of them and change his targetname to driver.

Place them near the truck,you don't connect them to anything the script takes care of that.

-----------------------------------------------------------------------------------------------------------------
!!!IMPORTANT,WHEN USING SPAWNERS THE PLAYER SHOULD NEVER BE ABLE TO SEE THE SPAWN POINT,OR THEY WILL NOT SPAWN!!!
-----------------------------------------------------------------------------------------------------------------

STEP 5:CREATE A TRIGGER (This step is not neccessary,but it is the best way to do things)

Make a brush and give it the trigger texture.
With the brush selected,right click in the 2D view and select TRIGGER/MULTIPLE

Give the trigger this KEY & VALUE

KEY:targetname VALUE:truck_trigger


Step 6:Connect the trigger to the truck
---------------------------------------

Select the trigger then select the truck and hit CTRL+K to connect them.


******************************
THATS IT FOR THE MAPPING PART.
******************************


Now for the SCRIPTING part

Create a .GSC file for your map,name it with the same name as your map.
Place it in the maps folder along with the BSP file.

-------------------
Here is the script:
-------------------

main()
{
maps_load::main();//loads all global scripts
maps_truck::main();//this precaches models and loads effects

//GIVE PLAYER WEAPONS
level.player takeallweapons();
level.player giveWeapon("panzerfaust");//so you can shoot the truck
level.player giveWeapon("thompson");
level.player giveWeapon("colt");
level.player giveWeapon("fraggrenade");
level.player switchToWeapon("thompson");

//TRUCK
trucktrig = getent ( "truck_trigger","targetname");//don't need this if you have no trigger
trucktrig waittill ("trigger");//don't need this if you have no trigger

truck = getent ( "truck1","targetname");
path = getVehicleNode (truck.target,"targetname");
truck attachpath(path);
truck maps_truck::init();
truck maps_truck::attach_guys();
truck startPath();
truck waittill ("reached_end_node");
truck notify ("unload");
}
//END OF MAIN BODY


--------------------
This is just a simple script,if you are doing other things in your script ,where you place lines can effect things.So if you are getting errors,you probably put a line in the wrong place.This script has been tested and does work.

You can get the goods in the downloads section
here

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

»