here is a tested script for multiple jump pads in your map:
Code:
main()
{
//maps\mp\mp_pipeline_fx::main();
//maps\createart\mp_pipeline_art::main();
maps\mp\_load::main();
//maps\mp\_compass::setupMiniMap("compass_map_mp_pipeline");
//setExpFog(700, 1500, 0.5, 0.5, 0.5, 0);
//ambientPlay("ambient_pipeline");
//VisionSetNaked( "mp_pipeline" );
game["allies"] = "sas";
game["axis"] = "russian";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["allies_soldiertype"] = "woodland";
game["axis_soldiertype"] = "woodland";
setdvar( "r_specularcolorscale", "1" );
setdvar("r_glowbloomintensity0",".1");
setdvar("r_glowbloomintensity1",".1");
setdvar("r_glowskybleedintensity0",".1");
setdvar("compassmaxrange","2200");
thread jumppad_init();
}
jumppad_init()
{
pad_triggers = getentarray("jumppad_trigger", "targetname");
for (p=0; p<pad_triggers.size; p++)
pad_triggers[p] thread jumppad_idle();
}
jumppad_idle()
{
// self is a trigger_multiple (our Jump Pad trigger)
while (1)
{
self waittill ("trigger", player);
// ensure the player is touching the trigger (actually a double-check)
if (player istouching(self))
{
// mover is our helper entity, which we need to move the player
player.mover = spawn("script_origin", (0,0,0));
player.mover.origin = player.origin;
player.mover.angles = player.angles;
player linkto(player.mover);
// don't thread this call, we need to wait until the moving is done...
self jumppad_action(player);
player unlink();
player.mover delete();
// waits a server frame (at sv_fps 20) to free the mover entity
// not necessarily needed i guess, but i find it nicer =)
wait 0.05;
}
}
}
jumppad_action(player)
{
if (isdefined(self.target) && isdefined(player.mover))
{
// prevent script errors if targetname isn't unique in the map
target = getentarray(self.target, "targetname");
if (target.size < 1) // or: !isdefined(target[0])
return;
/#
// throw error in dev mode only!
if (target.size > 1)
assertmsg("More than 1 entity with targetname \"" + self.target + "\".\nMake sure you use unique names for the Jump Pad script_origins (automatically generated if you leave targetname blank and connect an entity to another; auto#");
#/
// adjust move speed here by changing the moveto and wait time
player.mover moveto(target[0].origin, 0.2);
wait 0.2; //or: player.mover waittill("movedone");
// recursive call till we reach the last Jump Pad script_origin
target[0] jumppad_action(player);
}
}
create a trigger_multiple in radiant (like shown in the cod4 jump pad tutorial)
targetname jumppad_trigger
create a script_origin, DON'T give it a targetname!
duplicate the script_origin as many times you want you move them all into position (they will become the flight path)
then deselect everything (ESC)
shift select the trigger and the first script_origin (should be the closest to the trigger)
Hit W to connect them (radiant will automatically give the script_origin a unique targetname, auto#)
now with the 1st script_origin still selected, shift select the 2nd and hit W again
continue till the last script_origin for that jump pad
you can select all script_origins and the trigger, hit space to duplicate all entities and move them into the desired position
note: radiant will pick new unique names for the duplicated script_origins, and that's what we need!
this unique name thing does NOT work if you put the trigger and script_origins in a prefab! the only way to select all entites for a jump pad is to use layers, but it doesn't really save time imo (the time you need to create a layer, asign the entites of a jump pad to it, select all entites of a layer vs. having to shift select all entities one by one...)
shift select = the usual way of selecting stuff in radiant, hold shift and click your left mouse button