Ok this tutorial should explain how to add all kind of driving vehicles...
First of all add a
script_vehicle to your map. Give this vehicle the following keys/values:
CODE
script_team: allies/axis -- Determines wether this vehicle belongs to axis or allies side..
script_vehiclespawngroup: # -- Give a number, this is the spawngroup that this vehicle will be spawned together with.
script_vehicleride: # -- A number that specifies this vehicles special id, this is used when connecting actors to it.
model: -- This vehicles model, choose whatever you want, there is a table with lists at the bottom of this tutorial.
vehicletype: -- This vehicles vehicletype, should be specified according to which model is chosen. Look into table lower down on site :)
script_noteworthy: vehicle -- This can be anything, it just helps us identify the vehicle in the script.
Ok now time for actors, a vehicle can hold a special amount of actors (again look at table), you don't have to fill it up though.
Add an actor, that has the same team as you specified for your vehicle, and cross the spawner box. Now give the actor the following keys:
CODE
script_vehicleride: # -- This is used to connect the actor to the vehicle, and it has to be set to the same value as the actor.
script_startingposition: # -- A number that specifies where the actor is located in the vehicle, starting with driver as 0 (Which means the numbers to specify for a vehicle with 4 spaces for actors would be 0, 1, 2 and 3).
Add as many actors to your vehicle as you want to
Ok, now for making a path. Create a
vehicle_node somewhere on the map, and cross the box Start Node. For
vehicle_nodes you can look in radiant which keys/values you can add, but this start one we will give a
script_noteworthy value of "vehicle_start_path". Connect the
script_vehicle to this node using W.
Now create as many
vehicle_node, and
vehicle_node_rotate (Both located in info thingy) if you want it to turn, to create a path. Connect (Using W) them so the one where you crossed Start Node is the start of the path.
You are now done in Radiant, so create a yourmap.gsc file and let's do some scripting
Now we have to call a different kind of files, all according to which model you used, you can see further info about that in the table too The file is called like this:
CODE
maps\_file::main("model");
So if you for example used the model xmodel/vehicle_africa_jeep, then you can see in the table that you have to call _jeep.gsc and therefore the code should look like:
CODE
maps\_jeep::main("xmodel/vehicle_africa_jeep");
After this you will have to add a maps\_load::main(); as always, and then you cna go find your vehicle, find the start path node, spawn your vehicle and attach it to a path.
CODE
level.vehicle = getent("vehicle", "script_noteworthy");
path = getvehiclenode ("vehicle_start_path", "script_noteworthy");
maps\_vehicle::scripted_spawn(1); // Spawn the vehiclespawngroup number you want too, this for instance assumes that you set it to 1.
// Now attach the path
level.vehicle attachPath(path);
Ok, you now have your vehicle attached to the path, filled up with actors and ready to go, so what are we waiting for This is how you get your vehicle moving, and unload it when it has ended it's path.
CODE
level.vehicle startPath();
level.vehicle waittill("reached_end_node");
level.vehicle notify ("unload");
Now you have a moving vehicle, which unloads at the end of it's path, but it has no sound yet, for this we need to add soundaliases. So create a soundaliases folder in main folder, and in this create a file called yourmap.csv. This file must have the following header:
CODE
"# If the text in the first column of a row starts with a # character, the row is ignored",,"If the first column for a row is blank, then the row is ignored"
,"If the first column for a row is blank, then the row is ignored",
# The first non-comment line of a sound alias file specifies the key name for all values appearing in this column.,,
"# This means it is safe to swap entire columns around, though you should never swap partial columns.",,
"# You can invent new keys, but the game will ignore them if it doesn't know about them.",,
"# You can leave out keys, but the ""name"" and ""file"" keys must always be present.",,
,name,name of the alias that is used to play this sound (required)
,sequence,"used to uniquely identify alias entries when more than one sound goes to an alias, used only to catch unwanted duplicates (default = 0)"
,file,the name of the file that contains the sound data (required)
,vol_min,"0 is silent, 1 is full volume (default = 1)"
,vol_max,"0 is silent, 1 is full volume (default = same as vol_min)"
,vol_mod,"blank causes no effect on vol_min and vol_max, otherwise the string must match a string in the volumemodgroups.def file and the value in that file corresponding to that string will be used to adjust vol_min and vol_max, clamped to the valid range"
,pitch_min,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = 1)"
,pitch_max,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = same as pitch_min)"
,dist_min,"within this distance in inches, the sound is always full volume (default = 120)"
,dist_max,"outside this distance in inches, the sound is not started. If left blank or set to 0, the sound will play from any distance. This does not affect sound volume falloff.",,,,,,,,,,,,,,,,,,,,,
,channel,"auto, menu, weapon, voice, item, body, local, music, announcer (default = auto)",,,,,,,,,,,,,,,,,,,,,
,type,primed (a streamed sound which gets primed on some platforms) / streamed / loaded (default = loaded),,,,,,,,,,,,,,,,,,,,,
,probability,weight to use for the weighted probability of playing this sound instead of another sound (default = 1),,,,,,,,,,,,,,,,,,,,,
,loop,"whether this sound is ""looping"" or ""nonlooping"" (default = ""nonlooping"")",,,,,,,,,,,,,,,,,,,,,
,masterslave,"if ""master"", this is a master sound. If a number, then this sound's volume will be multiplied by that number (a percentage between 0 and 1) any master sound is playing. If blank, then neither master nor slave.",,,,,,,,,,,,,,,,,,,,,
,loadspec,"space-separated list of which maps should use this alias; eg, ""burnville dawnville"". If blank, the alias is used on all maps.",,,,,,,,,,,,,,,,,,,,,
,compression,"a string corresponding to an entry in ""XMAUpdate.tbl"" which is used to determine compression by XMAUpdate.exe",,,,,,,,,,,,,,,,,,,,,
,secondaryaliasname,"defined the name of an additional sound alias to play in addition to the current alias being played. Note that it is an error for the secondaryalias to also define a secondaryaliasname (eg, if B is a secondaryalias of A, B is not allowed to have its own secondaryalias).",,,,,,,,,,,,,,,,,,,,,
,volumefalloffcurve,if blank uses the linear curve which can not be changed. A string 'XXXX' corresponds to the curve defined by the file 'soundaliases/XXXX.vfcurve',,,,,,,,,,,,,,,,,,,,,
,startdelay,defaults to no delay. The value is the number of milliseconds to delay starting the sound by,,,,,,,,,,,,,,,,,,,,,
,speakermap,if blank uses the default speakermappings which cannot be changed. A string 'XXXX' corresponds to the speakermap defined by the file 'soundaliases/XXXX.spkrmap'. ,,,,,,,,,,,,,,,,,,,,,
,reverb,"blank means the alias is affected normally by wet and dry levels, ""fulldrylevel"" forces the alias to use a full drylevel (ignoring the global drylevel), ""nowetlevel"" forces the alias to use no wetlevel (ignoring the global wetlevel)",,,,,,,,,,,,,,,,,,,,,
,lfe percentage,this determines what percentage of the highest calculated spatialized speaker volume should be passed to the LFE. blank means no LFE for the sound,,,,,,,,,,,,,,,,,,,,,
name,sequence,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max
,channel,type,probability,loop,masterslave,loadspec,subtitle,compression,seconda
ryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage
null,,null.wav,,,,,,,,,,,,,,,,,,,
Now, all according to which vehicle you have added, you need to add different types of soundaliases, these should cover all, and remember to replace yourmapname with your map name:
CODE
#Halftrack,,,,,,,,,,,,,,,,,,,
#All kinds of halftrack
halftrack_idle_low,,vehicles/mrk_tank_03_idle.wav,0,,vehicle,0.85,,7,2500,auto,,,looping,,yourmapname,,,,weapon1,,,,
halftrack_idle_high,,vehicles/mrk_tank_03_idle.wav,0.3,,vehicle,1.35,,7,2500,auto,,,looping,,yourmapname,,,,weapon1,,,,
halftrack_engine_low,,vehicles/mrk_tank_03_move.wav,0,,vehicle,0.85,,7,9500,auto,,,looping,,yourmapname,,,,,,,,
halftrack_engine_high,,vehicles/mrk_tank_03_move.wav,0.6,,vehicle,1.35,,7,9500,auto,,,looping,,yourmapname,,,,,,,,
#Truck Sounds,,,,,vehicle,,,,,,,,,,
truck_idle_low,,vehicles/truck_idle.wav,0,,vehicle,0.75,,300,2000,auto,,,looping,,yourmapname
truck_idle_high,,vehicles/truck_idle.wav,1,,vehicle,1,,300,2000,auto,,,looping,,yourmapname
truck_engine_low,,vehicles/truck_move.wav,0,,vehicle,0.75,,700,5000,auto,,,looping,,yourmapname
truck_engine_high,,vehicles/truck_move.wav,1,,vehicle,1,,700,5000,auto,,,looping,,yourmapname
truck_horn,,vehicles/horn_beep.wav,1,1,vehicle,0.9,0.9,1500,,item,,,,,
truck_brakesqueal,,vehicles/truck_brakesqueal.wav,0.5,0.5,vehicle,0.9,0.9,150,5000,auto,streamed,,,,yourmapname
#Jeep Sounds,,,,,,,,,,,,,,,
#Kubelwagon only
kubel_idle_low,,null.wav,0,,vehicle,0.5,,150,2000,auto,,,looping,,yourmapname
kubel_idle_high,,null.wav,0,,vehicle,0.75,,150,2000,auto,,,looping,,yourmapname
kubel_engine_low,,vehicles/kubel_move.wav,0,,vehicle,0.5,,350,5000,auto,,,looping,,yourmapname
kubel_engine_high,,vehicles/kubel_move.wav,0.29,,vehicle,0.75,,350,5000,auto,,,looping,,yourmapname
kubel_start,,vehicles/kubel_start.wav,0.5,,vehicle,1,,350,5000,auto,streamed,,,,yourmapname
#Other jeeps
jeep_idle_low,,vehicles/kubel_idle.wav,0,,vehicle,0.5,,150,2000,auto,,,looping,,yourmapname
jeep_idle_high,,vehicles/kubel_idle.wav,0.4,,vehicle,0.75,,150,2000,auto,,,looping,,yourmapname
jeep_engine_low,,vehicles/kubel_move.wav,0,,vehicle,0.5,,350,5000,auto,,,looping,,yourmapname
jeep_engine_high,,vehicles/kubel_move.wav,0.4,,vehicle,0.75,,350,5000,auto,,,looping,,yourmapname
jeep_start,,vehicles/kubel_start.wav,0.5,,vehicle,1,,350,5000,auto,streamed,,,,yourmapname
#Buffalo,,,,,,,,,,,,,,,,,,,
buffalo_idle_low,,vehicles/mrk_tank_03_idle.wav,0.12,,vehicle,1.05,,7,2500,auto,,,looping,,yourmapname,,,,weapon1
buffalo_idle_high,,vehicles/mrk_tank_03_idle.wav,0.12,,vehicle,1.55,,7,2500,auto,,,looping,,yourmapname,,,,weapon1
buffalo_engine_low,,vehicles/mrk_tank_03_move.wav,0,,vehicle,1.05,,7,9500,auto,,,looping,,yourmapname,,,,
buffalo_engine_high,,vehicles/mrk_tank_03_move.wav,0.17,,vehicle,1.55,,7,9500,auto,,,looping,,yourmapname,,,,
Compile your map, and voila you should now have a moving vehicle... wow this turned out rather long, I hope it can be of use
Table (I'm not sure I have covered all vehicles here, but all vehicletypes and so on should be correct), click for HTML version:

source files
here