Pushed raw files
This commit is contained in:
1 parent
22d0d4d39f
commit
79f967ecc9
5854 files changed
+2989978
No files matched your search
@@ -0,0 +1,176 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
//SNDFILE=vehicle_80s_car
|
||||
build_template( "80s_hatch1", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_destructible( "vehicle_80s_hatch1_brn_destructible_mp", "vehicle_80s_hatch1_brn" );
|
||||
build_destructible( "vehicle_80s_hatch1_green_destructible_mp", "vehicle_80s_hatch1_green" );
|
||||
build_destructible( "vehicle_80s_hatch1_red_destructible_mp", "vehicle_80s_hatch1_red" );
|
||||
build_destructible( "vehicle_80s_hatch1_silv_destructible_mp", "vehicle_80s_hatch1_silv" );
|
||||
build_destructible( "vehicle_80s_hatch1_tan_destructible_mp", "vehicle_80s_hatch1_tan" );
|
||||
build_destructible( "vehicle_80s_hatch1_yel_destructible_mp", "vehicle_80s_hatch1_yel" );
|
||||
|
||||
build_drive( %technical_driving_idle_forward, %technical_driving_idle_backward, 10 );
|
||||
|
||||
// build_treadfx();
|
||||
|
||||
//life is now determined by destructible. less _vehicle controled
|
||||
build_life( 999, 500, 1500 );
|
||||
|
||||
build_team( "allies" );
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
return positions;// no anims yet
|
||||
/*
|
||||
for(i=0;i<4;i++)
|
||||
positions[i] = spawnstruct();
|
||||
|
||||
positions[0].sittag = "body_animate_jnt";
|
||||
positions[1].sittag = "body_animate_jnt";
|
||||
positions[2].sittag = "tag_passenger";
|
||||
positions[3].sittag = "body_animate_jnt";
|
||||
|
||||
positions[0].idle = %humvee_driver_climb_idle;
|
||||
positions[1].idle = %humvee_passenger_idle_L;
|
||||
positions[2].idle = %humvee_passenger_idle_R;
|
||||
positions[3].idle = %humvee_passenger_idle_R;
|
||||
|
||||
positions[0].getout = %humvee_driver_climb_out;
|
||||
positions[1].getout = %humvee_passenger_out_L;
|
||||
positions[2].getout = %humvee_passenger_out_R;
|
||||
positions[3].getout = %humvee_passenger_out_R;
|
||||
|
||||
positions[0].getin = %humvee_driver_climb_in;
|
||||
positions[1].getin = %humvee_passenger_in_L;
|
||||
positions[2].getin = %humvee_passenger_in_R;
|
||||
positions[3].getin = %humvee_passenger_in_R;
|
||||
|
||||
*/
|
||||
return positions;
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_80s_hatch1_brn_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_brn_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_hatch1_brn_destructible_mp_80s_hatch1
|
||||
include,destructible_vehicle_80s_hatch1_brn_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_hatch1_brn_destructible_mp"
|
||||
default:"vehicletype" "80s_hatch1"
|
||||
default:"script_team" "allies"
|
||||
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_hatch1_green_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_green_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_hatch1_green_destructible_mp_80s_hatch1
|
||||
include,destructible_vehicle_80s_hatch1_green_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_hatch1_green_destructible_mp"
|
||||
default:"vehicletype" "80s_hatch1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_hatch1_red_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_red_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_hatch1_red_destructible_mp_80s_hatch1
|
||||
include,destructible_vehicle_80s_hatch1_red_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_hatch1_red_destructible_mp"
|
||||
default:"vehicletype" "80s_hatch1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_hatch1_silv_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_silv_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_hatch1_silv_destructible_mp_80s_hatch1
|
||||
include,destructible_vehicle_80s_hatch1_silv_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_hatch1_silv_destructible_mp"
|
||||
default:"vehicletype" "80s_hatch1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_hatch1_tan_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_tan_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_hatch1_tan_destructible_mp_80s_hatch1
|
||||
include,destructible_vehicle_80s_hatch1_tan_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_hatch1_tan_destructible_mp"
|
||||
default:"vehicletype" "80s_hatch1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_hatch1_yel_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_yel_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_hatch1_yel_destructible_mp_80s_hatch1
|
||||
include,destructible_vehicle_80s_hatch1_yel_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_hatch1_yel_destructible_mp"
|
||||
default:"vehicletype" "80s_hatch1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,250 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
//SNDFILE=vehicle_80s_car
|
||||
build_template( "80s_sedan1", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_80s_sedan1_brn", "vehicle_80s_sedan1_brn_destroyed" );
|
||||
build_deathmodel( "vehicle_80s_sedan1_green", "vehicle_80s_sedan1_green_destroyed" );
|
||||
build_deathmodel( "vehicle_80s_sedan1_red", "vehicle_80s_sedan1_red_destroyed" );
|
||||
build_deathmodel( "vehicle_80s_sedan1_silv", "vehicle_80s_sedan1_silv_destroyed" );
|
||||
build_deathmodel( "vehicle_80s_sedan1_tan", "vehicle_80s_sedan1_tan_destroyed" );
|
||||
build_deathmodel( "vehicle_80s_sedan1_yel", "vehicle_80s_sedan1_yel_destroyed" );
|
||||
|
||||
// vehicle_80s_sedan1_brn_destructible
|
||||
build_destructible( "vehicle_80s_sedan1_brn_destructible_mp", "vehicle_80s_sedan1_brn" );
|
||||
build_destructible( "vehicle_80s_sedan1_green_destructible_mp", "vehicle_80s_sedan1_green" );
|
||||
build_destructible( "vehicle_80s_sedan1_red_destructible_mp", "vehicle_80s_sedan1_red" );
|
||||
build_destructible( "vehicle_80s_sedan1_silv_destructible_mp", "vehicle_80s_sedan1_silv" );
|
||||
build_destructible( "vehicle_80s_sedan1_tan_destructible_mp", "vehicle_80s_sedan1_tan" );
|
||||
build_destructible( "vehicle_80s_sedan1_yel_destructible_mp", "vehicle_80s_sedan1_yel" );
|
||||
build_drive( %technical_driving_idle_forward, %technical_driving_idle_backward, 10 );
|
||||
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
|
||||
for ( i = 0;i < 1;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
positions[ 0 ].sittag = "tag_driver";
|
||||
positions[ 0 ].idle = %luxurysedan_driver_idle;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_brn (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_brn" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_brn_80s_sedan1
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_brn"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_brn_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_brn_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_brn_destructible_mp_80s_sedan1
|
||||
include,destructible_vehicle_80s_sedan1_brn_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_brn_destructible_mp"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_green (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_green" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_green_80s_sedan1
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_green"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_green_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_green_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_green_destructible_mp_80s_sedan1
|
||||
include,destructible_vehicle_80s_sedan1_green_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_green_destructible_mp"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_red (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_red" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_red_80s_sedan1
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_red"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_red_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_red_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_red_destructible_mp_80s_sedan1
|
||||
include,destructible_vehicle_80s_sedan1_red_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_red_destructible_mp"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_silv (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_silv" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_silv_80s_sedan1
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_silv"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_silv_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_silv_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_silv_destructible_mp_80s_sedan1
|
||||
include,destructible_vehicle_80s_sedan1_silv_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_silv_destructible_mp"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_tan (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_tan" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_tan_80s_sedan1
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_tan"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_tan_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_tan_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_tan_destructible_mp_80s_sedan1
|
||||
include,destructible_vehicle_80s_sedan1_tan_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_tan_destructible_mp"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_yel (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_yel" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_yel_80s_sedan1
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_yel"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_sedan1_yel_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_yel_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_sedan1_yel_destructible_mp_80s_sedan1
|
||||
include,destructible_vehicle_80s_sedan1_yel_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_sedan1_yel_destructible_mp"
|
||||
default:"vehicletype" "80s_sedan1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,177 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
|
||||
|
||||
main( model, type )
|
||||
{
|
||||
//SNDFILE=vehicle_80s_car
|
||||
build_template( "80s_wagon1", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_destructible( "vehicle_80s_wagon1_brn_destructible_mp", "vehicle_80s_wagon1_brn" );
|
||||
build_destructible( "vehicle_80s_wagon1_green_destructible_mp", "vehicle_80s_wagon1_green" );
|
||||
build_destructible( "vehicle_80s_wagon1_red_destructible_mp", "vehicle_80s_wagon1_red" );
|
||||
build_destructible( "vehicle_80s_wagon1_silv_destructible_mp", "vehicle_80s_wagon1_silv" );
|
||||
build_destructible( "vehicle_80s_wagon1_tan_destructible_mp", "vehicle_80s_wagon1_tan" );
|
||||
build_destructible( "vehicle_80s_wagon1_yel_destructible_mp", "vehicle_80s_wagon1_yel" );
|
||||
|
||||
build_compassicon( "automobile", false );
|
||||
build_drive( %technical_driving_idle_forward, %technical_driving_idle_backward, 10 );
|
||||
|
||||
build_deathfx( "explosions/large_vehicle_explosion", undefined, "explo_metal_rand" );
|
||||
// build_drive( %technical_driving_idle_forward, %technical_driving_idle_backward, 10 );
|
||||
|
||||
// build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
return positions;// no anims yet
|
||||
/*
|
||||
for(i=0;i<4;i++)
|
||||
positions[i] = spawnstruct();
|
||||
|
||||
positions[0].sittag = "body_animate_jnt";
|
||||
positions[1].sittag = "body_animate_jnt";
|
||||
positions[2].sittag = "tag_passenger";
|
||||
positions[3].sittag = "body_animate_jnt";
|
||||
|
||||
positions[0].idle = %humvee_driver_climb_idle;
|
||||
positions[1].idle = %humvee_passenger_idle_L;
|
||||
positions[2].idle = %humvee_passenger_idle_R;
|
||||
positions[3].idle = %humvee_passenger_idle_R;
|
||||
|
||||
positions[0].getout = %humvee_driver_climb_out;
|
||||
positions[1].getout = %humvee_passenger_out_L;
|
||||
positions[2].getout = %humvee_passenger_out_R;
|
||||
positions[3].getout = %humvee_passenger_out_R;
|
||||
|
||||
positions[0].getin = %humvee_driver_climb_in;
|
||||
positions[1].getin = %humvee_passenger_in_L;
|
||||
positions[2].getin = %humvee_passenger_in_R;
|
||||
positions[3].getin = %humvee_passenger_in_R;
|
||||
|
||||
*/
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_80s_wagon1_brn_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_brn_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_wagon1_brn_destructible_mp_80s_wagon1
|
||||
include,destructible_vehicle_80s_wagon1_brn_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_wagon1_brn_destructible_mp"
|
||||
default:"vehicletype" "80s_wagon1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_wagon1_green_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_green_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_wagon1_green_destructible_mp_80s_wagon1
|
||||
include,destructible_vehicle_80s_wagon1_green_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_wagon1_green_destructible_mp"
|
||||
default:"vehicletype" "80s_wagon1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_wagon1_red_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_red_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_wagon1_red_destructible_mp_80s_wagon1
|
||||
include,destructible_vehicle_80s_wagon1_red_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_wagon1_red_destructible_mp"
|
||||
default:"vehicletype" "80s_wagon1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_wagon1_silv_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_silv_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_wagon1_silv_destructible_mp_80s_wagon1
|
||||
include,destructible_vehicle_80s_wagon1_silv_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_wagon1_silv_destructible_mp"
|
||||
default:"vehicletype" "80s_wagon1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_wagon1_tan_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_tan_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_wagon1_tan_destructible_mp_80s_wagon1
|
||||
include,destructible_vehicle_80s_wagon1_tan_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_wagon1_tan_destructible_mp"
|
||||
default:"vehicletype" "80s_wagon1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_80s_wagon1_yel_destructible_mp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_yel_destructible_mp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_80s_wagon1_yel_destructible_mp_80s_wagon1
|
||||
include,destructible_vehicle_80s_wagon1_yel_destructible_mp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_80s_car,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_80s_wagon1_yel_destructible_mp"
|
||||
default:"vehicletype" "80s_wagon1"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
+1987
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,24 @@
|
||||
#include maps\_ambient;
|
||||
|
||||
main()
|
||||
{
|
||||
// Set the underlying ambient track
|
||||
level.ambient_track [ "ac130" ] = "ambient_ac130_int1";
|
||||
thread maps\_utility::set_ambient( "ac130" );
|
||||
|
||||
ambientDelay( "ac130", 3.0, 6.0 );// Trackname, min and max delay between ambient events
|
||||
ambientEvent( "ac130", "elm_ac130_rattles", 4.0 );
|
||||
ambientEvent( "ac130", "elm_ac130_beeps", 0.3 );
|
||||
ambientEvent( "ac130", "elm_ac130_hydraulics", 1.0 );
|
||||
ambientEvent( "ac130", "elm_ac130_metal_stress", 0.3 );
|
||||
ambientEvent( "ac130", "null", 1.0 );
|
||||
|
||||
|
||||
ambientEventStart( "ac130" );
|
||||
|
||||
level waittill( "action moment" );
|
||||
|
||||
ambientEventStart( "action ambient" );
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
#include maps\_utility;
|
||||
main()
|
||||
{
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
// 1 ) Check your fire, you're shootin' at friendlies - watch for the blinking strobes those are our guys!
|
||||
// 2 ) Uh, you're firing too close to the friendlies, I repeat, you're firing too close to the friendlies. Watch for those IR strobes.
|
||||
// 3 ) Be careful! You almost killed our guys there!
|
||||
level.scr_sound[ "fco" ][ "ac130_fco_firingtoclose" ] = "ac130_fco_firingtoclose";
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
//CONTEXT SENSATIVE DIALOG
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
add_context_sensative_dialog( "ai", "in_sight", 0, "ac130_fco_moreenemy" ); // More enemy personnel.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 1, "ac130_fco_getthatguy" ); // Get that guy.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 2, "ac130_fco_guymovin" ); // Roger, guy movin'.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 3, "ac130_fco_getperson" ); // Get that person.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 4, "ac130_fco_guyrunnin" ); // Guy runnin'.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 5, "ac130_fco_gotarunner" ); // Uh, we got a runner here.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 6, "ac130_fco_backonthose" ); // Get back on those guys.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 7, "ac130_fco_gonnagethim" ); // You gonna get him?
|
||||
add_context_sensative_dialog( "ai", "in_sight", 8, "ac130_fco_personnelthere" ); // Personnel right there.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 9, "ac130_fco_nailthoseguys" ); // Nail those guys.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 10, "ac130_fco_clearedtoengage" ); // Cleared to engage enemy personnel.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 11, "ac130_fco_lightemup" ); // Light ‘em up.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 12, "ac130_fco_takehimout" ); // Yeah take him out.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 13, "ac130_plt_clearedtoengage" ); // Cleared to engage all of those.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 14, "ac130_plt_yeahcleared" ); // Yeah, cleared to engage.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 15, "ac130_plt_copysmoke" ); // Copy, smoke ‘em.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 16, "ac130_fco_rightthere" ); // Right there...tracking.
|
||||
add_context_sensative_dialog( "ai", "in_sight", 17, "ac130_fco_tracking" ); // Tracking.
|
||||
|
||||
add_context_sensative_dialog( "ai", "wounded_crawl", 0, "ac130_fco_movingagain" ); // Ok he’s moving again.
|
||||
add_context_sensative_timeout( "ai", "wounded_crawl", undefined, 6 );
|
||||
|
||||
add_context_sensative_dialog( "ai", "wounded_pain", 0, "ac130_fco_doveonground" ); // Yeah, he just dove on the ground.
|
||||
add_context_sensative_dialog( "ai", "wounded_pain", 1, "ac130_fco_knockedwind" ); // Probably just knocked the wind out of him.
|
||||
add_context_sensative_dialog( "ai", "wounded_pain", 2, "ac130_fco_downstillmoving" ); // That guy's down but still moving.
|
||||
add_context_sensative_dialog( "ai", "wounded_pain", 3, "ac130_fco_gettinbackup" ); // He's gettin' back up.
|
||||
add_context_sensative_dialog( "ai", "wounded_pain", 4, "ac130_fco_yepstillmoving" ); // Yep, that guy’s still moving.
|
||||
add_context_sensative_dialog( "ai", "wounded_pain", 5, "ac130_fco_stillmoving" ); // He's still moving.
|
||||
add_context_sensative_timeout( "ai", "wounded_pain", undefined, 12 );
|
||||
|
||||
add_context_sensative_dialog( "weapons", "105mm_ready", 0, "ac130_gnr_gunready1" );
|
||||
|
||||
add_context_sensative_dialog( "weapons", "105mm_fired", 0, "ac130_gnr_shot1" );
|
||||
|
||||
add_context_sensative_dialog( "plane", "rolling_in", 0, "ac130_plt_rollinin" );
|
||||
|
||||
add_context_sensative_dialog( "explosion", "secondary", 0, "ac130_nav_secondaries1" );
|
||||
add_context_sensative_dialog( "explosion", "secondary", 1, "ac130_tvo_directsecondary1" );
|
||||
add_context_sensative_dialog( "explosion", "secondary", 1, "ac130_tvo_directsecondary2" );
|
||||
add_context_sensative_timeout( "explosion", "secondary", undefined, 7 );
|
||||
|
||||
add_context_sensative_dialog( "kill", "single", 0, "ac130_plt_gottahurt" ); // Ooo that's gotta hurt.
|
||||
add_context_sensative_dialog( "kill", "single", 1, "ac130_fco_iseepieces" ); // Yeah, good kill. I see lots of little pieces down there.
|
||||
add_context_sensative_dialog( "kill", "single", 2, "ac130_fco_oopsiedaisy" ); // ( chuckling ) Oopsie - daisy.
|
||||
add_context_sensative_dialog( "kill", "single", 3, "ac130_fco_goodkill" ); // Good kill good kill.
|
||||
add_context_sensative_dialog( "kill", "single", 4, "ac130_fco_yougothim" ); // You got him.
|
||||
add_context_sensative_dialog( "kill", "single", 5, "ac130_fco_yougothim2" ); // You got him!
|
||||
add_context_sensative_dialog( "kill", "single", 6, "ac130_fco_thatsahit" ); // That's a hit.
|
||||
add_context_sensative_dialog( "kill", "single", 7, "ac130_fco_directhit" ); // Direct hit.
|
||||
add_context_sensative_dialog( "kill", "single", 8, "ac130_fco_rightontarget" ); // Yep, that was right on target.
|
||||
add_context_sensative_dialog( "kill", "single", 9, "ac130_fco_okyougothim" ); // Ok, you got him. Get back on the other guys.
|
||||
add_context_sensative_dialog( "kill", "single", 10, "ac130_fco_within2feet" ); // All right you got the guy. That might have been within two feet of him.
|
||||
|
||||
add_context_sensative_dialog( "kill", "small_group", 0, "ac130_fco_nice" ); // ( chuckling ) Niiiice.
|
||||
add_context_sensative_dialog( "kill", "small_group", 1, "ac130_fco_directhits" ); // Yeah, direct hits right there.
|
||||
add_context_sensative_dialog( "kill", "small_group", 2, "ac130_fco_iseepieces" ); // Yeah, good kill. I see lots of little pieces down there.
|
||||
add_context_sensative_dialog( "kill", "small_group", 3, "ac130_fco_goodkill" ); // Good kill good kill.
|
||||
add_context_sensative_dialog( "kill", "small_group", 4, "ac130_fco_yougothim" ); // You got him.
|
||||
add_context_sensative_dialog( "kill", "small_group", 5, "ac130_fco_yougothim2" ); // You got him!
|
||||
add_context_sensative_dialog( "kill", "small_group", 6, "ac130_fco_thatsahit" ); // That's a hit.
|
||||
add_context_sensative_dialog( "kill", "small_group", 7, "ac130_fco_directhit" ); // Direct hit.
|
||||
add_context_sensative_dialog( "kill", "small_group", 8, "ac130_fco_rightontarget" );// Yep, that was right on target.
|
||||
add_context_sensative_dialog( "kill", "small_group", 9, "ac130_fco_okyougothim" ); // Ok, you got him. Get back on the other guys.
|
||||
|
||||
add_context_sensative_dialog( "kill", "large_group", 0, "ac130_fco_hotdamn1" ); // Hot damn!
|
||||
add_context_sensative_dialog( "kill", "large_group", 0, "ac130_fco_hotdamn2" ); // Hot damn!
|
||||
add_context_sensative_dialog( "kill", "large_group", 0, "ac130_fco_hotdamn3" ); // Hot damn!
|
||||
add_context_sensative_dialog( "kill", "large_group", 1, "ac130_tvo_whoa1" ); // Whoa!!!
|
||||
add_context_sensative_dialog( "kill", "large_group", 1, "ac130_tvo_whoa2" ); // Whoa!!!
|
||||
add_context_sensative_dialog( "kill", "large_group", 1, "ac130_tvo_whoa3" ); // Whoa!!!
|
||||
add_context_sensative_dialog( "kill", "large_group", 2, "ac130_fco_kaboom" ); // Ka - boom.
|
||||
|
||||
add_context_sensative_dialog( "location", "car", 0, "ac130_fco_guybycar" ); // There’s a guy by that car.
|
||||
add_context_sensative_timeout( "location", "car", undefined, 40 );
|
||||
|
||||
add_context_sensative_dialog( "location", "truck", 0, "ac130_fco_guybytruck" ); // There’s one by that truck.
|
||||
add_context_sensative_timeout( "location", "truck", undefined, 12 );
|
||||
|
||||
add_context_sensative_dialog( "location", "building", 0, "ac130_fco_nailbybuilding1" );
|
||||
add_context_sensative_timeout( "location", "building", undefined, 20 );
|
||||
|
||||
add_context_sensative_dialog( "location", "wall", 0, "ac130_tvo_coverbywall1" );
|
||||
add_context_sensative_timeout( "location", "wall", undefined, 20 );
|
||||
|
||||
add_context_sensative_dialog( "location", "field", 0, "ac130_fco_crossingfield" ); // Enemies crossing the field.
|
||||
add_context_sensative_timeout( "location", "field", undefined, 20 );
|
||||
|
||||
add_context_sensative_dialog( "location", "road", 0, "ac130_fco_enemyonroad" ); // Enemy personnel on the road.
|
||||
add_context_sensative_timeout( "location", "road", undefined, 20 );
|
||||
|
||||
add_context_sensative_dialog( "location", "church", 0, "ac130_fco_outofchurch" ); // There's armed personnel running out of the church.
|
||||
add_context_sensative_timeout( "location", "church", undefined, 20 );
|
||||
|
||||
add_context_sensative_dialog( "location", "ditch", 0, "ac130_fco_headinforditch" ); // Yeah, he’s headin’ for the ditch.
|
||||
add_context_sensative_timeout( "location", "ditch", undefined, 20 );
|
||||
|
||||
add_context_sensative_dialog( "vehicle", "incoming", 0, "ac130_fco_movingvehicle" ); // We got a moving vehicle here.
|
||||
add_context_sensative_dialog( "vehicle", "incoming", 1, "ac130_fco_vehicleonmove" ); // We got a vehicle on the move.
|
||||
add_context_sensative_dialog( "vehicle", "incoming", 2, "ac130_plt_engvehicle" ); // You are cleared to engage the moving vehicle.
|
||||
add_context_sensative_dialog( "vehicle", "incoming", 3, "ac130_fco_getvehicle" ); // Crew, get the moving vehicle.
|
||||
|
||||
add_context_sensative_dialog( "vehicle", "death", 0, "ac130_fco_confirmed" ); // Confirmed, vehicle neutralized.
|
||||
add_context_sensative_dialog( "vehicle", "death", 1, "ac130_fco_fulltank" ); // ( chuckling ) Shit, must've been a full tank of gas.
|
||||
|
||||
add_context_sensative_dialog( "misc", "action", 0, "ac130_plt_scanrange" ); // Set scan range.
|
||||
add_context_sensative_timeout( "misc", "action", 0, 70 );
|
||||
|
||||
add_context_sensative_dialog( "misc", "action", 1, "ac130_plt_cleanup" ); // Clean up that signal.
|
||||
add_context_sensative_timeout( "misc", "action", 1, 80 );
|
||||
|
||||
add_context_sensative_dialog( "misc", "action", 2, "ac130_plt_targetreset" ); // Target reset.
|
||||
add_context_sensative_timeout( "misc", "action", 2, 55 );
|
||||
|
||||
add_context_sensative_dialog( "misc", "action", 3, "ac130_plt_azimuthsweep" ); // Recalibrate azimuth sweep angle. Adjust elevation scan.
|
||||
add_context_sensative_timeout( "misc", "action", 3, 100 );
|
||||
}
|
||||
|
||||
add_context_sensative_dialog( name1, name2, group, soundAlias )
|
||||
{
|
||||
assert( isdefined( name1 ) );
|
||||
assert( isdefined( name2 ) );
|
||||
assert( isdefined( group ) );
|
||||
assert( isdefined( soundAlias ) );
|
||||
assert( soundexists( soundAlias ) == true );
|
||||
|
||||
if ( ( !isdefined( level.scr_sound[ name1 ] ) ) || ( !isdefined( level.scr_sound[ name1 ][ name2 ] ) ) || ( !isdefined( level.scr_sound[ name1 ][ name2 ][ group ] ) ) )
|
||||
{
|
||||
// creating group for the first time
|
||||
level.scr_sound[ name1 ][ name2 ][ group ] = spawnStruct();
|
||||
level.scr_sound[ name1 ][ name2 ][ group ].played = false;
|
||||
level.scr_sound[ name1 ][ name2 ][ group ].sounds = [];
|
||||
}
|
||||
|
||||
//group exists, add the sound to the array
|
||||
index = level.scr_sound[ name1 ][ name2 ][ group ].sounds.size;
|
||||
level.scr_sound[ name1 ][ name2 ][ group ].sounds[ index ] = soundAlias;
|
||||
}
|
||||
|
||||
add_context_sensative_timeout( name1, name2, groupNum, timeoutDuration )
|
||||
{
|
||||
if ( !isdefined( level.context_sensative_dialog_timeouts ) )
|
||||
level.context_sensative_dialog_timeouts = [];
|
||||
|
||||
createStruct = false;
|
||||
if ( !isdefined( level.context_sensative_dialog_timeouts[ name1 ] ) )
|
||||
createStruct = true;
|
||||
else if ( !isdefined( level.context_sensative_dialog_timeouts[ name1 ][ name2 ] ) )
|
||||
createStruct = true;
|
||||
if ( createStruct )
|
||||
level.context_sensative_dialog_timeouts[ name1 ][ name2 ] = spawnStruct();
|
||||
|
||||
if ( isdefined( groupNum ) )
|
||||
{
|
||||
level.context_sensative_dialog_timeouts[ name1 ][ name2 ].groups = [];
|
||||
level.context_sensative_dialog_timeouts[ name1 ][ name2 ].groups[ string( groupNum ) ] = spawnStruct();
|
||||
level.context_sensative_dialog_timeouts[ name1 ][ name2 ].groups[ string( groupNum ) ].v[ "timeoutDuration" ] = timeoutDuration * 1000;
|
||||
level.context_sensative_dialog_timeouts[ name1 ][ name2 ].groups[ string( groupNum ) ].v[ "lastPlayed" ] = ( timeoutDuration * - 1000 );
|
||||
}
|
||||
else
|
||||
{
|
||||
level.context_sensative_dialog_timeouts[ name1 ][ name2 ].v[ "timeoutDuration" ] = timeoutDuration * 1000;
|
||||
level.context_sensative_dialog_timeouts[ name1 ][ name2 ].v[ "lastPlayed" ] = ( timeoutDuration * - 1000 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,638 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
|
||||
ENDING_MOVE_SPEED = 0.45;
|
||||
|
||||
main()
|
||||
{
|
||||
precacheshellshock( "slowview" );
|
||||
precacheshellshock( "aftermath" );
|
||||
//precacheshellshock( "aftermath_fall" );
|
||||
precacheShader( "overlay_hunted_black" );
|
||||
precacheShader( "overlay_hunted_white" );
|
||||
|
||||
flag_init( "force_limp" );
|
||||
flag_init( "fall" );
|
||||
flag_init( "collapse" );
|
||||
flag_init( "collapse_done" );
|
||||
flag_init( "aftermath_dont_do_wakeup" );
|
||||
flag_init( "start_doing_aftermath_walk" );
|
||||
flag_init( "player_heartbeat_sound" );
|
||||
flag_init( "player_limping" );
|
||||
flag_init( "stop_being_stunned" );
|
||||
|
||||
waittillframeend;
|
||||
level.player_heartrate = 0.8;
|
||||
level.player.movespeedscale = 1;
|
||||
}
|
||||
|
||||
aftermath_style_walking()
|
||||
{
|
||||
// level.player childthread player_heartbeat();
|
||||
|
||||
waittillframeend; // so flag can get set
|
||||
waittillframeend; // for main init
|
||||
if ( flag( "stop_aftermath_player" ) )
|
||||
return;
|
||||
level endon( "stop_aftermath_player" );
|
||||
|
||||
level.ground_ref_ent = spawn( "script_model", ( 0, 0, 0 ) );
|
||||
level.player playerSetGroundReferenceEnt( level.ground_ref_ent );
|
||||
|
||||
|
||||
|
||||
// level childthread slowview();
|
||||
|
||||
set_vision_set( "aftermath_walking", 0 );
|
||||
|
||||
if ( flag( "aftermath_dont_do_wakeup" ) )
|
||||
return;
|
||||
|
||||
|
||||
player_wakeup();
|
||||
|
||||
// level.player childthread player_jump_punishment();
|
||||
}
|
||||
|
||||
slowview()
|
||||
{
|
||||
while ( true )
|
||||
{
|
||||
level waittill( "slowview", wait_time );
|
||||
if ( isdefined( wait_time ) )
|
||||
wait( wait_time );
|
||||
childthread restart_slowview();
|
||||
//level.player shellshock( "slowview", 15 );
|
||||
}
|
||||
}
|
||||
|
||||
restart_slowview()
|
||||
{
|
||||
level endon ( "slowview" );
|
||||
wait 10;
|
||||
level notify ( "slowview" );
|
||||
}
|
||||
|
||||
player_heartbeat()
|
||||
{
|
||||
// flag_clear( "stop_heart" );
|
||||
|
||||
level notify ( "stop_heart" );
|
||||
level endon ( "stop_heart" );
|
||||
|
||||
// wait 3;
|
||||
while ( true )
|
||||
{
|
||||
if ( !flag( "fall" ) )
|
||||
{
|
||||
if ( isdefined( level.heartbeat_blood_func ) )
|
||||
{
|
||||
[[ level.heartbeat_blood_func ]]();
|
||||
}
|
||||
|
||||
if ( flag( "player_heartbeat_sound" ) )
|
||||
{
|
||||
level.player thread play_sound_on_entity( "breathing_heartbeat" );
|
||||
wait 0.05;
|
||||
level.player PlayRumbleOnEntity( "damage_light" );
|
||||
}
|
||||
|
||||
|
||||
wait level.player_heartrate;
|
||||
}
|
||||
|
||||
wait( 0 + randomfloat( 0.1 ) );
|
||||
|
||||
if ( randomint( 50 ) > level.player.movespeedscale * 190 )
|
||||
wait randomfloat( 1 );
|
||||
}
|
||||
}
|
||||
|
||||
get_player_speed()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
player_wakeup()
|
||||
{
|
||||
level.player play_sound_on_entity( "sprint_gasp" );
|
||||
flag_wait( "start_doing_aftermath_walk" );
|
||||
thread swivel();
|
||||
// childthread recover();
|
||||
//level.player playerSetGroundReferenceEnt( undefined );
|
||||
level.player play_sound_on_entity( "breathing_hurt_start" );
|
||||
level.player thread play_sound_on_entity( "breathing_better" );
|
||||
level.player childthread player_random_blur();
|
||||
}
|
||||
|
||||
adjust_angles_to_player( stumble_angles )
|
||||
{
|
||||
pa = stumble_angles[ 0 ];
|
||||
ra = stumble_angles[ 2 ];
|
||||
|
||||
rv = anglestoright( level.player.angles );
|
||||
fv = anglestoforward( level.player.angles );
|
||||
|
||||
rva = ( rv[ 0 ], 0, rv[ 1 ] * - 1 );
|
||||
fva = ( fv[ 0 ], 0, fv[ 1 ] * - 1 );
|
||||
angles = vector_multiply( rva, pa );
|
||||
angles = angles + vector_multiply( fva, ra );
|
||||
return angles + ( 0, stumble_angles[ 1 ], 0 );
|
||||
}
|
||||
|
||||
limp()
|
||||
{
|
||||
thread limp_thread();
|
||||
// thread limp_old();
|
||||
}
|
||||
|
||||
adjust_swivel_over_time( ent )
|
||||
{
|
||||
level endon( "stop_drunk_walk" );
|
||||
next_switch = 1;
|
||||
|
||||
original_range = 7; // 25;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
range = original_range * level.unsteady_scale;
|
||||
yaw = randomfloatrange( range * 0.5, range );
|
||||
|
||||
next_switch--;
|
||||
if ( next_switch <= 0 )
|
||||
{
|
||||
next_switch = randomint( 3 );
|
||||
yaw *= -1;
|
||||
}
|
||||
|
||||
dif = yaw - ent.origin[0];
|
||||
dif = abs( dif );
|
||||
|
||||
time = dif * 0.05;
|
||||
if ( time < 0.05 )
|
||||
time = 0.05;
|
||||
|
||||
start_time = gettime();
|
||||
ent moveto( ( yaw, 0, 0 ), time, time * 0.5, time * 0.5 );
|
||||
wait time;
|
||||
|
||||
wait_for_buffer_time_to_pass( start_time, 0.6 );
|
||||
for ( ;; )
|
||||
{
|
||||
player_speed = distance( (0,0,0), level.player getvelocity() );
|
||||
if ( player_speed >= 80 )
|
||||
break;
|
||||
wait 0.05;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
swivel_ends()
|
||||
{
|
||||
level waittill( "stop_drunk_walk" );
|
||||
time = 0.8;
|
||||
level.ground_ref_ent rotateto( (0,0,0), time, time * 0.5, time * 0.5 );
|
||||
wait time;
|
||||
level.ground_ref_ent delete();
|
||||
level.player playerSetGroundReferenceEnt( undefined );
|
||||
SetSlowMotion( 0.95, 1, 0.5 );
|
||||
}
|
||||
|
||||
swivel()
|
||||
{
|
||||
thread swivel_ends();
|
||||
|
||||
level endon( "stop_drunk_walk" );
|
||||
level.unsteady_scale = 4.1;
|
||||
|
||||
thread SetSlowMotion_overtime();
|
||||
ent = spawn_tag_origin();
|
||||
roll_ent = spawn_tag_origin();
|
||||
thread adjust_swivel_over_time( ent );
|
||||
thread adjust_roll_ent( roll_ent );
|
||||
|
||||
pitch_sin = 0;
|
||||
|
||||
last_stun = gettime();
|
||||
stuns = 3;
|
||||
stun_interval = 3500;
|
||||
|
||||
time = 0.1;
|
||||
last_angles = level.player getplayerangles()[1];
|
||||
for ( ;; )
|
||||
{
|
||||
new_angles = level.player getplayerangles()[1];
|
||||
dif = new_angles - last_angles;
|
||||
//angles = level.player getplayerangles();
|
||||
//yaw = angles[1];
|
||||
//yaw += ent.origin[0];
|
||||
yaw = ent.origin[0] + dif;
|
||||
last_angles = new_angles;
|
||||
|
||||
// roll = roll_ent.origin[0];
|
||||
|
||||
player_speed = distance( (0,0,0), level.player getvelocity() );
|
||||
|
||||
pitch_sin += player_speed * 0.06;
|
||||
|
||||
if ( player_speed > 80 )
|
||||
{
|
||||
new_sin = sin( gettime() * -0.1 );
|
||||
pitch_sin += new_sin * 10;
|
||||
|
||||
|
||||
if ( gettime() > last_stun + stun_interval && !flag( "stop_being_stunned" ) && stuns )
|
||||
{
|
||||
stuns--;
|
||||
last_stun = gettime();
|
||||
stuntime = randomfloatrange( 1, 2.5 );
|
||||
|
||||
axis = getaiarray( "axis" );
|
||||
closest = getClosest( level.player.origin, axis );
|
||||
too_close = isalive( closest ) && distance( level.player.origin, closest.origin ) < 400;
|
||||
|
||||
|
||||
if ( !too_close )
|
||||
{
|
||||
assert( stuntime * 1000 < stun_interval ); // avoiding overlap of allowcrouch delay calls. could get messy.
|
||||
childthread swivel_stunplayer( stuntime );
|
||||
level.player StunPlayer( stuntime );
|
||||
// level.player thread play_sound_on_entity( "breathing_hurt" );
|
||||
}
|
||||
}
|
||||
|
||||
// if ( randomint( 100 ) > 1 )
|
||||
// Earthquake( 0.1, 1, level.player.origin, 9000 );
|
||||
}
|
||||
|
||||
pitch = sin( pitch_sin ) * 4 * level.unsteady_scale; // 12;
|
||||
|
||||
if ( !flag( "player_limping" ) )
|
||||
level.ground_ref_ent rotateto( ( pitch * 0.15, yaw * -1, pitch * 0.85 ), time, time * 0.5, time * 0.5 );
|
||||
// level.ground_ref_ent rotateto( ( roll, yaw, roll ), time, time * 0.5, time * 0.5 );
|
||||
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
swivel_stunplayer( stuntime )
|
||||
{
|
||||
level notify ( "swivel_stunplayer" );
|
||||
level endon ( "swivel_stunplayer" );
|
||||
level.player allowcrouch( false );
|
||||
level.player allowprone( false );
|
||||
wait stuntime;
|
||||
level.player allowcrouch( true );
|
||||
level.player allowprone( true );
|
||||
}
|
||||
|
||||
SetSlowMotion_overtime()
|
||||
{
|
||||
level endon( "stop_drunk_walk" );
|
||||
timescale = 1;
|
||||
range = 0.15;
|
||||
time = 4;
|
||||
wait 3;
|
||||
for ( ;; )
|
||||
{
|
||||
SetSlowMotion( timescale, 0.89, time );
|
||||
wait time;
|
||||
SetSlowMotion( timescale, 1.06, time );
|
||||
wait time;
|
||||
}
|
||||
}
|
||||
|
||||
adjust_roll_ent( roll_ent )
|
||||
{
|
||||
level endon( "stop_drunk_walk" );
|
||||
walking_count = 0;
|
||||
cap = 140;
|
||||
|
||||
struct = getstruct( "limp_yaw_ent", "targetname" );
|
||||
targ = getstruct( struct.target, "targetname" );
|
||||
angles = vectortoangles( targ.origin - struct.origin );
|
||||
forward = anglestoforward( angles );
|
||||
|
||||
limped = false;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
player_speed = distance( (0,0,0), level.player getvelocity() );
|
||||
|
||||
//limp_yaw_ent
|
||||
fast_enough = player_speed > 80;
|
||||
|
||||
player_angles = level.player getplayerangles();
|
||||
player_forward = anglestoforward( player_angles );
|
||||
|
||||
correct_limp_direction = vectordot( player_forward, forward ) >= 0.8;
|
||||
|
||||
if ( fast_enough && correct_limp_direction )
|
||||
walking_count += 2;
|
||||
else
|
||||
walking_count -= 1;
|
||||
|
||||
|
||||
|
||||
walking_count = clamp( walking_count, 0, cap );
|
||||
if ( walking_count < cap )
|
||||
{
|
||||
wait 0.05;
|
||||
continue;
|
||||
}
|
||||
|
||||
walking_count = 0;
|
||||
if ( !limped )
|
||||
{
|
||||
limped = true;
|
||||
limp();
|
||||
|
||||
time = 2;
|
||||
ent = spawn_tag_origin();
|
||||
ent.origin = ( level.unsteady_scale, 0, 0 );
|
||||
ent moveto( (1,0,0), time, time * 0.5, time * 0.5 );
|
||||
for ( ;; )
|
||||
{
|
||||
level.unsteady_scale = ent.origin[0];
|
||||
if ( level.unsteady_scale == 1 )
|
||||
break;
|
||||
wait 0.05;
|
||||
}
|
||||
ent delete();
|
||||
return;
|
||||
//continue;
|
||||
}
|
||||
|
||||
cap = randomintrange( 70, 125 );
|
||||
|
||||
time = 0.45;
|
||||
roll = randomfloatrange( -16, -11 );
|
||||
roll_ent moveto( (roll,0,0), time, 0, time );
|
||||
wait time;
|
||||
|
||||
time *= 0.8;
|
||||
offset = randomfloatrange( -2, 2 );
|
||||
roll_ent moveto( (offset,0,0), time, time * 0.5, time * 0.5 );
|
||||
wait time;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
limp_thread()
|
||||
{
|
||||
level notify ( "kill_limp" );
|
||||
level endon ( "kill_limp" );
|
||||
|
||||
while ( true )
|
||||
{
|
||||
player_speed = distance( (0,0,0), level.player getvelocity() );
|
||||
|
||||
if ( player_speed < 80 )
|
||||
{
|
||||
wait 0.05;
|
||||
continue;
|
||||
}
|
||||
stun_time = 2.3;
|
||||
level.player thread swivel_stunplayer( stun_time );
|
||||
level.player thread play_sound_on_entity( "breathing_hurt" );
|
||||
level notify ( "not_random_blur" );
|
||||
noself_delayCall( .5, ::setblur, 4, .25 );
|
||||
noself_delayCall( 1.2, ::setblur, 0, 1 );
|
||||
delaythread( stun_time, ::player_random_blur );
|
||||
delaythread( 1, maps\af_chase_knife_fight_code::fade_out, stun_time * 4);
|
||||
delaythread( stun_time, maps\af_chase_knife_fight_code::fade_in, stun_time );
|
||||
set_vision_set( "aftermath_hurt", stun_time * 2 );
|
||||
delaythread( 1, ::set_vision_set, "aftermath_walking", stun_time );
|
||||
delaythread( stun_time * 2, ::set_vision_set, "aftermath_walking", stun_time );
|
||||
level.player PlayRumbleOnEntity( "damage_light" );
|
||||
level.player blend_movespeedscale( 0.25, 0.3 );
|
||||
level.player delaythread( stun_time * 0.5, ::blend_movespeedscale, ENDING_MOVE_SPEED, stun_time );
|
||||
// level.player thread play_sound_on_entity( "breathing_hurt" );
|
||||
flag_clear( "force_limp" );
|
||||
wait stun_time;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
limp_old()
|
||||
{
|
||||
stumble = 0;
|
||||
alt = 0;
|
||||
|
||||
while ( true )
|
||||
{
|
||||
timer = randomfloatrange( 2, 4 );
|
||||
wait timer;
|
||||
|
||||
velocity = level.player getvelocity();
|
||||
player_speed = abs( velocity [ 0 ] ) + abs( velocity[ 1 ] );
|
||||
|
||||
if ( player_speed < 10 && !flag( "force_limp" ) )
|
||||
{
|
||||
wait 0.05;
|
||||
continue;
|
||||
}
|
||||
|
||||
speed_multiplier = player_speed / ( level.player.movespeedscale * 190 );
|
||||
|
||||
p = randomfloatrange( 3, 5 );
|
||||
if ( randomint( 100 ) < 20 )
|
||||
p *= 1.5;
|
||||
|
||||
stumble_time = randomfloatrange( 0.35, 0.45 );
|
||||
recover_time = randomfloatrange( 0.65, 0.8 );
|
||||
|
||||
if ( flag( "force_limp" ) )
|
||||
{
|
||||
flag_clear( "force_limp" );
|
||||
speed_multiplier = 0.35;
|
||||
p *= 3;
|
||||
stumble_time = randomfloatrange( 0.7, 0.85 );
|
||||
recover_time = randomfloatrange( 1.65, 1.8 );
|
||||
}
|
||||
|
||||
r = randomfloatrange( 3, 7 );
|
||||
y = randomfloatrange( -8, -2 );
|
||||
|
||||
stumble_angles = ( p, y, r );
|
||||
stumble_angles = vector_multiply( stumble_angles, speed_multiplier );
|
||||
|
||||
stumble++ ;
|
||||
if ( speed_multiplier > 1.3 )
|
||||
stumble++ ;
|
||||
|
||||
flag_set( "player_limping" );
|
||||
childthread stumble( stumble_angles, stumble_time, recover_time );
|
||||
level waittill_either( "recovered", "force_limp" );
|
||||
flag_clear( "player_limping" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
player_random_blur()
|
||||
{
|
||||
level endon( "dying" );
|
||||
level endon ( "not_random_blur" );
|
||||
|
||||
while ( true )
|
||||
{
|
||||
wait 0.05;
|
||||
if ( randomint( 100 ) > 10 )
|
||||
continue;
|
||||
|
||||
blur = randomint( 3 ) + 2;
|
||||
blur_time = randomfloatrange( 0.3, 0.7 );
|
||||
recovery_time = randomfloatrange( 0.3, 1 );
|
||||
setblur( blur * 1.2, blur_time );
|
||||
wait blur_time;
|
||||
setblur( 0, recovery_time );
|
||||
wait 5;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
player_jump_punishment()
|
||||
{
|
||||
wait( 2 );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
if ( level.player isonground() )
|
||||
break;
|
||||
wait( 0.05 );
|
||||
}
|
||||
|
||||
while ( true )
|
||||
{
|
||||
wait 0.05;
|
||||
if ( level.player isonground() )
|
||||
continue;
|
||||
wait 0.2;
|
||||
if ( level.player isonground() )
|
||||
continue;
|
||||
|
||||
level notify( "stop_stumble" );
|
||||
wait 0.2;
|
||||
// if( !flag( "force_limp" ) )
|
||||
// level.player fall();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
fall()
|
||||
{
|
||||
level endon( "stop_stumble" );
|
||||
|
||||
flag_set( "fall" );
|
||||
|
||||
level.player setstance( "prone" );
|
||||
|
||||
level.player thread play_sound_on_entity( "bodyfall_gravel_large" );
|
||||
|
||||
level.ground_ref_ent childthread stumble( ( 20, 10, 30 ), .2, 1.5, true );
|
||||
|
||||
wait .2;
|
||||
set_vision_set( "aftermath_pain", 0 );
|
||||
|
||||
level.player PlayRumbleOnEntity( "grenade_rumble" );
|
||||
|
||||
level.player allowstand( false );
|
||||
level.player allowcrouch( false );
|
||||
level.player viewkick( 127, level.player.origin );
|
||||
level.player shellshock( "aftermath_fall", 3 );
|
||||
level notify( "slowview", 3.5 );
|
||||
|
||||
|
||||
// level.player PlayRumbleloopOnEntity( "damage_heavy" );
|
||||
|
||||
wait 1.5;
|
||||
flag_set( "fall" );
|
||||
|
||||
childthread recover();
|
||||
|
||||
level.player play_sound_in_space( "sprint_gasp" );
|
||||
level.player play_sound_in_space( "breathing_hurt_start" );
|
||||
level.player play_sound_in_space( "breathing_better" );
|
||||
|
||||
set_vision_set( "aftermath_walking", 5 );
|
||||
|
||||
level.player play_sound_on_entity( "breathing_better" );
|
||||
|
||||
flag_clear( "fall" );
|
||||
|
||||
level.player allowstand( true );
|
||||
level.player allowcrouch( true );
|
||||
level notify( "recovered" );
|
||||
}
|
||||
*/
|
||||
|
||||
stumble( stumble_angles, stumble_time, recover_time, no_notify )
|
||||
{
|
||||
level endon( "stop_stumble" );
|
||||
|
||||
if ( flag( "collapse" ) )
|
||||
return;
|
||||
|
||||
stumble_angles = adjust_angles_to_player( stumble_angles );
|
||||
|
||||
level.ground_ref_ent rotateto( stumble_angles, stumble_time, ( stumble_time / 4 * 3 ), ( stumble_time / 4 ) );
|
||||
level.ground_ref_ent waittill( "rotatedone" );
|
||||
|
||||
// if ( level.player getstance() == "stand" )
|
||||
// level.player PlayRumbleOnEntity( "damage_light" );
|
||||
|
||||
base_angles = ( randomfloat( 4 ) - 4, randomfloat( 5 ), 0 );
|
||||
base_angles = adjust_angles_to_player( base_angles );
|
||||
|
||||
level.ground_ref_ent rotateto( base_angles, recover_time, 0, recover_time / 2 );
|
||||
level.ground_ref_ent waittill( "rotatedone" );
|
||||
|
||||
if ( !isdefined( no_notify ) )
|
||||
level notify( "recovered" );
|
||||
}
|
||||
|
||||
recover()
|
||||
{
|
||||
angles = adjust_angles_to_player( ( -5, -5, 0 ) );
|
||||
level.ground_ref_ent rotateto( angles, .6, 0.6, 0 );
|
||||
level.ground_ref_ent waittill( "rotatedone" );
|
||||
|
||||
angles = adjust_angles_to_player( ( -15, -20, 0 ) );
|
||||
level.ground_ref_ent rotateto( angles, 2.5, 0, 2.5 );
|
||||
level.ground_ref_ent waittill( "rotatedone" );
|
||||
|
||||
angles = adjust_angles_to_player( ( 5, 5, 0 ) );
|
||||
level.ground_ref_ent rotateto( angles, 2.5, 2, 0.5 );
|
||||
level.ground_ref_ent waittill( "rotatedone" );
|
||||
|
||||
level.ground_ref_ent rotateto( ( 0, 0, 0 ), 1, 0.2, 0.8 );
|
||||
}
|
||||
|
||||
create_overlay_element( shader_name, start_alpha )
|
||||
{
|
||||
overlay = newHudElem();
|
||||
overlay.x = 0;
|
||||
overlay.y = 0;
|
||||
overlay setshader( shader_name, 640, 480 );
|
||||
overlay.alignX = "left";
|
||||
overlay.alignY = "top";
|
||||
overlay.horzAlign = "fullscreen";
|
||||
overlay.vertAlign = "fullscreen";
|
||||
overlay.alpha = start_alpha;
|
||||
overlay.foreground = true;
|
||||
return overlay;
|
||||
}
|
||||
|
||||
hud_hide( state )
|
||||
{
|
||||
wait 0.1;
|
||||
SetSavedDvar( "hud_showStance", 0 );
|
||||
SetSavedDvar( "compass", "0" );
|
||||
SetSavedDvar( "ammoCounterHide", "1" );
|
||||
}
|
||||
|
||||
+1111
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,65 @@
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type, no_death )
|
||||
{
|
||||
build_template( "ambulance", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_deathmodel( "vehicle_ambulance_russian" );
|
||||
build_radiusdamage( ( 0, 0, 32 ), 300, 200, 100, false );
|
||||
build_drive( %uaz_driving_idle_forward, %uaz_driving_idle_backward, 10 );
|
||||
build_deathquake( 1, 1.6, 500 );
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "axis" );
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
build_compassicon( "automobile", false );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 2;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "TAG_DRIVER";
|
||||
positions[ 1 ].sittag = "TAG_PASSENGER";
|
||||
|
||||
positions[ 0 ].idle = %uaz_driver_idle_drive;
|
||||
positions[ 1 ].idle = %uaz_passenger_idle_drive;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_ambulance_russian (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_ambulance::main( "vehicle_ambulance_russian" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_ambulance_russian
|
||||
sound,vehicle_ambulance,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_ambulance_russian"
|
||||
default:"vehicletype" "ambulance"
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+3312
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,94 @@
|
||||
#include common_scripts\utility;
|
||||
|
||||
#using_animtree( "animated_props" );
|
||||
main()
|
||||
{
|
||||
// wait until the end of the frame so that maps can init their trees
|
||||
// in their _anim instead of only above _load
|
||||
waittillframeend;
|
||||
|
||||
init_wind_if_uninitialized();
|
||||
|
||||
level.init_animatedmodels_dump = false;
|
||||
level.anim_prop_models_animtree = #animtree;
|
||||
|
||||
if ( !isdefined( level.anim_prop_models ) )
|
||||
level.anim_prop_models = [];// this is what the LD puts in their map
|
||||
|
||||
animated_models = GetEntArray( "animated_model", "targetname" );
|
||||
array_thread( animated_models, ::model_init );
|
||||
|
||||
// one or more of the models initialized by model_init() was not setup by the map
|
||||
// so print this helpful note so the designer can see how to add it ot their level
|
||||
if ( level.init_animatedmodels_dump )
|
||||
AssertMsg( "anims not cached for animated prop model, Repackage Zones and Rebuild Precache Script in Launcher:" );
|
||||
|
||||
// Handle blended tree anims differently
|
||||
foreach ( model in animated_models )
|
||||
{
|
||||
keys = GetArrayKeys( level.anim_prop_models[ model.model ] );
|
||||
scriptedWind = false;
|
||||
foreach ( key in keys )
|
||||
{
|
||||
if ( key == "still" )
|
||||
{
|
||||
scriptedWind = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( scriptedWind )
|
||||
model thread animateTreeWind();
|
||||
else
|
||||
model thread animateModel();
|
||||
}
|
||||
}
|
||||
|
||||
init_wind_if_uninitialized()
|
||||
{
|
||||
if ( IsDefined( level.wind ) )
|
||||
return;
|
||||
level.wind = SpawnStruct();
|
||||
level.wind.rate = 0.4;
|
||||
level.wind.weight = 1;
|
||||
level.wind.variance = 0.2;
|
||||
}
|
||||
|
||||
model_init()
|
||||
{
|
||||
if ( !isdefined( level.anim_prop_models[ self.model ] ) )
|
||||
level.init_animatedmodels_dump = true;
|
||||
}
|
||||
|
||||
// TODO: instead of purely random, do round-robin animation selection to get an even spread
|
||||
animateModel()
|
||||
{
|
||||
self UseAnimTree( #animtree );
|
||||
keys = GetArrayKeys( level.anim_prop_models[ self.model ] );
|
||||
animkey = keys[ RandomInt( keys.size ) ];
|
||||
animation = level.anim_prop_models[ self.model ][ animkey ];
|
||||
|
||||
self SetAnim( animation, 1, self GetAnimTime( animation ), 1 );
|
||||
self SetAnimTime( animation, RandomFloatRange( 0, 1 ) );
|
||||
}
|
||||
|
||||
animateTreeWind()
|
||||
{
|
||||
self UseAnimTree( #animtree );
|
||||
wind = "strong";
|
||||
while ( 1 )
|
||||
{
|
||||
thread blendTreeAnims( wind );
|
||||
level waittill( "windchange", wind );
|
||||
}
|
||||
}
|
||||
|
||||
blendTreeAnims( animation )
|
||||
{
|
||||
level endon( "windchange" );
|
||||
windweight = level.wind.weight;
|
||||
windrate = level.wind.rate + RandomFloat( level.wind.variance );
|
||||
self SetAnim( level.anim_prop_models[ self.model ][ "still" ], 1, self GetAnimTime( level.anim_prop_models[ self.model ][ "still" ] ), windrate );
|
||||
self SetAnim( level.anim_prop_models[ self.model ][ animation ], windweight, self GetAnimTime( level.anim_prop_models[ self.model ][ animation ] ), windrate );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "antonov", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_deathmodel( "vehicle_antonov_fly" );
|
||||
|
||||
level._effect[ "engineeffect" ] = loadfx( "fire/jet_engine_anatov" );
|
||||
|
||||
build_deathfx( "explosions/large_vehicle_explosion", undefined, "explo_metal_rand" );
|
||||
build_life( 999, 500, 1500 );
|
||||
build_rumble( "mig_rumble", 0.1, 0.2, 11300, 0.05, 0.05 );
|
||||
build_team( "allies" );
|
||||
build_compassicon( "plane", false );
|
||||
|
||||
randomStartDelay = randomfloatrange( 0, 1 );
|
||||
build_light( model, "wingtip_green", "TAG_LEFT_WINGTIP", "misc/aircraft_light_wingtip_green", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_red", "TAG_RIGHT_WINGTIP", "misc/aircraft_light_wingtip_red", "running", randomStartDelay );
|
||||
build_light( model, "tail_red", "TAG_TAIL", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "white_blink", "TAG_LIGHT_BELLY", "misc/aircraft_light_red_blink", "running", randomStartDelay );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
thread playEngineEffects();
|
||||
maps\_vehicle::lights_on( "running" );
|
||||
}
|
||||
|
||||
|
||||
playEngineEffects()
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "stop_engineeffects" );
|
||||
|
||||
self ent_flag_init( "engineeffects" );
|
||||
self ent_flag_set( "engineeffects" );
|
||||
engineeffects = getfx( "engineeffect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self ent_flag_wait( "engineeffects" );
|
||||
playfxontag( engineeffects, self, "tag_engine_right" );
|
||||
playfxontag( engineeffects, self, "tag_engine_right_2" );
|
||||
playfxontag( engineeffects, self, "tag_engine_left" );
|
||||
playfxontag( engineeffects, self, "tag_engine_left_2" );
|
||||
self ent_flag_waitopen( "engineeffects" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_left" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_left_2" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_right" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_right_2" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_antonov (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_antonov::main( "vehicle_antonov_fly" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_antonov
|
||||
sound,vehicle_antonov,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_antonov_fly"
|
||||
default:"vehicletype" "antonov"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,103 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "apache", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_apache" );
|
||||
build_deathmodel( "vehicle_apache_dark" );
|
||||
|
||||
apache_death_fx = [];
|
||||
apache_death_fx[ "vehicle_apache" ] = "explosions/helicopter_explosion_apache";
|
||||
apache_death_fx[ "vehicle_apache_dark" ] = "explosions/helicopter_explosion_apache_dark";
|
||||
|
||||
apache_aerial_death_fx = [];
|
||||
apache_aerial_death_fx[ "vehicle_apache" ] = "explosions/aerial_explosion_apache_mp";
|
||||
apache_aerial_death_fx[ "vehicle_apache_dark" ] = "explosions/aerial_explosion_apache_dark_mp";
|
||||
|
||||
build_drive( %bh_rotors, undefined, 0 );
|
||||
|
||||
//Bullet damage Crash and Burn, spins out of control and explodes when it reaches destination
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "tag_engine_left", "apache_helicopter_secondary_exp", undefined, undefined, undefined, 0.0, true );
|
||||
build_deathfx( "fire/fire_smoke_trail_L", "tag_engine_left", "apache_helicopter_dying_loop", true, 0.05, true, 0.5, true );
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "tag_engine_left", "apache_helicopter_secondary_exp", undefined, undefined, undefined, 2.5, true );
|
||||
build_deathfx( apache_death_fx[ model ], undefined, "apache_helicopter_crash", undefined, undefined, undefined, - 1, undefined, "stop_crash_loop_sound" );
|
||||
|
||||
//Death by Rocket effects, explodes immediatly
|
||||
build_rocket_deathfx( apache_aerial_death_fx[ model ], "tag_deathfx", "apache_helicopter_crash", undefined, undefined, undefined, undefined, true, undefined, 0 );
|
||||
|
||||
//light effects
|
||||
build_light( model, "wingtip_green", "tag_light_L_wing", "misc/aircraft_light_wingtip_green", "running", 0 );
|
||||
build_light( model, "wingtip_red", "tag_light_R_wing", "misc/aircraft_light_wingtip_red", "running", 0.05 );
|
||||
build_light( model, "white_blink", "tag_light_belly", "misc/aircraft_light_white_blink", "running", 0.1 );
|
||||
build_light( model, "white_blink_tail", "tag_light_tail", "misc/aircraft_light_red_blink", "running", 0.25 );
|
||||
|
||||
|
||||
build_life( 999, 500, 1500 );
|
||||
build_compassicon( "helicopter", false );
|
||||
build_treadfx();
|
||||
|
||||
|
||||
build_team( "allies" );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
self.script_badplace = false;// All helicopters dont need to create bad places
|
||||
maps\_vehicle::lights_on( "running" );
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 11;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].getout_delete = true;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_apache (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_apache::main( "vehicle_apache" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_apache_apache
|
||||
sound,vehicle_apache,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_apache"
|
||||
default:"vehicletype" "apache"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_apache_dark (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_apache::main( "vehicle_apache_dark" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_apache_dark_apache
|
||||
sound,vehicle_apache,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_apache_dark"
|
||||
default:"vehicletype" "apache"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+739
@@ -0,0 +1,739 @@
|
||||
// This function should take care of grain and glow settings for each map, plus anything else that artists
|
||||
// need to be able to tweak without bothering level designers.
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include common_scripts\_artCommon;
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
/#
|
||||
if ( GetDvar( "scr_art_tweak" ) == "" || GetDvar( "scr_art_tweak" ) == "0" )
|
||||
SetDvar( "scr_art_tweak", 0 );
|
||||
#/
|
||||
|
||||
if ( GetDvar( "scr_cmd_plr_sun" ) == "" )
|
||||
SetDevDvar( "scr_cmd_plr_sun", "0" );
|
||||
|
||||
if ( GetDvar( "scr_dof_enable" ) == "" )
|
||||
SetSavedDvar( "scr_dof_enable", "1" );
|
||||
|
||||
if ( GetDvar( "scr_cinematic_autofocus" ) == "" )
|
||||
SetDvar( "scr_cinematic_autofocus", "1" );
|
||||
|
||||
if ( GetDvar( "scr_art_visionfile" ) == "" )
|
||||
SetDvar( "scr_art_visionfile", level.script );
|
||||
|
||||
level.dofDefault[ "nearStart" ] = 1;
|
||||
level.dofDefault[ "nearEnd" ] = 1;
|
||||
level.dofDefault[ "farStart" ] = 500;
|
||||
level.dofDefault[ "farEnd" ] = 500;
|
||||
level.dofDefault[ "nearBlur" ] = 4.5;
|
||||
level.dofDefault[ "farBlur" ] = .05;
|
||||
|
||||
useDof = GetDvarInt( "scr_dof_enable" );
|
||||
|
||||
level.special_weapon_dof_funcs = [];
|
||||
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
player = level.players[ i ];
|
||||
|
||||
player.curDoF = ( level.dofDefault[ "farStart" ] - level.dofDefault[ "nearEnd" ] ) / 2;
|
||||
|
||||
if ( useDof )
|
||||
player thread adsDoF();
|
||||
}
|
||||
|
||||
thread tweakart();
|
||||
|
||||
if ( !isdefined( level.script ) )
|
||||
level.script = ToLower( GetDvar( "mapname" ) );
|
||||
|
||||
}
|
||||
|
||||
tweakart()
|
||||
{
|
||||
/#
|
||||
if ( !isdefined( level.tweakfile ) )
|
||||
level.tweakfile = false;
|
||||
|
||||
// not in DEVGUI
|
||||
SetDvar( "scr_fog_fraction", "1.0" );
|
||||
SetDvar( "scr_art_dump", "0" );
|
||||
|
||||
// update the devgui variables to current settings
|
||||
SetDvar( "scr_dof_nearStart", level.dofDefault[ "nearStart" ] );
|
||||
SetDvar( "scr_dof_nearEnd", level.dofDefault[ "nearEnd" ] );
|
||||
SetDvar( "scr_dof_farStart", level.dofDefault[ "farStart" ] );
|
||||
SetDvar( "scr_dof_farEnd", level.dofDefault[ "farEnd" ] );
|
||||
SetDvar( "scr_dof_nearBlur", level.dofDefault[ "nearBlur" ] );
|
||||
SetDvar( "scr_dof_farBlur", level.dofDefault[ "farBlur" ] );
|
||||
|
||||
// not in DEVGUI
|
||||
level.fogfraction = 1.0;
|
||||
|
||||
file = undefined;
|
||||
filename = undefined;
|
||||
|
||||
// set dofvars from < levelname > _art.gsc
|
||||
dofvarupdate();
|
||||
|
||||
printed = false;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
while ( GetDvarInt( "scr_art_tweak" ) == 0 )
|
||||
{
|
||||
// AssertEx( GetDvar( "scr_art_dump" ) == "0", "Must Enable Art Tweaks to export _art file." );
|
||||
wait .05;
|
||||
if ( ! GetDvarInt( "scr_art_tweak" ) == 0 )
|
||||
common_scripts\_artCommon::setfogsliders();// sets the sliders to whatever the current fog value is
|
||||
}
|
||||
|
||||
|
||||
if ( !printed )
|
||||
{
|
||||
printed = true;
|
||||
IPrintLnBold( "ART TWEAK ENABLED" );
|
||||
}
|
||||
|
||||
//translate the slider values to script variables
|
||||
common_scripts\_artCommon::translateFogSlidersToScript();
|
||||
|
||||
dofvarupdate();
|
||||
|
||||
// catch all those cases where a slider can be pushed to a place of conflict
|
||||
fovslidercheck();
|
||||
|
||||
dump = dumpsettings();// dumps and returns true if the dump dvar is set
|
||||
|
||||
common_scripts\_artCommon::updateFogFromScript();
|
||||
|
||||
level.player setDefaultDepthOfField();
|
||||
|
||||
if ( dump )
|
||||
{
|
||||
PrintLn( "Art settings dumped success!" );
|
||||
addstring = "maps\\createart\\" + level.script + "_art::main();";
|
||||
AssertEx( level.tweakfile, "remove all art setting in " + level.script + ".gsc and add the following line before _load: " + addstring );
|
||||
SetDvar( "scr_art_dump", "0" );
|
||||
}
|
||||
wait .05;
|
||||
}
|
||||
#/
|
||||
}
|
||||
|
||||
fovslidercheck()
|
||||
{
|
||||
// catch all those cases where a slider can be pushed to a place of conflict
|
||||
if ( level.dofDefault[ "nearStart" ] >= level.dofDefault[ "nearEnd" ] )
|
||||
{
|
||||
level.dofDefault[ "nearStart" ] = level.dofDefault[ "nearEnd" ] - 1;
|
||||
SetDvar( "scr_dof_nearStart", level.dofDefault[ "nearStart" ] );
|
||||
}
|
||||
if ( level.dofDefault[ "nearEnd" ] <= level.dofDefault[ "nearStart" ] )
|
||||
{
|
||||
level.dofDefault[ "nearEnd" ] = level.dofDefault[ "nearStart" ] + 1;
|
||||
SetDvar( "scr_dof_nearEnd", level.dofDefault[ "nearEnd" ] );
|
||||
}
|
||||
if ( level.dofDefault[ "farStart" ] >= level.dofDefault[ "farEnd" ] )
|
||||
{
|
||||
level.dofDefault[ "farStart" ] = level.dofDefault[ "farEnd" ] - 1;
|
||||
SetDvar( "scr_dof_farStart", level.dofDefault[ "farStart" ] );
|
||||
}
|
||||
if ( level.dofDefault[ "farEnd" ] <= level.dofDefault[ "farStart" ] )
|
||||
{
|
||||
level.dofDefault[ "farEnd" ] = level.dofDefault[ "farStart" ] + 1;
|
||||
SetDvar( "scr_dof_farEnd", level.dofDefault[ "farEnd" ] );
|
||||
}
|
||||
if ( level.dofDefault[ "farBlur" ] >= level.dofDefault[ "nearBlur" ] )
|
||||
{
|
||||
level.dofDefault[ "farBlur" ] = level.dofDefault[ "nearBlur" ] - .1;
|
||||
SetDvar( "scr_dof_farBlur", level.dofDefault[ "farBlur" ] );
|
||||
}
|
||||
if ( level.dofDefault[ "farStart" ] <= level.dofDefault[ "nearEnd" ] )
|
||||
{
|
||||
level.dofDefault[ "farStart" ] = level.dofDefault[ "nearEnd" ] + 1;
|
||||
SetDvar( "scr_dof_farStart", level.dofDefault[ "farStart" ] );
|
||||
}
|
||||
}
|
||||
|
||||
dumpsettings()
|
||||
{
|
||||
/#
|
||||
if ( GetDvar( "scr_art_dump" ) == "0" )
|
||||
return false;
|
||||
|
||||
filename = "createart/" + GetDvar( "scr_art_visionfile" ) + "_art.gsc";
|
||||
|
||||
//////////////////
|
||||
|
||||
file = 1;
|
||||
|
||||
fileprint_launcher_start_file();
|
||||
|
||||
fileprint_launcher( "// _createart generated. modify at your own risk. Changing values should be fine." );
|
||||
fileprint_launcher( "main()" );
|
||||
fileprint_launcher( "{" );
|
||||
|
||||
fileprint_launcher( "" );
|
||||
fileprint_launcher( "\tlevel.tweakfile = true;" );
|
||||
|
||||
artfxprintlnFog();
|
||||
|
||||
fileprint_launcher( "\tmaps\\_utility::set_vision_set( \"" + level.script + "\", 0 );" );
|
||||
|
||||
fileprint_launcher( "" );
|
||||
fileprint_launcher( "}" );
|
||||
|
||||
if ( ! artEndFogFileExport() )
|
||||
return false;
|
||||
//////////////////////////////
|
||||
|
||||
visionFilename = "vision/" + GetDvar( "scr_art_visionfile" ) + ".vision";
|
||||
// file = OpenFile( visionFilename, "write" );
|
||||
|
||||
file = 1;
|
||||
|
||||
// AssertEx( ( file != -1 ), "File not writeable( may need checked out of P4 ): " + filename );
|
||||
artStartVisionFileExport();
|
||||
|
||||
fileprint_launcher( "r_glow \"" + GetDvar( "r_glowTweakEnable" ) + "\"" );
|
||||
fileprint_launcher( "r_glowRadius0 \"" + GetDvar( "r_glowTweakRadius0" ) + "\"" );
|
||||
fileprint_launcher( "r_glowBloomCutoff \"" + GetDvar( "r_glowTweakBloomCutoff" ) + "\"" );
|
||||
fileprint_launcher( "r_glowBloomDesaturation \"" + GetDvar( "r_glowTweakBloomDesaturation" ) + "\"" );
|
||||
fileprint_launcher( "r_glowBloomIntensity0 \"" + GetDvar( "r_glowTweakBloomIntensity0" ) + "\"" );
|
||||
fileprint_launcher( " " );
|
||||
fileprint_launcher( "r_filmEnable \"" + GetDvar( "r_filmTweakEnable" ) + "\"" );
|
||||
fileprint_launcher( "r_filmContrast \"" + GetDvar( "r_filmTweakContrast" ) + "\"" );
|
||||
fileprint_launcher( "r_filmBrightness \"" + GetDvar( "r_filmTweakBrightness" ) + "\"" );
|
||||
fileprint_launcher( "r_filmDesaturation \"" + GetDvar( "r_filmTweakDesaturation" ) + "\"" );
|
||||
fileprint_launcher( "r_filmDesaturationDark \"" + GetDvar( "r_filmTweakDesaturationDark" ) + "\"" );
|
||||
fileprint_launcher( "r_filmInvert \"" + GetDvar( "r_filmTweakInvert" ) + "\"" );
|
||||
fileprint_launcher( "r_filmLightTint \"" + GetDvar( "r_filmTweakLightTint" ) + "\"" );
|
||||
fileprint_launcher( "r_filmMediumTint \"" + GetDvar( "r_filmTweakMediumTint" ) + "\"" );
|
||||
fileprint_launcher( "r_filmDarkTint \"" + GetDvar( "r_filmTweakDarkTint" ) + "\"" );
|
||||
fileprint_launcher( " " );
|
||||
fileprint_launcher( "r_primaryLightUseTweaks \"" + GetDvar( "r_primaryLightUseTweaks" ) + "\"" );
|
||||
fileprint_launcher( "r_primaryLightTweakDiffuseStrength \"" + GetDvar( "r_primaryLightTweakDiffuseStrength" ) + "\"" );
|
||||
fileprint_launcher( "r_primaryLightTweakSpecularStrength \"" + GetDvar( "r_primaryLightTweakSpecularStrength" ) + "\"" );
|
||||
|
||||
if ( ! artEndVisionFileExport() )
|
||||
return false;
|
||||
|
||||
PrintLn( "CREATE ART DUMP SUCCESS!" );
|
||||
|
||||
return true;
|
||||
#/
|
||||
}
|
||||
|
||||
|
||||
|
||||
cloudlight( sunlight_bright, sunlight_dark, diffuse_high, diffuse_low )
|
||||
{
|
||||
level.sunlight_bright = sunlight_bright;
|
||||
level.sunlight_dark = sunlight_dark;
|
||||
level.diffuse_high = diffuse_high;
|
||||
level.diffuse_low = diffuse_low;
|
||||
|
||||
SetDvar( "r_lighttweaksunlight", level.sunlight_dark );
|
||||
SetDvar( "r_lighttweakdiffusefraction", level.diffuse_low );
|
||||
direction = "up";
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
sunlight = GetDvarFloat( "r_lighttweaksunlight" );
|
||||
jitter = scale( 1 + RandomInt( 21 ) );
|
||||
|
||||
flip = RandomInt( 2 );
|
||||
if ( flip )
|
||||
jitter = jitter * -1;
|
||||
|
||||
if ( direction == "up" )
|
||||
next_target = sunlight + scale( 30 ) + jitter;
|
||||
else
|
||||
next_target = sunlight - scale( 30 ) + jitter;
|
||||
|
||||
// IPrintLn( "jitter = ", jitter );
|
||||
if ( next_target >= level.sunlight_bright )
|
||||
{
|
||||
next_target = level.sunlight_bright;
|
||||
direction = "down";
|
||||
}
|
||||
|
||||
if ( next_target <= level.sunlight_dark )
|
||||
{
|
||||
next_target = level.sunlight_dark;
|
||||
direction = "up";
|
||||
}
|
||||
|
||||
if ( next_target > sunlight )
|
||||
brighten( next_target, ( 3 + RandomInt( 3 ) ), .05 );
|
||||
else
|
||||
darken( next_target, ( 3 + RandomInt( 3 ) ), .05 );
|
||||
}
|
||||
}
|
||||
|
||||
brighten( target_sunlight, time, freq )
|
||||
{
|
||||
// IPrintLn( "Brightening sunlight to ", target_sunlight );
|
||||
sunlight = GetDvarFloat( "r_lighttweaksunlight" );
|
||||
// diffuse = GetDvarFloat( "r_lighttweakdiffusefraction" );
|
||||
// IPrintLn( "sunlight = ", sunlight );
|
||||
// IPrintLn( "diffuse = ", diffuse );
|
||||
|
||||
totalchange = target_sunlight - sunlight;
|
||||
changeamount = totalchange / ( time / freq );
|
||||
// IPrintLn( "totalchange = ", totalchange );
|
||||
// IPrintLn( "changeamount = ", changeamount );
|
||||
|
||||
while ( time > 0 )
|
||||
{
|
||||
time = time - freq;
|
||||
|
||||
sunlight = sunlight + changeamount;
|
||||
SetDvar( "r_lighttweaksunlight", sunlight );
|
||||
// IPrintLn( "^6sunlight = ", sunlight );
|
||||
|
||||
frac = ( sunlight - level.sunlight_dark ) / ( level.sunlight_bright - level.sunlight_dark );
|
||||
diffuse = level.diffuse_high + ( level.diffuse_low - level.diffuse_high ) * frac;
|
||||
SetDvar( "r_lighttweakdiffusefraction", diffuse );
|
||||
// IPrintLn( "^6diffuse = ", diffuse );
|
||||
|
||||
wait freq;
|
||||
}
|
||||
}
|
||||
|
||||
darken( target_sunlight, time, freq )
|
||||
{
|
||||
// IPrintLn( "Darkening sunlight to ", target_sunlight );
|
||||
sunlight = GetDvarFloat( "r_lighttweaksunlight" );
|
||||
// diffuse = GetDvarFloat( "r_lighttweakdiffusefraction" );
|
||||
// IPrintLn( "sunlight = ", sunlight );
|
||||
// IPrintLn( "diffuse = ", diffuse );
|
||||
|
||||
totalchange = sunlight - target_sunlight;
|
||||
changeamount = totalchange / ( time / freq );
|
||||
// IPrintLn( "totalchange = ", totalchange );
|
||||
// IPrintLn( "changeamount = ", changeamount );
|
||||
|
||||
while ( time > 0 )
|
||||
{
|
||||
time = time - freq;
|
||||
|
||||
sunlight = sunlight - changeamount;
|
||||
SetDvar( "r_lighttweaksunlight", sunlight );
|
||||
// IPrintLn( "^6sunlight = ", sunlight );
|
||||
|
||||
frac = ( sunlight - level.sunlight_dark ) / ( level.sunlight_bright - level.sunlight_dark );
|
||||
diffuse = level.diffuse_high + ( level.diffuse_low - level.diffuse_high ) * frac;
|
||||
SetDvar( "r_lighttweakdiffusefraction", diffuse );
|
||||
// IPrintLn( "^6diffuse = ", diffuse );
|
||||
|
||||
wait freq;
|
||||
}
|
||||
}
|
||||
|
||||
scale( percent )
|
||||
{
|
||||
frac = percent / 100;
|
||||
return( level.sunlight_dark + frac * ( level.sunlight_bright - level.sunlight_dark ) ) - level.sunlight_dark;
|
||||
}
|
||||
|
||||
|
||||
adsDoF()
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
|
||||
self.dof = level.dofDefault;
|
||||
art_tweak = false;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait( 0.05 );
|
||||
|
||||
if ( level.level_specific_dof )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ( GetDvarInt( "scr_cinematic" ) )
|
||||
{
|
||||
updateCinematicDoF();
|
||||
continue;
|
||||
}
|
||||
|
||||
/# art_tweak = GetDvarInt( "scr_art_tweak" ); #/
|
||||
|
||||
if ( GetDvarInt( "scr_dof_enable" ) && !art_tweak )
|
||||
{
|
||||
updateDoF();
|
||||
continue;
|
||||
}
|
||||
|
||||
self setDefaultDepthOfField();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
updateCinematicDoF()
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
|
||||
adsFrac = self PlayerAds();
|
||||
|
||||
if ( adsFrac == 1 && GetDvarInt( "scr_cinematic_autofocus" ) )
|
||||
{
|
||||
traceDir = VectorNormalize( AnglesToForward( self GetPlayerAngles() ) );
|
||||
trace = BulletTrace( self GetEye(), self GetEye() + vector_multiply( traceDir, 100000 ), true, self );
|
||||
|
||||
enemies = GetAIArray();
|
||||
nearEnd = 10000;
|
||||
farStart = -1;
|
||||
start_origin = self GetEye();
|
||||
start_angles = self GetPlayerAngles();
|
||||
bestDot = 0;
|
||||
bestFocalPoint = undefined;
|
||||
for ( index = 0; index < enemies.size; index++ )
|
||||
{
|
||||
end_origin = enemies[ index ].origin;
|
||||
normal = VectorNormalize( end_origin - start_origin );
|
||||
forward = AnglesToForward( start_angles );
|
||||
dot = VectorDot( forward, normal );
|
||||
|
||||
if ( dot > bestDot )
|
||||
{
|
||||
bestDot = dot;
|
||||
bestFocalPoint = enemies[ index ].origin;
|
||||
}
|
||||
}
|
||||
|
||||
if ( bestDot < 0.923 )
|
||||
{
|
||||
scrDoF = Distance( start_origin, trace[ "position" ] );
|
||||
// scrDoF = GetDvarInt( "scr_cinematic_doffocus" ) * 39;
|
||||
}
|
||||
else
|
||||
{
|
||||
scrDoF = Distance( start_origin, bestFocalPoint );
|
||||
}
|
||||
|
||||
changeDoFValue( "nearStart", 1, 200 );
|
||||
changeDoFValue( "nearEnd", scrDoF, 200 );
|
||||
changeDoFValue( "farStart", scrDoF + 196, 200 );
|
||||
changeDoFValue( "farEnd", ( scrDoF + 196 ) * 2, 200 );
|
||||
changeDoFValue( "nearBlur", 6, 0.1 );
|
||||
changeDoFValue( "farBlur", 3.6, 0.1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
scrDoF = GetDvarInt( "scr_cinematic_doffocus" ) * 39;
|
||||
|
||||
if ( self.curDoF != scrDoF )
|
||||
{
|
||||
changeDoFValue( "nearStart", 1, 100 );
|
||||
changeDoFValue( "nearEnd", scrDoF, 100 );
|
||||
changeDoFValue( "farStart", scrDoF + 196, 100 );
|
||||
changeDoFValue( "farEnd", ( scrDoF + 196 ) * 2, 100 );
|
||||
changeDoFValue( "nearBlur", 6, 0.1 );
|
||||
changeDoFValue( "farBlur", 3.6, 0.1 );
|
||||
}
|
||||
}
|
||||
|
||||
self.curDoF = ( self.dof[ "farStart" ] - self.dof[ "nearEnd" ] ) / 2;
|
||||
|
||||
self SetDepthOfField(
|
||||
self.dof[ "nearStart" ],
|
||||
self.dof[ "nearEnd" ],
|
||||
self.dof[ "farStart" ],
|
||||
self.dof[ "farEnd" ],
|
||||
self.dof[ "nearBlur" ],
|
||||
self.dof[ "farBlur" ]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
updateDoF()
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
adsFrac = self PlayerAds();
|
||||
|
||||
if ( adsFrac == 0.0 )
|
||||
{
|
||||
self setDefaultDepthOfField();
|
||||
return;
|
||||
}
|
||||
|
||||
playerEye = self GetEye();
|
||||
playerAngles = self GetPlayerAngles();
|
||||
playerForward = VectorNormalize( AnglesToForward( playerAngles ) );
|
||||
|
||||
trace = BulletTrace( playerEye, playerEye + vector_multiply( playerForward, 8192 ), true, self, true );
|
||||
enemies = GetAIArray( "axis" );
|
||||
|
||||
weapon = self getcurrentweapon();
|
||||
if ( isdefined( level.special_weapon_dof_funcs[ weapon ] ) )
|
||||
{
|
||||
[[ level.special_weapon_dof_funcs[ weapon ] ]]( trace, enemies, playerEye, playerForward, adsFrac );
|
||||
return;
|
||||
}
|
||||
|
||||
nearEnd = 10000;
|
||||
farStart = -1;
|
||||
|
||||
for ( index = 0; index < enemies.size; index++ )
|
||||
{
|
||||
enemyDir = VectorNormalize( enemies[ index ].origin - playerEye );
|
||||
|
||||
dot = VectorDot( playerForward, enemyDir );
|
||||
if ( dot < 0.923 )// 45 degrees
|
||||
continue;
|
||||
|
||||
distFrom = Distance( playerEye, enemies[ index ].origin );
|
||||
|
||||
if ( distFrom - 30 < nearEnd )
|
||||
nearEnd = distFrom - 30;
|
||||
|
||||
if ( distFrom + 30 > farStart )
|
||||
farStart = distFrom + 30;
|
||||
}
|
||||
|
||||
if ( nearEnd > farStart )
|
||||
{
|
||||
nearEnd = 256;
|
||||
farStart = 2500;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( nearEnd < 50 )
|
||||
nearEnd = 50;
|
||||
else
|
||||
if ( nearEnd > 512 )
|
||||
nearEnd = 512;
|
||||
|
||||
if ( farStart > 2500 )
|
||||
farStart = 2500;
|
||||
else
|
||||
if ( farStart < 1000 )
|
||||
farStart = 1000;
|
||||
}
|
||||
|
||||
traceDist = Distance( playerEye, trace[ "position" ] );
|
||||
|
||||
if ( nearEnd > traceDist )
|
||||
nearEnd = traceDist - 30;
|
||||
|
||||
if ( nearEnd < 1 )
|
||||
nearEnd = 1;
|
||||
|
||||
if ( farStart < traceDist )
|
||||
farSTart = traceDist;
|
||||
|
||||
self setDoFTarget( adsFrac, 1, nearEnd, farStart, farStart * 4, 6, 1.8 );
|
||||
}
|
||||
|
||||
javelin_dof( trace, enemies, playerEye, playerForward, adsFrac )
|
||||
{
|
||||
if ( adsFrac < 0.88 )
|
||||
{
|
||||
self setDefaultDepthOfField();
|
||||
return;
|
||||
}
|
||||
|
||||
nearEnd = 10000;
|
||||
farStart = -1;
|
||||
nearEnd = 2400;
|
||||
nearStart = 2400;
|
||||
|
||||
for ( index = 0; index < enemies.size; index++ )
|
||||
{
|
||||
enemyDir = VectorNormalize( enemies[ index ].origin - playerEye );
|
||||
|
||||
dot = VectorDot( playerForward, enemyDir );
|
||||
if ( dot < 0.923 )// 45 degrees
|
||||
continue;
|
||||
|
||||
distFrom = Distance( playerEye, enemies[ index ].origin );
|
||||
if ( distFrom < 2500 )
|
||||
distFrom = 2500;
|
||||
|
||||
if ( distFrom - 30 < nearEnd )
|
||||
nearEnd = distFrom - 30;
|
||||
|
||||
if ( distFrom + 30 > farStart )
|
||||
farStart = distFrom + 30;
|
||||
}
|
||||
|
||||
|
||||
if ( nearEnd > farStart )
|
||||
{
|
||||
nearEnd = 2400;
|
||||
farStart = 3000;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( nearEnd < 50 )
|
||||
nearEnd = 50;
|
||||
|
||||
if ( farStart > 2500 )
|
||||
farStart = 2500;
|
||||
else
|
||||
if ( farStart < 1000 )
|
||||
farStart = 1000;
|
||||
}
|
||||
|
||||
traceDist = Distance( playerEye, trace[ "position" ] );
|
||||
if ( traceDist < 2500 )
|
||||
traceDist = 2500;
|
||||
|
||||
if ( nearEnd > traceDist )
|
||||
nearEnd = traceDist - 30;
|
||||
|
||||
if ( nearEnd < 1 )
|
||||
nearEnd = 1;
|
||||
|
||||
if ( farStart < traceDist )
|
||||
farSTart = traceDist;
|
||||
|
||||
if ( nearStart >= nearEnd )
|
||||
nearStart = nearEnd - 1;
|
||||
|
||||
self setDoFTarget( adsFrac, nearStart, nearEnd, farStart, farStart * 4, 4, 1.8 );
|
||||
}
|
||||
|
||||
setDoFTarget( adsFrac, nearStart, nearEnd, farStart, farEnd, nearBlur, farBlur )
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
|
||||
|
||||
if ( adsFrac == 1 )
|
||||
{
|
||||
changeDoFValue( "nearStart", nearStart, 50 );
|
||||
changeDoFValue( "nearEnd", nearEnd, 50 );
|
||||
changeDoFValue( "farStart", farStart, 400 );
|
||||
changeDoFValue( "farEnd", farEnd, 400 );
|
||||
changeDoFValue( "nearBlur", nearBlur, 0.1 );
|
||||
changeDoFValue( "farBlur", farBlur, 0.1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
lerpDoFValue( "nearStart", nearStart, adsFrac );
|
||||
lerpDoFValue( "nearEnd", nearEnd, adsFrac );
|
||||
lerpDoFValue( "farStart", farStart, adsFrac );
|
||||
lerpDoFValue( "farEnd", farEnd, adsFrac );
|
||||
lerpDoFValue( "nearBlur", nearBlur, adsFrac );
|
||||
lerpDoFValue( "farBlur", farBlur, adsFrac );
|
||||
}
|
||||
|
||||
self SetDepthOfField(
|
||||
self.dof[ "nearStart" ],
|
||||
self.dof[ "nearEnd" ],
|
||||
self.dof[ "farStart" ],
|
||||
self.dof[ "farEnd" ],
|
||||
self.dof[ "nearBlur" ],
|
||||
self.dof[ "farBlur" ]
|
||||
);
|
||||
}
|
||||
|
||||
changeDoFValue( valueName, targetValue, maxChange )
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
|
||||
if ( self.dof[ valueName ] > targetValue )
|
||||
{
|
||||
changeVal = ( self.dof[ valueName ] - targetValue ) * 0.5;
|
||||
if ( changeVal > maxChange )
|
||||
changeVal = maxChange;
|
||||
else if ( changeVal < 1 )
|
||||
changeVal = 1;
|
||||
|
||||
if ( self.dof[ valueName ] - changeVal < targetValue )
|
||||
self.dof[ valueName ] = targetValue;
|
||||
else
|
||||
self.dof[ valueName ] -= changeVal;
|
||||
}
|
||||
else if ( self.dof[ valueName ] < targetValue )
|
||||
{
|
||||
changeVal = ( targetValue - self.dof[ valueName ] ) * 0.5;
|
||||
if ( changeVal > maxChange )
|
||||
changeVal = maxChange;
|
||||
else if ( changeVal < 1 )
|
||||
changeVal = 1;
|
||||
|
||||
if ( self.dof[ valueName ] + changeVal > targetValue )
|
||||
self.dof[ valueName ] = targetValue;
|
||||
else
|
||||
self.dof[ valueName ] += changeVal;
|
||||
}
|
||||
}
|
||||
|
||||
lerpDoFValue( valueName, targetValue, lerpAmount )
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
|
||||
self.dof[ valueName ] = level.dofDefault[ valueName ] + ( ( targetValue - level.dofDefault[ valueName ] ) * lerpAmount ) ;
|
||||
}
|
||||
|
||||
dofvarupdate()
|
||||
{
|
||||
level.dofDefault[ "nearStart" ] = GetDvarInt( "scr_dof_nearStart" );
|
||||
level.dofDefault[ "nearEnd" ] = GetDvarInt( "scr_dof_nearEnd" );
|
||||
level.dofDefault[ "farStart" ] = GetDvarInt( "scr_dof_farStart" );
|
||||
level.dofDefault[ "farEnd" ] = GetDvarInt( "scr_dof_farEnd" );
|
||||
level.dofDefault[ "nearBlur" ] = GetDvarFloat( "scr_dof_nearBlur" );
|
||||
level.dofDefault[ "farBlur" ] = GetDvarFloat( "scr_dof_farBlur" );
|
||||
}
|
||||
|
||||
setdefaultdepthoffield()
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
|
||||
if ( isdefined( self.dofDefault ) )
|
||||
{
|
||||
self SetDepthOfField(
|
||||
self.dofDefault[ "nearStart" ],
|
||||
self.dofDefault[ "nearEnd" ],
|
||||
self.dofDefault[ "farStart" ],
|
||||
self.dofDefault[ "farEnd" ],
|
||||
self.dofDefault[ "nearBlur" ],
|
||||
self.dofDefault[ "farBlur" ]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
self SetDepthOfField(
|
||||
level.dofDefault[ "nearStart" ],
|
||||
level.dofDefault[ "nearEnd" ],
|
||||
level.dofDefault[ "farStart" ],
|
||||
level.dofDefault[ "farEnd" ],
|
||||
level.dofDefault[ "nearBlur" ],
|
||||
level.dofDefault[ "farBlur" ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
isDoFDefault()
|
||||
{
|
||||
if ( level.dofDefault[ "nearStart" ] != GetDvarInt( "scr_dof_nearStart" ) )
|
||||
return false;
|
||||
|
||||
if ( level.dofDefault[ "nearEnd" ] != GetDvarInt( "scr_dof_nearEnd" ) )
|
||||
return false;
|
||||
|
||||
if ( level.dofDefault[ "farStart" ] != GetDvarInt( "scr_dof_farStart" ) )
|
||||
return false;
|
||||
|
||||
if ( level.dofDefault[ "farEnd" ] != GetDvarInt( "scr_dof_farEnd" ) )
|
||||
return false;
|
||||
|
||||
if ( level.dofDefault[ "nearBlur" ] != GetDvarInt( "scr_dof_nearBlur" ) )
|
||||
return false;
|
||||
|
||||
if ( level.dofDefault[ "farBlur" ] != GetDvarInt( "scr_dof_farBlur" ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,688 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
main()
|
||||
{
|
||||
level.lastAutoSaveTime = 0;
|
||||
flag_init( "game_saving" );
|
||||
flag_init( "can_save" );
|
||||
flag_set( "can_save" );
|
||||
flag_init( "disable_autosaves" );
|
||||
if ( !isdefined( level._extra_autosave_checks ) )
|
||||
level._extra_autosave_checks = [];
|
||||
|
||||
level.autosave_proximity_threat_func = ::autosave_proximity_threat_func;
|
||||
}
|
||||
|
||||
getDescription()
|
||||
{
|
||||
// autosave
|
||||
return( &"AUTOSAVE_AUTOSAVE" );
|
||||
}
|
||||
|
||||
getnames( num )
|
||||
{
|
||||
if ( num == 0 )
|
||||
// Begin Game Autosave
|
||||
savedescription = &"AUTOSAVE_GAME";
|
||||
else
|
||||
// No Name Specified
|
||||
savedescription = &"AUTOSAVE_NOGAME";
|
||||
|
||||
return savedescription;
|
||||
}
|
||||
|
||||
|
||||
beginningOfLevelSave()
|
||||
{
|
||||
// Wait for introscreen to finish
|
||||
level waittill( "finished final intro screen fadein" );
|
||||
|
||||
if ( level.MissionFailed )
|
||||
return;
|
||||
|
||||
if ( maps\_arcademode::arcademode_complete() )
|
||||
return;
|
||||
|
||||
if ( flag( "game_saving" ) )
|
||||
return;
|
||||
|
||||
flag_set( "game_saving" );
|
||||
|
||||
imagename = "levelshots / autosave / autosave_" + level.script + "start";
|
||||
|
||||
// "levelstart" is recognized by the saveGame command as a special save game
|
||||
// Start
|
||||
SaveGame( "levelstart", &"AUTOSAVE_LEVELSTART", imagename, true );
|
||||
SetDvar( "ui_grenade_death", "0" );
|
||||
PrintLn( "Saving level start saved game" );
|
||||
|
||||
flag_clear( "game_saving" );
|
||||
}
|
||||
|
||||
trigger_autosave_stealth( trigger )
|
||||
{
|
||||
trigger waittill( "trigger" );
|
||||
autosave_stealth();
|
||||
}
|
||||
|
||||
trigger_autosave_tactical( trigger )
|
||||
{
|
||||
trigger waittill( "trigger" );
|
||||
autosave_tactical();
|
||||
}
|
||||
|
||||
trigger_autosave( trigger )
|
||||
{
|
||||
if ( !isdefined( trigger.script_autosave ) )
|
||||
trigger.script_autosave = 0;
|
||||
|
||||
autosaves_think( trigger );
|
||||
}
|
||||
|
||||
autosaves_think( trigger )
|
||||
{
|
||||
savedescription = getnames( trigger.script_autosave );
|
||||
|
||||
if ( !( IsDefined( savedescription ) ) )
|
||||
{
|
||||
PrintLn( "autosave", self.script_autosave, " with no save description in _autosave.gsc!" );
|
||||
return;
|
||||
}
|
||||
|
||||
trigger waittill( "trigger" );
|
||||
|
||||
num = trigger.script_autosave;
|
||||
imagename = "levelshots / autosave / autosave_" + level.script + num;
|
||||
|
||||
tryAutoSave( num, savedescription, imagename );
|
||||
thread maps\_quotes::setDeadQuote();
|
||||
|
||||
if ( IsDefined( trigger ) )
|
||||
trigger Delete();
|
||||
}
|
||||
|
||||
|
||||
autoSaveNameThink( trigger )
|
||||
{
|
||||
if ( level.start_point == "no_game" )
|
||||
return;
|
||||
|
||||
trigger waittill( "trigger" );
|
||||
if ( IsDefined( level.customautosavecheck ) )
|
||||
if ( ![[ level.customautosavecheck ]]() )
|
||||
return;
|
||||
name = trigger.script_autosavename;
|
||||
maps\_utility::autosave_by_name( name );
|
||||
|
||||
trigger Delete();
|
||||
}
|
||||
|
||||
|
||||
trigger_autosave_immediate( trigger )
|
||||
{
|
||||
trigger waittill( "trigger" );
|
||||
// Start
|
||||
// saveId = SaveGameNoCommit( 1, &"AUTOSAVE_LEVELSTART", "autosave_image" );
|
||||
// CommitSave( saveId );
|
||||
}
|
||||
|
||||
AutoSavePrint( msg, msg2 )
|
||||
{
|
||||
/#
|
||||
SetDvarIfUninitialized( "scr_autosave_debug", "0" );
|
||||
if ( GetDebugDvarInt( "scr_autosave_debug" ) == 1 )
|
||||
{
|
||||
if ( IsDefined( msg2 ) )
|
||||
IPrintLn( msg + " [ localized description ]" );
|
||||
else
|
||||
IPrintLn( msg );
|
||||
return;
|
||||
}
|
||||
#/
|
||||
|
||||
if ( IsDefined( msg2 ) )
|
||||
PrintLn( msg, msg2 );
|
||||
else
|
||||
PrintLn( msg );
|
||||
}
|
||||
|
||||
autosave_timeout( timeout )
|
||||
{
|
||||
level endon( "trying_new_autosave" );
|
||||
level endon( "autosave_complete" );
|
||||
wait( timeout );
|
||||
flag_clear( "game_saving" );
|
||||
level notify( "autosave_timeout" );
|
||||
}
|
||||
|
||||
_autosave_game_now_nochecks()
|
||||
{
|
||||
imagename = "levelshots / autosave / autosave_" + level.script + "start";
|
||||
// Start
|
||||
SaveGame( "levelstart", &"AUTOSAVE_LEVELSTART", imagename, true );
|
||||
}
|
||||
|
||||
_autosave_game_now( suppress_print )
|
||||
{
|
||||
if ( isdefined( level.MissionFailed ) && level.MissionFailed )
|
||||
return;
|
||||
|
||||
if ( flag( "game_saving" ) )
|
||||
return false;
|
||||
|
||||
if ( maps\_arcademode::arcademode_complete() )
|
||||
return false;
|
||||
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
player = level.players[ i ];
|
||||
if ( !isalive( player ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
filename = "save_now";
|
||||
descriptionString = getDescription();
|
||||
|
||||
if ( IsDefined( suppress_print ) )
|
||||
saveId = SaveGameNoCommit( filename, descriptionString, "$default", true );
|
||||
else
|
||||
saveId = SaveGameNoCommit( filename, descriptionString );
|
||||
|
||||
wait( 0.05 );// code request
|
||||
if ( IsSaveRecentlyLoaded() )
|
||||
{
|
||||
level.lastAutoSaveTime = GetTime();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/# AutoSavePrint( "Saving game " + filename + " with desc ", descriptionString ); #/
|
||||
|
||||
if ( saveId < 0 )
|
||||
{
|
||||
/# AutoSavePrint( "Savegame failed - save error.: " + filename + " with desc ", descriptionString ); #/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ( !try_to_autosave_now() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
flag_set( "game_saving" );
|
||||
wait 2;
|
||||
flag_clear( "game_saving" );
|
||||
|
||||
if ( !CommitWouldBeValid( saveId ) )
|
||||
{
|
||||
/# AutoSavePrint( "Save is no longer valid, another save was run from elsewhere" ); #/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// are we still healthy 2 seconds later? k save then
|
||||
if ( try_to_autosave_now() )
|
||||
{
|
||||
if ( !isdefined( suppress_print ) )
|
||||
thread maps\_arcademode::arcademode_checkpoint_print();
|
||||
|
||||
CommitSave( saveId );
|
||||
SetDvar( "ui_grenade_death", "0" );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
autosave_now_trigger( trigger )
|
||||
{
|
||||
trigger waittill( "trigger" );
|
||||
autosave_now();
|
||||
}
|
||||
|
||||
try_to_autosave_now()
|
||||
{
|
||||
if ( !issavesuccessful() )
|
||||
return false;
|
||||
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
player = level.players[ i ];
|
||||
if ( !player autoSaveHealthCheck() )
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !flag( "can_save" ) )
|
||||
{
|
||||
/# AutoSavePrint( "Can_save flag was clear" ); #/
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
tryAutoSave( filename, description, image, timeout, doStealthChecks, suppress_print )
|
||||
{
|
||||
if ( flag( "disable_autosaves" ) )
|
||||
return false;
|
||||
|
||||
level endon( "nextmission" );
|
||||
level.player endon( "death" );
|
||||
if ( is_coop() )
|
||||
level.player2 endon( "death" );
|
||||
|
||||
level notify( "trying_new_autosave" );
|
||||
|
||||
if ( flag( "game_saving" ) )
|
||||
return false;
|
||||
|
||||
if ( IsDefined( level.nextmission ) )
|
||||
return false;
|
||||
|
||||
time1 = 1.25;
|
||||
time2 = 1.25;
|
||||
|
||||
if ( IsDefined( timeout ) && timeout < time1 + time2 )
|
||||
{
|
||||
AssertMsg( "Warning, tried to do an autosave_or_timeout with a time less than " + ( time1 + time2 ) );
|
||||
}
|
||||
|
||||
if ( !isdefined( suppress_print ) )
|
||||
suppress_print = false;
|
||||
if ( !isdefined( image ) )
|
||||
image = "$default";
|
||||
|
||||
if ( !isdefined( doStealthChecks ) )
|
||||
doStealthChecks = false;
|
||||
|
||||
flag_set( "game_saving" );
|
||||
|
||||
descriptionString = getDescription();
|
||||
start_save_time = GetTime();
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
if ( autoSaveCheck( undefined, doStealthChecks ) )
|
||||
{
|
||||
saveId = SaveGameNoCommit( filename, descriptionString, image, suppress_print );
|
||||
/# AutoSavePrint( "Saving game " + filename + " with desc ", descriptionString ); #/
|
||||
|
||||
if ( saveId < 0 )
|
||||
{
|
||||
/# AutoSavePrint( "Savegame failed - save error.: " + filename + " with desc ", descriptionString ); #/
|
||||
break;
|
||||
}
|
||||
|
||||
wait( 0.05 );// code request
|
||||
if ( IsSaveRecentlyLoaded() )
|
||||
{
|
||||
level.lastAutoSaveTime = GetTime();
|
||||
break;
|
||||
}
|
||||
|
||||
wait time1;
|
||||
|
||||
if ( extra_autosave_checks_failed() )
|
||||
continue;
|
||||
|
||||
if ( !autoSaveCheck( undefined, doStealthChecks ) )
|
||||
{
|
||||
/# AutoSavePrint( "Savegame invalid: 1.25 second check failed" ); #/
|
||||
continue;
|
||||
}
|
||||
|
||||
wait time2;
|
||||
|
||||
if ( !autoSaveCheck_not_picky() )
|
||||
{
|
||||
/# AutoSavePrint( "Savegame invalid: 2.5 second check failed" ); #/
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( IsDefined( timeout ) )
|
||||
{
|
||||
if ( GetTime() > start_save_time + timeout * 1000 )
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !flag( "can_save" ) )
|
||||
{
|
||||
/# AutoSavePrint( "Can_save flag was clear" ); #/
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !CommitWouldBeValid( saveId ) )
|
||||
{
|
||||
/# AutoSavePrint( "Save is no longer valid, another save was run from elsewhere" ); #/
|
||||
flag_clear( "game_saving" );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
thread maps\_arcademode::arcademode_checkpoint_print();
|
||||
CommitSave( saveId );
|
||||
level.lastSaveTime = GetTime();
|
||||
SetDvar( "ui_grenade_death", "0" );
|
||||
break;
|
||||
}
|
||||
|
||||
wait 0.25;
|
||||
}
|
||||
|
||||
flag_clear( "game_saving" );
|
||||
return true;
|
||||
}
|
||||
|
||||
extra_autosave_checks_failed()
|
||||
{
|
||||
foreach ( func in level._extra_autosave_checks )
|
||||
{
|
||||
if ( ![[ func[ "func" ] ]]() )
|
||||
{
|
||||
AutoSavePrint( "autosave failed: " + func[ "msg" ] );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
autoSaveCheck_not_picky()
|
||||
{
|
||||
return autoSaveCheck( false, false );
|
||||
}
|
||||
|
||||
autoSaveCheck( doPickyChecks, doStealthChecks )
|
||||
{
|
||||
if ( IsDefined( level.special_autosavecondition ) && ![[ level.special_autosavecondition ]]() )
|
||||
return false;
|
||||
|
||||
if ( level.MissionFailed )
|
||||
return false;
|
||||
|
||||
if ( maps\_arcademode::arcademode_complete() )
|
||||
return false;
|
||||
|
||||
if ( !isdefined( doPickyChecks ) )
|
||||
doPickyChecks = level.doPickyAutosaveChecks;
|
||||
|
||||
if ( !isdefined( doStealthChecks ) )
|
||||
doStealthChecks = false;
|
||||
|
||||
if ( doStealthChecks )
|
||||
{
|
||||
if ( ! [[ level.global_callbacks[ "_autosave_stealthcheck" ] ]]() )
|
||||
return false;
|
||||
}
|
||||
|
||||
// health check
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
player = level.players[ i ];
|
||||
if ( !player autoSaveHealthCheck() )
|
||||
return false;
|
||||
|
||||
// ammo check
|
||||
if ( doPickyChecks && !player autoSaveAmmoCheck() )
|
||||
return false;
|
||||
}
|
||||
|
||||
// ai / tank threat check
|
||||
if ( level.autosave_threat_check_enabled )
|
||||
{
|
||||
if ( !autoSaveThreatCheck( doPickyChecks ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
// player state check
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
player = level.players[ i ];
|
||||
if ( !player autoSavePlayerCheck( doPickyChecks ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
// safe save check for level specific gameplay conditions
|
||||
if ( IsDefined( level.savehere ) && !level.savehere )
|
||||
return false;
|
||||
|
||||
// safe save check for level specific gameplay conditions
|
||||
if ( IsDefined( level.canSave ) && !level.canSave )
|
||||
return false;
|
||||
|
||||
// save was unsuccessful for internal reasons, such as lack of memory
|
||||
if ( !issavesuccessful() )
|
||||
{
|
||||
AutoSavePrint( "autosave failed: save call was unsuccessful" );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
autoSavePlayerCheck( doPickyChecks )
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
|
||||
if ( IsDefined( level.ac130gunner ) && level.ac130gunner == self )
|
||||
return true;
|
||||
|
||||
if ( self IsMeleeing() && doPickyChecks )
|
||||
{
|
||||
AutoSavePrint( "autosave failed:player is meleeing" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( self IsThrowingGrenade() && doPickyChecks )
|
||||
{
|
||||
AutoSavePrint( "autosave failed:player is throwing a grenade" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( self IsFiring() && doPickyChecks )
|
||||
{
|
||||
AutoSavePrint( "autosave failed:player is firing" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( IsDefined( self.shellshocked ) && self.shellshocked )
|
||||
{
|
||||
AutoSavePrint( "autosave failed:player is in shellshock" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( self isFlashed() )
|
||||
{
|
||||
AutoSavePrint( "autosave failed:player is flashbanged" );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
autoSaveAmmoCheck()
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
|
||||
if ( IsDefined( level.ac130gunner ) && level.ac130gunner == self )
|
||||
return true;
|
||||
|
||||
weapons = self GetWeaponsListPrimaries();
|
||||
|
||||
for ( idx = 0; idx < weapons.size; idx++ )
|
||||
{
|
||||
fraction = self GetFractionMaxAmmo( weapons[ idx ] );
|
||||
if ( fraction > 0.1 )
|
||||
return( true );
|
||||
}
|
||||
|
||||
AutoSavePrint( "autosave failed: ammo too low" );
|
||||
return( false );
|
||||
}
|
||||
|
||||
autoSaveHealthCheck()
|
||||
{
|
||||
Assert( IsPlayer( self ) );
|
||||
|
||||
if ( IsDefined( level.ac130gunner ) && level.ac130gunner == self )
|
||||
return true;
|
||||
|
||||
if ( self ent_flag_exist( "coop_downed" ) && self ent_flag( "coop_downed" ) )
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: health too low" ); #/
|
||||
return false;
|
||||
}
|
||||
|
||||
healthFraction = self.health / self.maxhealth;
|
||||
if ( healthFraction < 0.5 )
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: health too low" ); #/
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( flag( "_radiation_poisoning" ) )
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: player has radiation sickness" ); #/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ( self ent_flag( "player_has_red_flashing_overlay" ) )
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: player has red flashing overlay" ); #/
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
autoSaveThreatCheck( doPickyChecks )
|
||||
{
|
||||
if ( IsDefined( level.ac130gunner ) && level.ac130gunner == self )
|
||||
return true;
|
||||
|
||||
enemies = GetAISpeciesArray( "bad_guys", "all" );
|
||||
|
||||
foreach ( enemy in enemies )
|
||||
{
|
||||
if ( !isdefined( enemy.enemy ) )
|
||||
continue;
|
||||
|
||||
if ( !isplayer( enemy.enemy ) )
|
||||
continue;
|
||||
|
||||
if ( enemy.type == "dog" )
|
||||
{
|
||||
foreach ( player in level.players )
|
||||
{
|
||||
if ( Distance( enemy.origin, player.origin ) < 384 )
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: Dog near player" ); #/
|
||||
return( false );
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// is trying to melee the player
|
||||
if ( IsDefined( enemy.Melee ) && IsDefined( enemy.melee.target ) && IsPlayer( enemy.melee.target ) )
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: AI meleeing player" ); #/
|
||||
return( false );
|
||||
}
|
||||
|
||||
|
||||
if ( enemy.finalAccuracy < 0.021 && enemy.finalAccuracy > -1 )
|
||||
{
|
||||
// enemy lacks the accuracy to be a threat
|
||||
continue;
|
||||
}
|
||||
|
||||
proximity_threat = [[ level.autosave_proximity_threat_func ]]( enemy );
|
||||
|
||||
if ( proximity_threat == "return" )
|
||||
return false;
|
||||
|
||||
if ( proximity_threat == "none" )
|
||||
{
|
||||
// enemy isn't close enough to be a threat
|
||||
continue;
|
||||
}
|
||||
|
||||
// recently shot at the player
|
||||
if ( enemy.a.lastShootTime > GetTime() - 500 )
|
||||
{
|
||||
if ( doPickyChecks || enemy animscripts\utility::canSeeEnemy( 0 ) && enemy CanShootEnemy( 0 ) )
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: AI firing on player" ); #/
|
||||
return( false );
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsDefined( enemy.a.aimIdleThread ) && enemy animscripts\utility::canSeeEnemy( 0 ) && enemy CanShootEnemy( 0 ) )
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: AI aiming at player" ); #/
|
||||
return( false );
|
||||
}
|
||||
}
|
||||
|
||||
if ( player_is_near_live_grenade() )
|
||||
return false;
|
||||
|
||||
vehicles = GetEntArray( "destructible", "classname" );
|
||||
foreach ( vehicle in vehicles )
|
||||
{
|
||||
if ( !isDefined( vehicle.healthDrain ) )
|
||||
continue;
|
||||
|
||||
foreach ( player in level.players )
|
||||
{
|
||||
if ( Distance( vehicle.origin, player.origin ) < 400 )// grenade radius is 220
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: burning car too close to player" ); #/
|
||||
return( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return( true );
|
||||
}
|
||||
|
||||
enemy_is_a_threat()
|
||||
{
|
||||
// AI must have a reasonable chance of hitting the player
|
||||
if ( self.finalAccuracy >= 0.021 )
|
||||
return true;
|
||||
|
||||
foreach ( player in level.players )
|
||||
{
|
||||
if ( Distance( self.origin, player.origin ) < 500 )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
autosave_proximity_threat_func( enemy )
|
||||
{
|
||||
foreach ( player in level.players )
|
||||
{
|
||||
dist = Distance( enemy.origin, player.origin );
|
||||
|
||||
if ( dist < 360 )
|
||||
{
|
||||
/# AutoSavePrint( "autosave failed: AI too close to player" ); #/
|
||||
return "return";
|
||||
}
|
||||
else
|
||||
if ( dist < 1000 )
|
||||
{
|
||||
return "threat_exists";
|
||||
}
|
||||
}
|
||||
|
||||
return "none";
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "b2", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_b2_bomber" );
|
||||
|
||||
build_treadfx();
|
||||
|
||||
//special for mig29/////
|
||||
level._effect[ "engineeffect" ] = loadfx( "fire/jet_afterburner" );
|
||||
level._effect[ "afterburner" ] = loadfx( "fire/jet_afterburner_ignite" );
|
||||
level._effect[ "contrail" ] = loadfx( "smoke/jet_contrail" );
|
||||
////////////////////////
|
||||
|
||||
build_deathfx( "explosions/large_vehicle_explosion", undefined, "explo_metal_rand" );
|
||||
build_life( 999, 500, 1500 );
|
||||
build_rumble( "mig_rumble", .1, .2, 11300, .05, .05 );
|
||||
build_team( "allies" );
|
||||
build_compassicon( "mig29", false );
|
||||
}
|
||||
|
||||
|
||||
init_local()
|
||||
{
|
||||
thread playEngineEffects();
|
||||
thread playConTrail();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 1;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
playEngineEffects()
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "stop_engineeffects" );
|
||||
|
||||
self ent_flag_init( "engineeffects" );
|
||||
self ent_flag_set( "engineeffects" );
|
||||
engineeffects = getfx( "engineeffect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self ent_flag_wait( "engineeffects" );
|
||||
playfxontag( engineeffects, self, "tag_engine_right" );
|
||||
playfxontag( engineeffects, self, "tag_engine_left" );
|
||||
self ent_flag_waitopen( "engineeffects" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_left" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_right" );
|
||||
}
|
||||
}
|
||||
|
||||
playAfterBurner()
|
||||
{
|
||||
//After Burners are pretty much like turbo boost. They don't use them all the time except when
|
||||
//bursts of speed are needed. Needs a cool sound when they're triggered. Currently, they are set
|
||||
//to be on all the time, but it would be cool to see them engauge as they fly away.
|
||||
|
||||
playfxontag( level._effect[ "afterburner" ], self, "tag_engine_right" );
|
||||
playfxontag( level._effect[ "afterburner" ], self, "tag_engine_left" );
|
||||
|
||||
}
|
||||
|
||||
playConTrail()
|
||||
{
|
||||
//This is a geoTrail effect that loops forever. It has to be enabled and disabled while playing as
|
||||
//one effect. It can't be played in a wait loop like other effects because a geo trail is one
|
||||
//continuous effect. ConTrails should only be played during high "G" or high speed maneuvers.
|
||||
playfxontag( level._effect[ "contrail" ], self, "tag_right_wingtip" );
|
||||
playfxontag( level._effect[ "contrail" ], self, "tag_left_wingtip" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_b2 (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_b2::main( "vehicle_b2_bomber" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_b2
|
||||
sound,vehicle_b2,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_b2_bomber"
|
||||
default:"vehicletype" "b2"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,442 @@
|
||||
#include maps\_hud_util;
|
||||
#include maps\_utility;
|
||||
#include maps\_debug;
|
||||
#include animscripts\utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_anim;
|
||||
|
||||
#using_animtree( "script_model" );
|
||||
barrett_init()
|
||||
{
|
||||
/*
|
||||
|
||||
ADD TO YOUR CSV:!!!!!!!!!!!!!!
|
||||
|
||||
xmodel,weapon_m82_MG_Setup
|
||||
rawfile,animtrees/script_model.atr
|
||||
rawfile,maps/_barrett.gsc
|
||||
xanim,sniper_escape_flag_wave_down
|
||||
xanim,sniper_escape_flag_wave_up
|
||||
xmodel,prop_car_flag
|
||||
weapon,sp/barrett_fake
|
||||
rawfile,shock/barrett.shock
|
||||
fx,smoke/smoke_geotrail_barret
|
||||
*/
|
||||
|
||||
//precacheitem( "barrett_fake" );
|
||||
precacheshellshock( "barrett" );
|
||||
// Press forwards or backwards to adjust zoom.
|
||||
add_hint_string( "barrett", &"WEAPON_PRESS_FORWARDS_OR_BACKWARDS", ::should_break_zoom_hint );
|
||||
|
||||
flag_init( "player_is_on_turret" );
|
||||
flag_init( "player_on_barret" );
|
||||
flag_init( "player_used_zoom" );
|
||||
flag_init( "can_use_turret" );
|
||||
flag_init( "player_gets_off_turret" );
|
||||
|
||||
level._effect[ "bullet_geo" ] = loadfx( "smoke/smoke_geotrail_barret" );
|
||||
thread exchange_trace_converter();
|
||||
thread exchange_barrett_trigger();// get on and off
|
||||
|
||||
//thread exchange_dof();
|
||||
|
||||
// the turret dvars dont exist onthe first frame
|
||||
wait( 0.05 );
|
||||
//setsaveddvar( "turretScopeZoomMin", "1.5" );
|
||||
//setsaveddvar( "turretScopeZoomMax", "70" );
|
||||
//setsaveddvar( "turretScopeZoom", "70" );
|
||||
|
||||
level.barrett_exists = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
exchange_barrett_trigger()
|
||||
{
|
||||
barrett_trigger = getent( "barrett_trigger", "targetname" );
|
||||
// Press and hold^3 &&1 ^7to use the M82 .50 Caliber Sniper Rifle
|
||||
barrett_trigger sethintstring( &"WEAPON_BARRETT_USE" );
|
||||
turret = getent( "turret2", "targetname" );
|
||||
|
||||
targ = getent( turret.target, "targetname" );
|
||||
turret makeUnusable();
|
||||
turret hide();
|
||||
turret.origin = targ.origin;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
barrett_trigger waittill( "trigger" );
|
||||
level.player.original_org = level.player.origin;
|
||||
|
||||
level.player setplayerangles( ( turret.angles[ 0 ], turret.angles[ 1 ], level.player.angles[ 2 ] ) );
|
||||
|
||||
turret useby( level.player );
|
||||
|
||||
setsaveddvar( "ui_hideMap", "1" );
|
||||
setsaveddvar( "compass", 0 );
|
||||
SetSavedDvar( "ammoCounterHide", "1" );
|
||||
SetSavedDvar( "hud_showStance", 0 );
|
||||
|
||||
level.player_can_fire_turret_time = gettime() + 1000;
|
||||
setsaveddvar( "sv_znear", "100" );// 100
|
||||
//should maybe be the real target
|
||||
setsaveddvar( "sm_sunShadowCenter", getent( turret.target, "targetname" ).origin );
|
||||
flag_set( "player_is_on_turret" );
|
||||
level.player disableWeapons();
|
||||
if ( level.script == "dcburning" )
|
||||
{
|
||||
level.player SetActionSlot( 1, "" );
|
||||
level.player NightVisionForceOff();
|
||||
}
|
||||
|
||||
//level.player allowCrouch( false );
|
||||
//level.player allowStand( false );
|
||||
thread player_learns_to_zoom();
|
||||
if ( !flag( "player_used_zoom" ) )
|
||||
{
|
||||
level.player thread display_hint( "barrett" );
|
||||
}
|
||||
|
||||
level.level_specific_dof = true;
|
||||
// compensate for intro view in the ground, simulating prone
|
||||
player_org = level.player.origin + ( 0, 0, 60 );
|
||||
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
if ( !isdefined( turret getturretowner() ) )
|
||||
break;
|
||||
wait( 0.05 );
|
||||
}
|
||||
//flag_wait( "player_gets_off_turret" );
|
||||
|
||||
//level.player EnableTurretDismount();
|
||||
//barrett_trigger = getent( "barrett_trigger", "targetname" );
|
||||
//barrett_trigger delete();
|
||||
//turret useby( level.player );
|
||||
//turret delete();
|
||||
|
||||
setsaveddvar( "compass", 1 );
|
||||
SetSavedDvar( "ammoCounterHide", "0" );
|
||||
setsaveddvar( "ui_hideMap", "0" );
|
||||
SetSavedDvar( "hud_showStance", 1 );
|
||||
|
||||
setsaveddvar( "sv_znear", "0" );
|
||||
setsaveddvar( "sm_sunShadowCenter", ( 0, 0, 0 ) );
|
||||
flag_clear( "player_is_on_turret" );
|
||||
level.player enableWeapons();
|
||||
if ( level.script == "dcburning" )
|
||||
{
|
||||
level.player SetActionSlot( 1, "nightvision" );
|
||||
}
|
||||
//level.player allowCrouch( true );
|
||||
//level.player allowStand( true );
|
||||
level.level_specific_dof = false;
|
||||
|
||||
|
||||
// clear blur in case we were on min spec pc and holding key
|
||||
setblur( 0, 0.05 );
|
||||
|
||||
|
||||
level.player setorigin( level.player.original_org + ( 0, 0, 10 ) );
|
||||
//wait 1.5;//weird bounce
|
||||
//level.player enableweapons();
|
||||
}
|
||||
}
|
||||
|
||||
exchange_trace_converter()
|
||||
{
|
||||
firetime = -5000;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
flag_wait( "player_is_on_turret" );
|
||||
wait_for_buffer_time_to_pass( firetime, 1.0 );
|
||||
|
||||
if ( !level.player attackbuttonpressed() )
|
||||
{
|
||||
wait( 0.05 );
|
||||
continue;
|
||||
}
|
||||
|
||||
thread exchange_player_fires();
|
||||
firetime = gettime();
|
||||
|
||||
// wait for the player to release the fire, as its a semi auto weapon
|
||||
while ( level.player attackbuttonpressed() )
|
||||
{
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exchange_player_fires()
|
||||
{
|
||||
if ( gettime() < level.player_can_fire_turret_time )
|
||||
return;
|
||||
|
||||
// min_zoom = .5;// was 1.5
|
||||
// max_zoom = 20;
|
||||
// min_eq = 0.15;
|
||||
// max_eq = 0.80;
|
||||
//
|
||||
// zoom = getdvarfloat( "turretScopeZoom" );
|
||||
// eq = ( zoom - min_zoom ) * ( max_eq - min_eq ) / ( max_zoom - min_zoom );
|
||||
// eq += min_eq;
|
||||
|
||||
level.player shellshock( "barrett", 1.3 );
|
||||
// level.fired_barrett = true;
|
||||
//
|
||||
// angles = level.player getplayerangles();
|
||||
// start = level.player geteye();
|
||||
//
|
||||
// forward = anglestoforward( angles );
|
||||
// end = start + vector_multiply( forward, 15000 );
|
||||
|
||||
// thread linedraw( eye, end, (1,0,1), 25 );
|
||||
|
||||
// trace = BulletTrace( start, end, false, undefined );
|
||||
// level.trace = trace;
|
||||
|
||||
// if ( trace[ "surfacetype" ] != "default" )
|
||||
// {
|
||||
//// thread Linedraw( start, trace[ "position" ], (0,1,0) );
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
//// thread Linedraw( start, trace[ "position" ], (1,0,0) );
|
||||
//
|
||||
// start = trace[ "position" ] + vector_multiply( forward, 10 );
|
||||
// end = trace[ "position" ] + vector_multiply( forward, 15000 );
|
||||
//
|
||||
// skill_drift = [];
|
||||
// skill_drift[ 0 ] = 0.025;
|
||||
// skill_drift[ 1 ] = 0.025;
|
||||
// skill_drift[ 2 ] = 0.025;
|
||||
// skill_drift[ 3 ] = 0.025;
|
||||
//
|
||||
//
|
||||
// pos = start;
|
||||
// move_distance = 314.245;
|
||||
// move_vec = vector_multiply( forward, move_distance );
|
||||
// waittillframeend;
|
||||
//// eye = level.player.origin + ( -3.62, 0, -66 );
|
||||
// turret = getent( "turret2", "targetname" );
|
||||
// if ( !isdefined( turret ) )
|
||||
// return;
|
||||
//// eye = turret.origin + ( getdvarfloat( "ax" ), getdvarfloat( "ay" ), getdvarfloat( "az" ) );
|
||||
// eye = turret.origin + ( -0.1, 0, 15 );
|
||||
//// eye = level.player.origin + ( getdvarfloat( "ax" ), getdvarfloat( "ay" ), getdvarfloat( "az" ) );
|
||||
//
|
||||
// bullet = spawn( "script_model", eye );
|
||||
// bullet setmodel( "tag_origin" );
|
||||
//
|
||||
// playfxontag( getfx( "bullet_geo" ), bullet, "tag_origin" );
|
||||
//// println( "start " + start + " firetime " + gettime() );
|
||||
// count_max = 10;
|
||||
// count = 0;
|
||||
//
|
||||
// bullet_last_org = bullet.origin;
|
||||
//
|
||||
// trace = undefined;
|
||||
// tried_lock = false;
|
||||
// lock_on_steps = undefined;
|
||||
// achieved_lock = false;
|
||||
// current_step = 0;
|
||||
// drift = ( 0, 0, 0 );
|
||||
//
|
||||
// for ( ;; )
|
||||
// {
|
||||
// endpos = pos + move_vec;
|
||||
// drift = vector_multiply( level.wind_vec, skill_drift[ level.gameskill ] );
|
||||
//
|
||||
//// thread linedraw( pos, endpos, ( 1, 0.2, 0 ), 5 );
|
||||
//
|
||||
// trace = bullettrace( pos, endpos, true, undefined );
|
||||
// final_origin = trace[ "position" ];
|
||||
// if ( trace[ "fraction" ] < 1 )
|
||||
// {
|
||||
// //exchange_impact_alert( trace[ "position" ] );
|
||||
// angles = vectortoangles( endpos - pos );
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// view_frac = count / count_max;
|
||||
//// view_frac -= 0.1;
|
||||
// if ( view_frac < 0 )
|
||||
// view_frac = 0;
|
||||
// if ( view_frac > 1.0 )
|
||||
// view_frac = 1.0;
|
||||
// count++ ;
|
||||
//
|
||||
// level.view_frac = view_frac;
|
||||
// oldorg = bullet.origin;
|
||||
//
|
||||
// oldeye = eye;
|
||||
// eye += move_vec;
|
||||
//// thread linedraw( oldeye, eye, (1,0,0), 25 );
|
||||
//
|
||||
// bullet_last_org = bullet.origin;
|
||||
// bullet.origin = vector_multiply( final_origin, view_frac ) + vector_multiply( eye, 1.0 - view_frac );
|
||||
//
|
||||
//
|
||||
// pos += move_vec + drift;
|
||||
//
|
||||
//// line( eye, bullet.origin, (1,1,1) );
|
||||
// wait( 0.05 );
|
||||
// }
|
||||
//
|
||||
// println( "hittime " + gettime() );
|
||||
// forward = anglestoforward( angles );
|
||||
// // scale it way out for bullet penetration purposes
|
||||
// pop_vec = vector_multiply( forward, 5 );
|
||||
// move_vec = vector_multiply( forward, 15000 );
|
||||
// MagicBullet( "barrett_fake", pos, pos + move_vec );
|
||||
//
|
||||
// wait( 0.25 );
|
||||
// bullet delete();
|
||||
|
||||
}
|
||||
|
||||
//exchange_dof()
|
||||
//{
|
||||
// for ( ;; )
|
||||
// {
|
||||
// flag_wait( "player_is_on_turret" );
|
||||
// exchange_scale_dof_while_on_turret();
|
||||
// flag_waitopen( "player_is_on_turret" );
|
||||
// level.player SetDepthOfField( 0, 0, 0, 0, 8, 8 );
|
||||
// }
|
||||
//}
|
||||
|
||||
//exchange_scale_dof_while_on_turret()
|
||||
//{
|
||||
// level.fired_barrett = false;
|
||||
// level endon( "player_is_on_turret" );
|
||||
//// SetDepthOfField( <near start>, <near end>, <far start>, <far end>, <near blur>, <far blur> )
|
||||
// olddist = getdvarint( "turretscopezoom" );
|
||||
//
|
||||
// zoom[ 9 ] = 6750;
|
||||
//
|
||||
// depthdist = 500;
|
||||
//
|
||||
// max_depthdist = 24000;
|
||||
// min_depthdist = 6500;
|
||||
// clear_rate = 300;
|
||||
// focus_rate = 300;
|
||||
// fog_rate = 1000;
|
||||
//
|
||||
// depth_near = 6000;
|
||||
//
|
||||
// max_blurring = 14000;
|
||||
//
|
||||
// fired_barrett_dist = 6500;
|
||||
//
|
||||
// level.blur = 0;
|
||||
// blur_barret_fired = 8.0;
|
||||
// blur_stable_rate = -0.2;
|
||||
// blur_in_rate = 0.10;
|
||||
// blur_out_rate = -0.25;
|
||||
//
|
||||
// stable = false;
|
||||
// for ( ;; )
|
||||
// {
|
||||
// dist = getdvarint( "turretscopezoom" );
|
||||
//
|
||||
// if ( dist < olddist )
|
||||
// {
|
||||
// if ( dist >= max_blurring )
|
||||
// {
|
||||
// dist = max_blurring;
|
||||
// }
|
||||
//
|
||||
// // zooming in, so bring the fog in
|
||||
// depthdist -= fog_rate;
|
||||
//
|
||||
// level.blur += blur_in_rate;
|
||||
// stable = false;
|
||||
// }
|
||||
// else
|
||||
// if ( dist == olddist )
|
||||
// {
|
||||
// if ( stable )
|
||||
// {
|
||||
// // stable, focus the eyes
|
||||
// depthdist += focus_rate;
|
||||
//
|
||||
// level.blur = level.blur * 0.9;
|
||||
// if ( level.blur < 0.1 )
|
||||
// level.blur = 0;
|
||||
// }
|
||||
// stable = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// stable = false;
|
||||
// // zooming out, sharpen things up quick
|
||||
// depthdist += clear_rate;
|
||||
//
|
||||
// level.blur += blur_out_rate;
|
||||
// }
|
||||
//
|
||||
// if ( level.fired_barrett )
|
||||
// {
|
||||
// level.fired_barrett = false;
|
||||
// depthdist = fired_barrett_dist;
|
||||
// level.blur = blur_barret_fired;
|
||||
// }
|
||||
//
|
||||
// if ( level.blur > 12 )
|
||||
// level.blur = 12;
|
||||
// if ( level.blur < 0 )
|
||||
// level.blur = 0;
|
||||
//
|
||||
// far_min = depthdist - depth_near;
|
||||
// if ( far_min < 0 )
|
||||
// far_min = 0;
|
||||
//
|
||||
// if ( depthdist > max_depthdist )
|
||||
// depthdist = max_depthdist;
|
||||
// else
|
||||
// if ( depthdist < min_depthdist )
|
||||
// depthdist = min_depthdist;
|
||||
//
|
||||
//// println( "dofdist " + depthdist + " zoom " + dist );
|
||||
// level.player SetDepthOfField( 0, 0, far_min, depthdist, 8, 8 );
|
||||
// if ( getdvarint( "r_dof_enable" ) != true )
|
||||
// {
|
||||
// setblur( level.blur, 0.05 );
|
||||
// }
|
||||
// olddist = dist;
|
||||
// wait( 0.05 );
|
||||
// }
|
||||
//}
|
||||
|
||||
should_break_zoom_hint()
|
||||
{
|
||||
assert( isplayer( self ) );
|
||||
|
||||
if ( !flag( "player_is_on_turret" ) )
|
||||
return true;
|
||||
|
||||
return flag( "player_used_zoom" );
|
||||
}
|
||||
|
||||
player_learns_to_zoom()
|
||||
{
|
||||
|
||||
flag_clear( "player_used_zoom" ); //make sure we show hint anytime player gets on the rifle
|
||||
movement = level.player GetNormalizedMovement();
|
||||
|
||||
while( true )
|
||||
{
|
||||
wait( 0.05 );
|
||||
movement = level.player GetNormalizedMovement(); //needs to move stick forward to learn
|
||||
if ( movement[ 0 ] > 0.2 )
|
||||
break;
|
||||
//iprintlnbold( movement[ 0 ] + " : " + movement[ 1 ] );
|
||||
}
|
||||
wait( 6 );
|
||||
flag_set( "player_used_zoom" );
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,359 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
|
||||
|
||||
main( model, type, no_death )
|
||||
{
|
||||
build_template( "blackhawk", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_blackhawk" );
|
||||
build_deathmodel( "vehicle_blackhawk_low" );
|
||||
build_deathmodel( "vehicle_blackhawk_low_thermal" );
|
||||
build_deathmodel( "vehicle_blackhawk_hero_sas_night" );
|
||||
|
||||
build_drive( %bh_rotors, undefined, 0 );
|
||||
|
||||
if ( !isdefined( no_death ) )
|
||||
{
|
||||
blackhawk_death_fx = [];
|
||||
blackhawk_death_fx[ "vehicle_blackhawk" ] = "explosions/helicopter_explosion";
|
||||
blackhawk_death_fx[ "vehicle_blackhawk_sas_night" ] = "explosions/helicopter_explosion";
|
||||
blackhawk_death_fx[ "vehicle_blackhawk_hero_sas_night" ] = "explosions/helicopter_explosion";
|
||||
blackhawk_death_fx[ "vehicle_blackhawk_hero" ] = "explosions/helicopter_explosion";
|
||||
blackhawk_death_fx[ "vehicle_blackhawk_low" ] = "explosions/large_vehicle_explosion";
|
||||
blackhawk_death_fx[ "vehicle_blackhawk_low_thermal" ] = "explosions/large_vehicle_explosion";
|
||||
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "tag_engine_left", "blackhawk_helicopter_hit", undefined, undefined, undefined, 0.2, true );
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "elevator_jnt", "blackhawk_helicopter_secondary_exp", undefined, undefined, undefined, 0.5, true );
|
||||
build_deathfx( "fire/fire_smoke_trail_L", "elevator_jnt", "blackhawk_helicopter_dying_loop", true, 0.05, true, 0.5, true );
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "tag_engine_right", "blackhawk_helicopter_secondary_exp", undefined, undefined, undefined, 2.5, true );
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "tag_deathfx", "blackhawk_helicopter_secondary_exp", undefined, undefined, undefined, 4.0 );
|
||||
build_deathfx( blackhawk_death_fx[ model ], undefined, "blackhawk_helicopter_crash", undefined, undefined, undefined, - 1, undefined, "stop_crash_loop_sound" );
|
||||
|
||||
build_rocket_deathfx( "explosions/aerial_explosion_heli_large", "tag_deathfx", "blackhawk_helicopter_crash",undefined, undefined, undefined, undefined, true, undefined, 0 );
|
||||
|
||||
}
|
||||
|
||||
build_treadfx();
|
||||
|
||||
build_life( 999, 500, 1500 );
|
||||
|
||||
build_team( "allies" );
|
||||
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
|
||||
build_attach_models( ::set_attached_models );
|
||||
|
||||
build_unload_groups( ::Unload_Groups );
|
||||
build_compassicon( "helicopter", false );
|
||||
|
||||
|
||||
randomStartDelay = randomfloatrange( 0, 1 );
|
||||
build_light( model, "cockpit_blue_cargo01", "tag_light_cargo01", "misc/aircraft_light_cockpit_red", "interior", 0.0 );
|
||||
build_light( model, "cockpit_blue_cockpit01", "tag_light_cockpit01", "misc/aircraft_light_cockpit_blue", "interior", 0.0 );
|
||||
build_light( model, "white_blink", "tag_light_belly", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "white_blink_tail", "tag_light_tail", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_green", "tag_light_L_wing", "misc/aircraft_light_wingtip_green", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_red", "tag_light_R_wing", "misc/aircraft_light_wingtip_red", "running", randomStartDelay );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
self.originheightoffset = distance( self gettagorigin( "tag_origin" ), self gettagorigin( "tag_ground" ) );// TODO - FIXME: this is ugly. Derive from distance between tag_origin and tag_base or whatever that tag was.
|
||||
self.fastropeoffset = 762;// TODO - FIXME: this is ugly. If only there were a getanimendorigin() command
|
||||
|
||||
self.script_badplace = false;// All helicopters dont need to create bad places
|
||||
//maps\_vehicle::lights_on( "running" );
|
||||
//maps\_vehicle::lights_on( "interior" );
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
// positions[ 0 ].vehicle_getinanim = %tigertank_hatch_open;
|
||||
|
||||
for ( i = 0;i < positions.size;i++ )
|
||||
positions[ i ].vehicle_getoutanim = %bh_idle;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "fastrope" );
|
||||
|
||||
setplayer_anims( positions )
|
||||
{
|
||||
positions[ 3 ].player_idle = %bh_player_idle;
|
||||
positions[ 3 ].player_getout_sound = "fastrope_start_plr";
|
||||
positions[ 3 ].player_getout_sound_loop = "fastrope_loop_plr";
|
||||
positions[ 3 ].player_getout_sound_end = "fastrope_end_plr";
|
||||
|
||||
positions[ 3 ].player_getout = %bh_player_drop;
|
||||
//positions[ 3 ].player_getout = %bh_2_drop;
|
||||
positions[ 3 ].player_animtree = #animtree;
|
||||
|
||||
|
||||
positions[ 2 ].player_idle = %bh_player_idle;
|
||||
positions[ 2 ].player_getout_sound = "fastrope_start_plr";
|
||||
positions[ 2 ].player_getout_sound_loop = "fastrope_loop_plr";
|
||||
positions[ 2 ].player_getout_sound_end = "fastrope_end_plr";
|
||||
|
||||
positions[ 2 ].player_getout = %bh_player_drop;
|
||||
positions[ 2 ].player_animtree = #animtree;
|
||||
|
||||
positions[ 6 ].player_idle = %bh_player_idle;
|
||||
positions[ 6 ].player_getout_sound = "fastrope_start_plr";
|
||||
positions[ 6 ].player_getout_sound_loop = "fastrope_loop_plr";
|
||||
positions[ 6 ].player_getout_sound_end = "fastrope_end_plr";
|
||||
|
||||
positions[ 6 ].player_getout = %bh_player_drop;
|
||||
//positions[ 6 ].player_getout = %bh_8_drop;
|
||||
positions[ 6 ].player_animtree = #animtree;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
set_coop_player_anims( positions )
|
||||
{
|
||||
//positions[ 3 ].player_getout = %bh_player_drop;
|
||||
positions[ 3 ].player_getout = %bh_2_drop;
|
||||
positions[ 3 ].player_animtree = #animtree;
|
||||
|
||||
//positions[ 6 ].player_getout = %bh_player_drop;
|
||||
positions[ 6 ].player_getout = %bh_8_drop;
|
||||
positions[ 6 ].player_animtree = #animtree;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 8;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].idle = %bh_Pilot_idle;
|
||||
positions[ 1 ].idle = %bh_coPilot_idle;
|
||||
|
||||
// 1, 2, 4, 5, 8, 6
|
||||
positions[ 2 ].idle = %bh_1_idle;
|
||||
positions[ 3 ].idle = %bh_2_idle;
|
||||
positions[ 4 ].idle = %bh_4_idle;
|
||||
positions[ 5 ].idle = %bh_5_idle;
|
||||
positions[ 6 ].idle = %bh_8_idle;
|
||||
positions[ 7 ].idle = %bh_6_idle;
|
||||
|
||||
|
||||
positions[ 0 ].sittag = "tag_detach";
|
||||
positions[ 1 ].sittag = "tag_detach";
|
||||
positions[ 2 ].sittag = "tag_detach";
|
||||
positions[ 3 ].sittag = "tag_detach";
|
||||
positions[ 4 ].sittag = "tag_detach";
|
||||
positions[ 5 ].sittag = "tag_detach";
|
||||
positions[ 6 ].sittag = "tag_detach";
|
||||
positions[ 7 ].sittag = "tag_detach";
|
||||
|
||||
|
||||
// 1, 2, 4, 5, 8, 6
|
||||
positions[ 2 ].getout = %bh_1_drop;
|
||||
positions[ 3 ].getout = %bh_2_drop;
|
||||
positions[ 4 ].getout = %bh_4_drop;
|
||||
positions[ 5 ].getout = %bh_5_drop;
|
||||
positions[ 6 ].getout = %bh_8_drop;
|
||||
positions[ 7 ].getout = %bh_6_drop;
|
||||
|
||||
positions[ 2 ].getoutstance = "crouch";
|
||||
positions[ 3 ].getoutstance = "crouch";
|
||||
positions[ 4 ].getoutstance = "crouch";
|
||||
positions[ 5 ].getoutstance = "crouch";
|
||||
positions[ 6 ].getoutstance = "crouch";
|
||||
positions[ 7 ].getoutstance = "crouch";
|
||||
|
||||
|
||||
positions[ 2 ].ragdoll_getout_death = true;
|
||||
positions[ 3 ].ragdoll_getout_death = true;
|
||||
positions[ 4 ].ragdoll_getout_death = true;
|
||||
positions[ 5 ].ragdoll_getout_death = true;
|
||||
positions[ 6 ].ragdoll_getout_death = true;
|
||||
positions[ 7 ].ragdoll_getout_death = true;
|
||||
|
||||
positions[ 2 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 3 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 4 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 5 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 6 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 7 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
|
||||
positions[ 1 ].rappel_kill_achievement = 1;
|
||||
positions[ 2 ].rappel_kill_achievement = 1;
|
||||
positions[ 3 ].rappel_kill_achievement = 1;
|
||||
positions[ 4 ].rappel_kill_achievement = 1;
|
||||
positions[ 5 ].rappel_kill_achievement = 1;
|
||||
positions[ 6 ].rappel_kill_achievement = 1;
|
||||
positions[ 7 ].rappel_kill_achievement = 1;
|
||||
|
||||
// positions[ 2 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 3 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 4 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 5 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 6 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 7 ].getoutsnd = "fastrope_loop_npc";
|
||||
|
||||
positions[ 2 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 3 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 4 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 5 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 6 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 7 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
|
||||
// 1, 2, 4, 5, 6, & 8
|
||||
positions[ 2 ].fastroperig = "TAG_FastRope_RI";// 1 %bh_1_drop
|
||||
positions[ 3 ].fastroperig = "TAG_FastRope_RI"; // 2 %bh_2_drop
|
||||
positions[ 4 ].fastroperig = "TAG_FastRope_LE"; // 4 %bh_4_drop
|
||||
positions[ 5 ].fastroperig = "TAG_FastRope_LE"; // 5 %bh_5_drop
|
||||
positions[ 6 ].fastroperig = "TAG_FastRope_RI";// 8 %bh_8_drop
|
||||
positions[ 7 ].fastroperig = "TAG_FastRope_LE";// 6 %bh_6_drop
|
||||
|
||||
return setplayer_anims( positions );
|
||||
return set_coop_player_anims( positions );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//WIP.. posible to unload different sets of people wirh vehicle notify( "unload", set ); sets defined here.
|
||||
unload_groups()
|
||||
{
|
||||
unload_groups = [];
|
||||
unload_groups[ "left" ] = [];
|
||||
unload_groups[ "right" ] = [];
|
||||
unload_groups[ "both" ] = [];
|
||||
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 4;
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 5;
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 7;
|
||||
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 2;
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 3;
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 6;
|
||||
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 2;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 3;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 4;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 5;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 6;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 7;
|
||||
|
||||
unload_groups[ "default" ] = unload_groups[ "both" ];
|
||||
|
||||
return unload_groups;
|
||||
|
||||
}
|
||||
|
||||
|
||||
set_attached_models()
|
||||
{
|
||||
array = [];
|
||||
array[ "TAG_FastRope_LE" ] = spawnstruct();
|
||||
array[ "TAG_FastRope_LE" ].model = "rope_test";
|
||||
array[ "TAG_FastRope_LE" ].tag = "TAG_FastRope_LE";
|
||||
array[ "TAG_FastRope_LE" ].idleanim = %bh_rope_idle_le;
|
||||
array[ "TAG_FastRope_LE" ].dropanim = %bh_rope_drop_le;
|
||||
|
||||
array[ "TAG_FastRope_RI" ] = spawnstruct();
|
||||
array[ "TAG_FastRope_RI" ].model = "rope_test_ri";
|
||||
array[ "TAG_FastRope_RI" ].tag = "TAG_FastRope_RI";
|
||||
array[ "TAG_FastRope_RI" ].idleanim = %bh_rope_idle_ri;
|
||||
array[ "TAG_FastRope_RI" ].dropanim = %bh_rope_drop_ri;
|
||||
|
||||
strings = getarraykeys( array );
|
||||
|
||||
for ( i = 0;i < strings.size;i++ )
|
||||
{
|
||||
precachemodel( array[ strings[ i ] ].model );
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_blackhawk (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_blackhawk::main( "vehicle_blackhawk" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_blackhawk_blackhawk
|
||||
sound,vehicle_blackhawk,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_blackhawk"
|
||||
default:"vehicletype" "blackhawk"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_blackhawk_hero_sas_night (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_blackhawk::main( "vehicle_blackhawk_hero_sas_night" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_blackhawk_hero_sas_night_blackhawk
|
||||
sound,vehicle_blackhawk,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_blackhawk_hero_sas_night"
|
||||
default:"vehicletype" "blackhawk"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_blackhawk_low (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_blackhawk::main( "vehicle_blackhawk_low" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_blackhawk_low_blackhawk
|
||||
sound,vehicle_blackhawk,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_blackhawk_low"
|
||||
default:"vehicletype" "blackhawk"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_blackhawk_low_thermal (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_blackhawk::main( "vehicle_blackhawk_low_thermal" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_blackhawk_low_thermal_blackhawk
|
||||
sound,vehicle_blackhawk,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_blackhawk_low_thermal"
|
||||
default:"vehicletype" "blackhawk"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_blackhawk_minigun_low (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_blackhawk_minigun::main( "vehicle_blackhawk_minigun_low" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_blackhawk_minigun_low_blackhawk_minigun
|
||||
|
||||
|
||||
defaultmdl="vehicle_blackhawk_minigun_low"
|
||||
default:"vehicletype" "blackhawk_minigun"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,425 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_anim;
|
||||
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type, no_death )
|
||||
{
|
||||
//precachemodel( "fastrope_arms" );
|
||||
|
||||
build_template( "blackhawk_minigun", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
//build_deathmodel( "vehicle_blackhawk_minigun_hero" );
|
||||
|
||||
build_drive( %bh_rotors, undefined, 0 );
|
||||
|
||||
if ( !isdefined( no_death ) )
|
||||
{
|
||||
blackhawk_death_fx = [];
|
||||
blackhawk_death_fx[ "vehicle_blackhawk_minigun_low" ] = "explosions/helicopter_explosion";
|
||||
blackhawk_death_fx[ "vehicle_blackhawk_minigun_hero" ] = "explosions/helicopter_explosion";
|
||||
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "tag_engine_left", "blackhawk_helicopter_hit", undefined, undefined, undefined, 0.2, true );
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "elevator_jnt", "blackhawk_helicopter_secondary_exp", undefined, undefined, undefined, 0.5, true );
|
||||
build_deathfx( "fire/fire_smoke_trail_L", "elevator_jnt", "blackhawk_helicopter_dying_loop", true, 0.05, true, 0.5, true );
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "tag_engine_right", "blackhawk_helicopter_secondary_exp", undefined, undefined, undefined, 2.5, true );
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "tag_deathfx", "blackhawk_helicopter_secondary_exp", undefined, undefined, undefined, 4.0 );
|
||||
build_deathfx( blackhawk_death_fx[ model ], undefined, "blackhawk_helicopter_crash", undefined, undefined, undefined, - 1, undefined, "stop_crash_loop_sound" );
|
||||
|
||||
build_rocket_deathfx( "explosions/aerial_explosion_heli_large", "tag_deathfx", "blackhawk_helicopter_crash",undefined, undefined, undefined, undefined, true, undefined, 0 );
|
||||
}
|
||||
|
||||
build_treadfx();
|
||||
|
||||
build_life( 999, 500, 1500 );
|
||||
|
||||
build_team( "allies" );
|
||||
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
|
||||
build_attach_models( ::set_attached_models );
|
||||
|
||||
build_unload_groups( ::Unload_Groups );
|
||||
build_compassicon( "helicopter", false );
|
||||
|
||||
|
||||
randomStartDelay = randomfloatrange( 0, 1 );
|
||||
build_light( model, "cockpit_blue_cargo01", "tag_light_cargo01", "misc/aircraft_light_cockpit_red", "interior", 0.0 );
|
||||
build_light( model, "cockpit_blue_cockpit01", "tag_light_cockpit01", "misc/aircraft_light_cockpit_blue", "interior", 0.0 );
|
||||
build_light( model, "white_blink", "tag_light_belly", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "white_blink_tail", "tag_light_tail", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_green", "tag_light_L_wing", "misc/aircraft_light_wingtip_green", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_red", "tag_light_R_wing", "misc/aircraft_light_wingtip_red", "running", randomStartDelay );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
self.originheightoffset = distance( self gettagorigin( "tag_origin" ), self gettagorigin( "tag_ground" ) );// TODO - FIXME: this is ugly. Derive from distance between tag_origin and tag_base or whatever that tag was.
|
||||
//self.originheightoffset = 256;
|
||||
self.fastropeoffset = 762;// TODO - FIXME: this is ugly. If only there were a getanimendorigin() command
|
||||
|
||||
self.script_badplace = false;// All helicopters dont need to create bad places
|
||||
//maps\_vehicle::lights_on( "running" );
|
||||
//maps\_vehicle::lights_on( "interior" );
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
// positions[ 0 ].vehicle_getinanim = %tigertank_hatch_open;
|
||||
|
||||
for ( i = 0;i < positions.size;i++ )
|
||||
positions[ i ].vehicle_getoutanim = %bh_idle;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
//#using_animtree( "fastrope" );
|
||||
//setplayer_anims( positions )
|
||||
//{
|
||||
// positions[ 3 ].player_idle = %bh_player_idle;
|
||||
// positions[ 3 ].player_getout_sound = "fastrope_start_plr";
|
||||
// positions[ 3 ].player_getout_sound_loop = "fastrope_loop_plr";
|
||||
// positions[ 3 ].player_getout_sound_end = "fastrope_end_plr";
|
||||
//
|
||||
// positions[ 3 ].player_getout = %bh_player_drop;
|
||||
// //positions[ 3 ].player_getout = %bh_2_drop;
|
||||
// positions[ 3 ].player_animtree = #animtree;
|
||||
//
|
||||
//
|
||||
// positions[ 2 ].player_idle = %bh_player_idle;
|
||||
// positions[ 2 ].player_getout_sound = "fastrope_start_plr";
|
||||
// positions[ 2 ].player_getout_sound_loop = "fastrope_loop_plr";
|
||||
// positions[ 2 ].player_getout_sound_end = "fastrope_end_plr";
|
||||
//
|
||||
// positions[ 2 ].player_getout = %bh_player_drop;
|
||||
// positions[ 2 ].player_animtree = #animtree;
|
||||
//
|
||||
// positions[ 6 ].player_idle = %bh_player_idle;
|
||||
// positions[ 6 ].player_getout_sound = "fastrope_start_plr";
|
||||
// positions[ 6 ].player_getout_sound_loop = "fastrope_loop_plr";
|
||||
// positions[ 6 ].player_getout_sound_end = "fastrope_end_plr";
|
||||
//
|
||||
// positions[ 6 ].player_getout = %bh_player_drop;
|
||||
// //positions[ 6 ].player_getout = %bh_player_drop_P1;
|
||||
// //positions[ 6 ].player_getout = %bh_player_drop_P2;
|
||||
// positions[ 6 ].player_animtree = #animtree;
|
||||
//
|
||||
// return positions;
|
||||
//}
|
||||
|
||||
//#using_animtree( "generic_human" );
|
||||
//
|
||||
//set_coop_player_anims( positions )
|
||||
//{
|
||||
// //positions[ 3 ].player_getout = %bh_player_drop;
|
||||
// positions[ 3 ].player_getout = %bh_2_drop;
|
||||
// positions[ 3 ].player_animtree = #animtree;
|
||||
//
|
||||
// //positions[ 6 ].player_getout = %bh_player_drop;
|
||||
// positions[ 6 ].player_getout = %bh_8_drop;
|
||||
// positions[ 6 ].player_animtree = #animtree;
|
||||
//
|
||||
// return positions;
|
||||
//}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 8;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].idle = %bh_Pilot_idle;
|
||||
positions[ 1 ].idle = %bh_coPilot_idle;
|
||||
|
||||
// 1, 2, 4, 5, 8, 6
|
||||
positions[ 2 ].idle = %bh_1_idle;
|
||||
positions[ 3 ].idle = %bh_2_idle;
|
||||
positions[ 4 ].idle = %bh_4_idle;
|
||||
positions[ 5 ].idle = %bh_5_idle;
|
||||
positions[ 6 ].idle = %bh_8_idle;
|
||||
positions[ 7 ].idle = %bh_6_idle;
|
||||
|
||||
|
||||
positions[ 0 ].sittag = "tag_detach";
|
||||
positions[ 1 ].sittag = "tag_detach";
|
||||
positions[ 2 ].sittag = "tag_detach";
|
||||
positions[ 3 ].sittag = "tag_detach";
|
||||
positions[ 4 ].sittag = "tag_detach";
|
||||
positions[ 5 ].sittag = "tag_detach";
|
||||
positions[ 6 ].sittag = "tag_detach";
|
||||
positions[ 7 ].sittag = "tag_detach";
|
||||
|
||||
|
||||
// 1, 2, 4, 5, 8, 6
|
||||
positions[ 2 ].getout = %bh_1_drop;
|
||||
positions[ 3 ].getout = %bh_2_drop;
|
||||
positions[ 4 ].getout = %bh_4_drop;
|
||||
positions[ 5 ].getout = %bh_5_drop;
|
||||
positions[ 6 ].getout = %bh_8_drop;
|
||||
positions[ 7 ].getout = %bh_6_drop;
|
||||
|
||||
positions[ 2 ].getoutstance = "crouch";
|
||||
positions[ 3 ].getoutstance = "crouch";
|
||||
positions[ 4 ].getoutstance = "crouch";
|
||||
positions[ 5 ].getoutstance = "crouch";
|
||||
positions[ 6 ].getoutstance = "crouch";
|
||||
positions[ 7 ].getoutstance = "crouch";
|
||||
|
||||
|
||||
positions[ 2 ].ragdoll_getout_death = true;
|
||||
positions[ 3 ].ragdoll_getout_death = true;
|
||||
positions[ 4 ].ragdoll_getout_death = true;
|
||||
positions[ 5 ].ragdoll_getout_death = true;
|
||||
positions[ 6 ].ragdoll_getout_death = true;
|
||||
positions[ 7 ].ragdoll_getout_death = true;
|
||||
|
||||
positions[ 2 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 3 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 4 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 5 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 6 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 7 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
|
||||
positions[ 1 ].rappel_kill_achievement = 1;
|
||||
positions[ 2 ].rappel_kill_achievement = 1;
|
||||
positions[ 3 ].rappel_kill_achievement = 1;
|
||||
positions[ 4 ].rappel_kill_achievement = 1;
|
||||
positions[ 5 ].rappel_kill_achievement = 1;
|
||||
positions[ 6 ].rappel_kill_achievement = 1;
|
||||
positions[ 7 ].rappel_kill_achievement = 1;
|
||||
|
||||
// positions[ 2 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 3 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 4 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 5 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 6 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 7 ].getoutsnd = "fastrope_loop_npc";
|
||||
|
||||
positions[ 2 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 3 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 4 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 5 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 6 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 7 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
|
||||
// 1, 2, 4, 5, 6, & 8
|
||||
positions[ 2 ].fastroperig = "TAG_FastRope_RI";// 1 %bh_1_drop
|
||||
positions[ 3 ].fastroperig = "TAG_FastRope_RI"; // 2 %bh_2_drop
|
||||
positions[ 4 ].fastroperig = "TAG_FastRope_LE"; // 4 %bh_4_drop
|
||||
positions[ 5 ].fastroperig = "TAG_FastRope_LE"; // 5 %bh_5_drop
|
||||
positions[ 6 ].fastroperig = "TAG_FastRope_RI";// 8 %bh_8_drop
|
||||
positions[ 7 ].fastroperig = "TAG_FastRope_LE";// 6 %bh_6_drop
|
||||
|
||||
return positions;
|
||||
//return setplayer_anims( positions );
|
||||
//return set_coop_player_anims( positions );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//WIP.. posible to unload different sets of people wirh vehicle notify( "unload", set ); sets defined here.
|
||||
unload_groups()
|
||||
{
|
||||
unload_groups = [];
|
||||
unload_groups[ "left" ] = [];
|
||||
unload_groups[ "right" ] = [];
|
||||
unload_groups[ "both" ] = [];
|
||||
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 4;
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 5;
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 7;
|
||||
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 2;
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 3;
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 6;
|
||||
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 2;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 3;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 4;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 5;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 6;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 7;
|
||||
|
||||
unload_groups[ "default" ] = unload_groups[ "both" ];
|
||||
|
||||
return unload_groups;
|
||||
|
||||
}
|
||||
|
||||
|
||||
set_attached_models()
|
||||
{
|
||||
array = [];
|
||||
array[ "TAG_FastRope_LE" ] = spawnstruct();
|
||||
array[ "TAG_FastRope_LE" ].model = "rope_test";
|
||||
array[ "TAG_FastRope_LE" ].tag = "TAG_FastRope_LE";
|
||||
array[ "TAG_FastRope_LE" ].idleanim = %bh_rope_idle_le;
|
||||
array[ "TAG_FastRope_LE" ].dropanim = %bh_rope_drop_le;
|
||||
|
||||
array[ "TAG_FastRope_RI" ] = spawnstruct();
|
||||
array[ "TAG_FastRope_RI" ].model = "rope_test_ri";
|
||||
array[ "TAG_FastRope_RI" ].tag = "TAG_FastRope_RI";
|
||||
array[ "TAG_FastRope_RI" ].idleanim = %bh_rope_idle_ri;
|
||||
array[ "TAG_FastRope_RI" ].dropanim = %bh_rope_drop_ri;
|
||||
|
||||
strings = getarraykeys( array );
|
||||
|
||||
for ( i = 0;i < strings.size;i++ )
|
||||
{
|
||||
precachemodel( array[ strings[ i ] ].model );
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
//use this function to fastrope the player out of the heli from the gunner position
|
||||
|
||||
//blackhawk_minigun_player_fastrope_think()
|
||||
//{
|
||||
// animfudgetime = 0;
|
||||
// position = 3;
|
||||
// AssertMessage = "In order for the player to fastrope out of the heli at " + self.origin + ", it must have at least one vehicle rider in script_startingposition '" + position + "' with script_drone set to '1' and 'drone_delete_on_unload' set to '1'";
|
||||
// self endon( "death" );
|
||||
// /*-----------------------
|
||||
// FIND THE RIDER THE PLAYER WILL POSESS
|
||||
// -------------------------*/
|
||||
// dummy = undefined;
|
||||
// assertex( isdefined( self.riders ), AssertMessage );
|
||||
// foreach ( AI in self.riders )
|
||||
// {
|
||||
// if ( AI.vehicle_position == position )
|
||||
// {
|
||||
// dummy = AI;
|
||||
// dummy.drone_delete_on_unload = true;
|
||||
// dummy.playerpiggyback = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// assertex( isdefined( dummy ), AssertMessage );
|
||||
// assertex( !isai( dummy ), AssertMessage );
|
||||
// animpos = maps\_vehicle_aianim::anim_pos( self, position );
|
||||
//
|
||||
// /*-----------------------
|
||||
// HIDE THE DUMMY RIDER
|
||||
// -------------------------*/
|
||||
// dummy notsolid();
|
||||
// dummy notify( "newanim" );
|
||||
// dummy detachall();
|
||||
// dummy setmodel( "fastrope_arms" );
|
||||
// dummy useanimtree( animpos.player_animtree );
|
||||
// dummy hide();
|
||||
// thread maps\_vehicle_aianim::guy_idle( dummy, position );
|
||||
// wait .1;
|
||||
//
|
||||
// animtime = getanimlength( animpos.getout );
|
||||
// animtime -= animfudgetime;
|
||||
//
|
||||
// /*-----------------------
|
||||
// LERP PLAYER VIEW TO DUMMY FASTROPING
|
||||
// -------------------------*/
|
||||
// self waittill( "unloading" );
|
||||
// self player_dismount_blackhawk_gun();
|
||||
// level.player PlayerLinkToBlend( dummy, "tag_player", 1, 0, 0 );
|
||||
// //dummy lerp_player_view_to_tag( level.player, "tag_player", 1, 1, 30, 30, 30, 30 );
|
||||
//
|
||||
// //( <linkto entity>, <tag>, <viewpercentag fraction>, <right arc>, <left arc>, <top arc>, <bottom arc>, <use tag angles> )
|
||||
// //level.player playerlinktodelta( dummy, "tag_player", 0.35, 60, 28, 30, 30, false );
|
||||
//
|
||||
// //dummy show();
|
||||
//
|
||||
// wait animtime;
|
||||
//
|
||||
// level.player unlink();
|
||||
// thread hud_hide( false );
|
||||
// level.player enableweapons();
|
||||
// level.player allowprone( true );
|
||||
// level.player allowcrouch( true );
|
||||
//
|
||||
// self notify( "player_fastroped_out" );
|
||||
//}
|
||||
|
||||
|
||||
player_mount_blackhawk_gun( nolerp, player, hide_hud )
|
||||
{
|
||||
if( !IsDefined( player ) )
|
||||
{
|
||||
player = level.player;
|
||||
}
|
||||
|
||||
self.minigunUser = player;
|
||||
|
||||
//self ==> the vehicle being used by the player
|
||||
if ( !isdefined( hide_hud ) )
|
||||
hide_hud = true;
|
||||
thread hud_hide( hide_hud );
|
||||
player allowprone( false );
|
||||
player allowcrouch( false );
|
||||
if ( !isdefined( nolerp ) )
|
||||
{
|
||||
player disableWeapons();
|
||||
//lerp_player_view_to_tag( player, tag, lerptime, fraction, right_arc, left_arc, top_arc, bottom_arc )
|
||||
self lerp_player_view_to_tag( player, "tag_player", 1, 1, 30, 30, 30, 30 );
|
||||
|
||||
}
|
||||
|
||||
self useby( player );
|
||||
tagAngles = self gettagangles( "tag_player" );
|
||||
player setplayerangles( tagAngles + ( 0, 0, 0 ) );
|
||||
flag_set( "player_on_minigun" );
|
||||
self thread maps\_minigun::minigun_think();
|
||||
//thread maps\_minigun::minigun_hints_on();
|
||||
}
|
||||
|
||||
player_dismount_blackhawk_gun()
|
||||
{
|
||||
//self ==> the vehicle being used by the player
|
||||
self useby( self.minigunUser );
|
||||
self.minigunUser unlink();
|
||||
level notify( "player_off_blackhawk_gun" );
|
||||
//level.player playerlinktodelta( self, "tag_player", 1, 50, 50, 30, 45 );
|
||||
//wait( .05 );
|
||||
//self turret_reset();
|
||||
//thread maps\_minigun::minigun_hints_off();
|
||||
//self lerp_player_view_to_tag( "tag_turret_exit", 1, 0.9, 25, 25, 45, 0 );
|
||||
// level.player unlink();
|
||||
//level.player enableWeapons();
|
||||
|
||||
//level.player DisableInvulnerability();
|
||||
//level.player allowprone( true );
|
||||
//level.player allowcrouch( true );
|
||||
//flag_set( "player_off_minigun" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
hud_hide( state )
|
||||
{
|
||||
wait 0.05;
|
||||
if ( state )
|
||||
{
|
||||
setsaveddvar( "ui_hidemap", 1 );
|
||||
SetSavedDvar( "hud_showStance", "0" );
|
||||
SetSavedDvar( "compass", "0" );
|
||||
SetDvar( "old_compass", "0" );
|
||||
SetSavedDvar( "ammoCounterHide", "1" );
|
||||
}
|
||||
else
|
||||
{
|
||||
setsaveddvar( "ui_hidemap", 0 );
|
||||
setSavedDvar( "hud_drawhud", "1" );
|
||||
SetSavedDvar( "hud_showStance", "1" );
|
||||
SetSavedDvar( "compass", "1" );
|
||||
SetDvar( "old_compass", "1" );
|
||||
SetSavedDvar( "ammoCounterHide", "0" );
|
||||
}
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "bm21", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_bm21_mobile", "vehicle_bm21_mobile_dstry", 2.6 );
|
||||
|
||||
precachemodel( "projectile_bm21_missile" );
|
||||
|
||||
// build_deathfx( effect, tag, sound, bEffectLooping, delay, bSoundlooping, waitDelay, stayontag, notifyString )
|
||||
build_deathfx( "explosions/small_vehicle_explosion", "tag_fx_tank", "explo_metal_rand", undefined, undefined, undefined, 0 );
|
||||
build_deathfx( "fire/firelp_med_pm", "tag_deathfx", "fire_metal_medium", undefined, undefined, true, 0 );
|
||||
build_deathfx( "fire/firelp_med_pm", "tag_fx_cab", undefined, undefined, undefined, undefined, 0 );
|
||||
build_deathfx( "explosions/grenadeexp_default", "tag_missile18", "explo_metal_rand", undefined, undefined, undefined, 0.5 );
|
||||
build_deathfx( "explosions/grenadeexp_default", "tag_fx_tank", "explo_metal_rand", undefined, undefined, undefined, 0.8 );
|
||||
build_deathfx( "explosions/grenadeexp_default", "tag_missile14", "explo_metal_rand", undefined, undefined, undefined, 1.0 );
|
||||
build_deathfx( "explosions/grenadeexp_default", "tag_flash", "explo_metal_rand", undefined, undefined, undefined, 1.4 );
|
||||
|
||||
build_deathfx( "explosions/vehicle_explosion_bm21", undefined, "car_explode", undefined, undefined, undefined, 2.6 );
|
||||
build_deathfx( "explosions/vehicle_explosion_bm21_tires", "tag_deathfx", undefined, undefined, undefined, undefined, 2.6 );
|
||||
build_deathfx( "fire/firelp_med_pm", "tag_fx_tire_right_r", undefined, undefined, undefined, undefined, 2.7 );
|
||||
|
||||
|
||||
build_life( 999, 500, 1500 );
|
||||
|
||||
build_team( "allies" );
|
||||
build_drive( %bm21_driving_idle_forward, %bm21_driving_idle_backward, 10 );
|
||||
|
||||
|
||||
build_compassicon( "automobile", false );
|
||||
build_light( model, "headlight_bm21_left", "tag_headlight_left", "misc/car_headlight_bm21", "headlights" );
|
||||
build_light( model, "headlight_bm21_right", "tag_headlight_right", "misc/car_headlight_bm21", "headlights" );
|
||||
build_light( model, "parkinglight_bm21_left_f", "tag_parkinglight_left_f", "misc/car_parkinglight_bm21", "headlights" );
|
||||
build_light( model, "parkinglight_bm21_right_f", "tag_parkinglight_right_f", "misc/car_parkinglight_bm21", "headlights" );
|
||||
build_light( model, "taillight_bm21_right", "tag_taillight_right", "misc/car_taillight_bm21", "headlights" );
|
||||
build_light( model, "taillight_bm21_left", "tag_taillight_left", "misc/car_taillight_bm21", "headlights" );
|
||||
|
||||
build_light( model, "breaklight_bm21_right", "tag_taillight_right", "misc/car_brakelight_bm21", "brakelights" );
|
||||
build_light( model, "breaklight_bm21_left", "tag_taillight_left", "misc/car_brakelight_bm21", "brakelights" );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
|
||||
// maps\_vehicle::lights_on( "headlights" );
|
||||
// maps\_vehicle::lights_on( "brakelights" );
|
||||
|
||||
self.missileModel = "projectile_bm21_missile";
|
||||
self.missileTags = [];
|
||||
self.missileTags[ 0 ] = "tag_missile1";
|
||||
self.missileTags[ 1 ] = "tag_missile2";
|
||||
self.missileTags[ 2 ] = "tag_missile3";
|
||||
self.missileTags[ 3 ] = "tag_missile4";
|
||||
self.missileTags[ 4 ] = "tag_missile5";
|
||||
self.missileTags[ 5 ] = "tag_missile6";
|
||||
self.missileTags[ 6 ] = "tag_missile7";
|
||||
self.missileTags[ 7 ] = "tag_missile8";
|
||||
self.missileTags[ 8 ] = "tag_missile9";
|
||||
self.missileTags[ 9 ] = "tag_missile10";
|
||||
self.missileTags[ 10 ] = "tag_missile11";
|
||||
self.missileTags[ 11 ] = "tag_missile12";
|
||||
self.missileTags[ 12 ] = "tag_missile13";
|
||||
self.missileTags[ 13 ] = "tag_missile14";
|
||||
self.missileTags[ 14 ] = "tag_missile15";
|
||||
self.missileTags[ 15 ] = "tag_missile16";
|
||||
self.missileTags[ 16 ] = "tag_missile17";
|
||||
self.missileTags[ 17 ] = "tag_missile18";
|
||||
self.missileTags[ 18 ] = "tag_missile19";
|
||||
self.missileTags[ 19 ] = "tag_missile20";
|
||||
self.missileTags[ 20 ] = "tag_missile21";
|
||||
self.missileTags[ 21 ] = "tag_missile22";
|
||||
self.missileTags[ 22 ] = "tag_missile23";
|
||||
self.missileTags[ 23 ] = "tag_missile24";
|
||||
self.missileTags[ 24 ] = "tag_missile25";
|
||||
self.missileTags[ 25 ] = "tag_missile26";
|
||||
// self.missileTags[ 26 ] = "tag_missile27";
|
||||
// self.missileTags[ 27 ] = "tag_missile28";
|
||||
// self.missileTags[ 28 ] = "tag_missile29";
|
||||
// self.missileTags[ 29 ] = "tag_missile30";
|
||||
// self.missileTags[ 30 ] = "tag_missile31";
|
||||
// self.missileTags[ 31 ] = "tag_missile32";
|
||||
// self.missileTags[ 32 ] = "tag_missile33";
|
||||
// self.missileTags[ 33 ] = "tag_missile34";
|
||||
// self.missileTags[ 34 ] = "tag_missile35";
|
||||
// self.missileTags[ 35 ] = "tag_missile36";
|
||||
|
||||
thread maps\_vehicle_missile::main();
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_bm21_mobile (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bm21::main( "vehicle_bm21_mobile" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bm21_mobile_bm21
|
||||
sound,vehicle_bm21,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bm21_mobile"
|
||||
default:"vehicletype" "bm21"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,216 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
//SNDFILE=vehicle_bm21
|
||||
build_template( "bm21_drivable", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
// build_deathmodel( "vehicle_bm21_mobile", "vehicle_bm21_mobile_dstry" );// RADNAME = _troops
|
||||
// build_deathmodel( "vehicle_bm21_mobile_cover", "vehicle_bm21_mobile_cover_dstry" );// RADNAME = _troops
|
||||
build_deathmodel( "vehicle_bm21_mobile_bed", "vehicle_bm21_mobile_bed_dstry" );// RADNAME = _troops
|
||||
// build_deathmodel( "vehicle_bm21_mobile_cover_no_bench", "vehicle_bm21_mobile_cover_dstry" );// RADNAME = _troops
|
||||
|
||||
//build_deathfx( "explosions/large_vehicle_explosion", undefined, "explo_metal_rand" );
|
||||
|
||||
// build_deathfx( effect, tag, sound, bEffectLooping, delay, bSoundlooping, waitDelay, stayontag, notifyString )
|
||||
build_deathfx( "explosions/large_vehicle_explosion", undefined, "car_explode", undefined, undefined, undefined, 0 );
|
||||
build_deathfx( "fire/firelp_med_pm", "tag_fx_tire_right_r", undefined, undefined, undefined, true, 0 );
|
||||
build_deathfx( "fire/firelp_med_pm", "tag_fx_cab", "fire_metal_medium", undefined, undefined, true, 0 );
|
||||
build_deathfx( "explosions/small_vehicle_explosion", "tag_fx_tank", "explo_metal_rand", undefined, undefined, undefined, 2 );
|
||||
|
||||
build_deathquake( 1, 1.6, 500 );
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "axis" );
|
||||
build_treadfx();
|
||||
|
||||
build_bulletshield( true );
|
||||
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
build_unload_groups( ::Unload_Groups );
|
||||
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
|
||||
build_light( model, "headlight_truck_left", "tag_headlight_left", "misc/lighthaze", "headlights" );
|
||||
build_light( model, "headlight_truck_right", "tag_headlight_right", "misc/lighthaze", "headlights" );
|
||||
build_light( model, "headlight_truck_left2", "tag_headlight_left", "misc/car_headlight_bm21", "headlights" );
|
||||
build_light( model, "headlight_truck_right2", "tag_headlight_right", "misc/car_headlight_bm21", "headlights" );
|
||||
build_light( model, "parkinglight_truck_left_f", "tag_parkinglight_left_f", "misc/car_parkinglight_bm21", "headlights" );
|
||||
build_light( model, "parkinglight_truck_right_f", "tag_parkinglight_right_f", "misc/car_parkinglight_bm21", "headlights" );
|
||||
build_light( model, "taillight_truck_right", "tag_taillight_right", "misc/car_taillight_bm21", "headlights" );
|
||||
build_light( model, "taillight_truck_left", "tag_taillight_left", "misc/car_taillight_bm21", "headlights" );
|
||||
|
||||
build_light( model, "brakelight_troops_right", "tag_taillight_right", "misc/car_taillight_bm21", "brakelights" );
|
||||
build_light( model, "brakelight_troops_left", "tag_taillight_left", "misc/car_taillight_bm21", "brakelights" );
|
||||
|
||||
build_drive( %bm21_driving_idle_forward, %bm21_driving_idle_backward, 10 );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
// maps\_vehicle::lights_on( "headlights" );
|
||||
// maps\_vehicle::lights_on( "brakelights" );
|
||||
|
||||
}
|
||||
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
|
||||
positions[ 0 ].vehicle_getoutanim = %bm21_driver_climbout_door;
|
||||
positions[ 1 ].vehicle_getoutanim = %bm21_passenger_climbout_door;
|
||||
positions[ 2 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 3 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 4 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 5 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 6 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 7 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 8 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 9 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
|
||||
positions[ 0 ].vehicle_getoutsoundtag = "left_door";
|
||||
positions[ 1 ].vehicle_getoutsoundtag = "right_door";
|
||||
positions[ 2 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 3 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 4 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 5 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 6 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 7 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 8 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 9 ].vehicle_getoutsoundtag = "back_board";
|
||||
|
||||
// positions[ 3 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 4 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 5 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 6 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 7 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 8 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 9 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
|
||||
positions[ 0 ].vehicle_getoutanim_clear = true;
|
||||
positions[ 1 ].vehicle_getoutanim_clear = true;
|
||||
positions[ 2 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 3 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 4 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 5 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 6 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 7 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 8 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 9 ].vehicle_getoutanim_clear = false;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 10;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "tag_driver";
|
||||
positions[ 1 ].sittag = "tag_passenger";
|
||||
positions[ 2 ].sittag = "tag_detach";// RR
|
||||
positions[ 3 ].sittag = "tag_detach";// RR
|
||||
positions[ 4 ].sittag = "tag_detach";// RR
|
||||
positions[ 5 ].sittag = "tag_detach";// RR
|
||||
positions[ 6 ].sittag = "tag_detach";// RL
|
||||
positions[ 7 ].sittag = "tag_detach";// RL
|
||||
positions[ 8 ].sittag = "tag_detach";// RL
|
||||
positions[ 9 ].sittag = "tag_detach";// RL
|
||||
|
||||
positions[ 0 ].idle = %bm21_driver_idle;
|
||||
positions[ 1 ].idle = %bm21_passenger_idle;
|
||||
positions[ 2 ].idle = %bm21_guy1_idle;
|
||||
positions[ 3 ].idle = %bm21_guy2_idle;
|
||||
positions[ 4 ].idle = %bm21_guy3_idle;
|
||||
positions[ 5 ].idle = %bm21_guy4_idle;
|
||||
positions[ 6 ].idle = %bm21_guy5_idle;
|
||||
positions[ 7 ].idle = %bm21_guy6_idle;
|
||||
positions[ 8 ].idle = %bm21_guy7_idle;
|
||||
positions[ 9 ].idle = %bm21_guy8_idle;
|
||||
|
||||
positions[ 0 ].getout = %bm21_driver_climbout;
|
||||
positions[ 1 ].getout = %bm21_passenger_climbout;
|
||||
positions[ 2 ].getout = %bm21_guy1_climbout;
|
||||
positions[ 3 ].getout = %bm21_guy2_climbout;
|
||||
positions[ 4 ].getout = %bm21_guy3_climbout;
|
||||
positions[ 5 ].getout = %bm21_guy4_climbout;
|
||||
positions[ 6 ].getout = %bm21_guy5_climbout;
|
||||
positions[ 7 ].getout = %bm21_guy6_climbout;
|
||||
positions[ 8 ].getout = %bm21_guy7_climbout;
|
||||
positions[ 9 ].getout = %bm21_guy8_climbout;
|
||||
|
||||
positions[ 2 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 3 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 4 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 6 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 7 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 8 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
|
||||
positions[ 2 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 3 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 4 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 5 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 6 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 7 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 8 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 9 ].explosion_death = %death_explosion_up10;
|
||||
|
||||
return positions;
|
||||
|
||||
}
|
||||
|
||||
unload_groups()
|
||||
{
|
||||
unload_groups = [];
|
||||
unload_groups[ "passengers" ] = [];
|
||||
unload_groups[ "all" ] = [];
|
||||
|
||||
group = "passengers";
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 1;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 3;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 4;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 5;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 6;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 7;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 8;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 9;
|
||||
|
||||
group = "all";
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 0;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 1;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 3;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 4;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 5;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 6;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 7;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 8;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 9;
|
||||
|
||||
unload_groups[ "default" ] = unload_groups[ "all" ];
|
||||
|
||||
return unload_groups;
|
||||
}
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_bm21_drivable (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bm21_drivable::main( "vehicle_bm21_mobile_bed" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bm21_drivable
|
||||
sound,vehicle_bm21,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bm21_mobile_bed"
|
||||
default:"vehicletype" "bm21_drivable"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
@@ -0,0 +1,276 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
//SNDFILE=vehicle_bm21
|
||||
build_template( "bm21_troops", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_bm21_mobile_cover_snow", "vehicle_bm21_mobile_cover_dstry" );// RADNAME = _troops
|
||||
build_deathmodel( "vehicle_bm21_mobile", "vehicle_bm21_mobile_dstry" );// RADNAME = _troops
|
||||
build_deathmodel( "vehicle_bm21_mobile_cover", "vehicle_bm21_mobile_cover_dstry" );// RADNAME = _troops
|
||||
build_deathmodel( "vehicle_bm21_mobile_bed", "vehicle_bm21_mobile_bed_dstry" );// RADNAME = _troops
|
||||
build_deathmodel( "vehicle_bm21_mobile_cover_no_bench", "vehicle_bm21_mobile_cover_dstry" );// RADNAME = _troops
|
||||
|
||||
//build_deathfx( "explosions/large_vehicle_explosion", undefined, "explo_metal_rand" );
|
||||
|
||||
// build_deathfx( effect, tag, sound, bEffectLooping, delay, bSoundlooping, waitDelay, stayontag, notifyString )
|
||||
build_deathfx( "explosions/large_vehicle_explosion", undefined, "car_explode", undefined, undefined, undefined, 0 );
|
||||
build_deathfx( "fire/firelp_med_pm", "tag_fx_tire_right_r", undefined, undefined, undefined, true, 0 );
|
||||
build_deathfx( "fire/firelp_med_pm", "tag_fx_cab", "fire_metal_medium", undefined, undefined, true, 0 );
|
||||
build_deathfx( "explosions/small_vehicle_explosion", "tag_fx_tank", "explo_metal_rand", undefined, undefined, undefined, 2 );
|
||||
|
||||
build_deathquake( 1, 1.6, 500 );
|
||||
build_life( 399 );
|
||||
build_team( "axis" );
|
||||
build_treadfx();
|
||||
|
||||
build_bulletshield( true );
|
||||
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
build_unload_groups( ::Unload_Groups );
|
||||
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
|
||||
build_light( model, "headlight_truck_left", "tag_headlight_left", "misc/lighthaze", "headlights" );
|
||||
build_light( model, "headlight_truck_right", "tag_headlight_right", "misc/lighthaze", "headlights" );
|
||||
build_light( model, "headlight_truck_left2", "tag_headlight_left", "misc/car_headlight_bm21", "headlights" );
|
||||
build_light( model, "headlight_truck_right2", "tag_headlight_right", "misc/car_headlight_bm21", "headlights" );
|
||||
build_light( model, "parkinglight_truck_left_f", "tag_parkinglight_left_f", "misc/car_parkinglight_bm21", "headlights" );
|
||||
build_light( model, "parkinglight_truck_right_f", "tag_parkinglight_right_f", "misc/car_parkinglight_bm21", "headlights" );
|
||||
build_light( model, "taillight_truck_right", "tag_taillight_right", "misc/car_taillight_bm21", "headlights" );
|
||||
build_light( model, "taillight_truck_left", "tag_taillight_left", "misc/car_taillight_bm21", "headlights" );
|
||||
|
||||
build_light( model, "brakelight_troops_right", "tag_taillight_right", "misc/car_taillight_bm21", "brakelights" );
|
||||
build_light( model, "brakelight_troops_left", "tag_taillight_left", "misc/car_taillight_bm21", "brakelights" );
|
||||
|
||||
build_drive( %bm21_driving_idle_forward, %bm21_driving_idle_backward, 10 );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
// maps\_vehicle::lights_on( "headlights" );
|
||||
// maps\_vehicle::lights_on( "brakelights" );
|
||||
|
||||
}
|
||||
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
|
||||
positions[ 0 ].vehicle_getoutanim = %bm21_driver_climbout_door;
|
||||
positions[ 1 ].vehicle_getoutanim = %bm21_passenger_climbout_door;
|
||||
positions[ 2 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 3 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 4 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 5 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 6 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 7 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 8 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
positions[ 9 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
|
||||
positions[ 0 ].vehicle_getoutsoundtag = "left_door";
|
||||
positions[ 1 ].vehicle_getoutsoundtag = "right_door";
|
||||
positions[ 2 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 3 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 4 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 5 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 6 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 7 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 8 ].vehicle_getoutsoundtag = "back_board";
|
||||
positions[ 9 ].vehicle_getoutsoundtag = "back_board";
|
||||
|
||||
// positions[ 3 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 4 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 5 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 6 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 7 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 8 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
// positions[ 9 ].vehicle_getoutanim = %bm21_guy_climbout_truckdoor;
|
||||
|
||||
positions[ 0 ].vehicle_getoutanim_clear = true;
|
||||
positions[ 1 ].vehicle_getoutanim_clear = true;
|
||||
positions[ 2 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 3 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 4 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 5 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 6 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 7 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 8 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 9 ].vehicle_getoutanim_clear = false;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 10;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "tag_driver";
|
||||
positions[ 1 ].sittag = "tag_passenger";
|
||||
positions[ 2 ].sittag = "tag_detach";// RR
|
||||
positions[ 3 ].sittag = "tag_detach";// RR
|
||||
positions[ 4 ].sittag = "tag_detach";// RR
|
||||
positions[ 5 ].sittag = "tag_detach";// RR
|
||||
positions[ 6 ].sittag = "tag_detach";// RL
|
||||
positions[ 7 ].sittag = "tag_detach";// RL
|
||||
positions[ 8 ].sittag = "tag_detach";// RL
|
||||
positions[ 9 ].sittag = "tag_detach";// RL
|
||||
|
||||
positions[ 0 ].idle = %bm21_driver_idle;
|
||||
positions[ 1 ].idle = %bm21_passenger_idle;
|
||||
positions[ 2 ].idle = %bm21_guy1_idle;
|
||||
positions[ 3 ].idle = %bm21_guy2_idle;
|
||||
positions[ 4 ].idle = %bm21_guy3_idle;
|
||||
positions[ 5 ].idle = %bm21_guy4_idle;
|
||||
positions[ 6 ].idle = %bm21_guy5_idle;
|
||||
positions[ 7 ].idle = %bm21_guy6_idle;
|
||||
positions[ 8 ].idle = %bm21_guy7_idle;
|
||||
positions[ 9 ].idle = %bm21_guy8_idle;
|
||||
|
||||
positions[ 0 ].getout = %bm21_driver_climbout;
|
||||
positions[ 1 ].getout = %bm21_passenger_climbout;
|
||||
positions[ 2 ].getout = %bm21_guy1_climbout;
|
||||
positions[ 3 ].getout = %bm21_guy2_climbout;
|
||||
positions[ 4 ].getout = %bm21_guy3_climbout;
|
||||
positions[ 5 ].getout = %bm21_guy4_climbout;
|
||||
positions[ 6 ].getout = %bm21_guy5_climbout;
|
||||
positions[ 7 ].getout = %bm21_guy6_climbout;
|
||||
positions[ 8 ].getout = %bm21_guy7_climbout;
|
||||
positions[ 9 ].getout = %bm21_guy8_climbout;
|
||||
|
||||
positions[ 2 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 3 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 4 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 6 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 7 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
positions[ 8 ].getout_secondary = %bm21_guy_climbout_landing;
|
||||
|
||||
positions[ 2 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 3 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 4 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 5 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 6 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 7 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 8 ].explosion_death = %death_explosion_up10;
|
||||
positions[ 9 ].explosion_death = %death_explosion_up10;
|
||||
|
||||
return positions;
|
||||
|
||||
}
|
||||
|
||||
unload_groups()
|
||||
{
|
||||
unload_groups = [];
|
||||
unload_groups[ "passengers" ] = [];
|
||||
unload_groups[ "all" ] = [];
|
||||
|
||||
group = "passengers";
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 1;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 3;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 4;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 5;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 6;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 7;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 8;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 9;
|
||||
|
||||
group = "all";
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 0;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 1;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 3;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 4;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 5;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 6;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 7;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 8;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 9;
|
||||
|
||||
unload_groups[ "default" ] = unload_groups[ "all" ];
|
||||
|
||||
return unload_groups;
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_bm21_mobile_troops (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bm21_mobile_bm21_troops
|
||||
sound,vehicle_bm21,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bm21_mobile"
|
||||
default:"vehicletype" "bm21_troops"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bm21_mobile_bed_troops (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile_bed" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bm21_mobile_bed_bm21_troops
|
||||
sound,vehicle_bm21,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bm21_mobile_bed"
|
||||
default:"vehicletype" "bm21_troops"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bm21_mobile_cover_troops_snow (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile_cover_snow" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bm21_mobile_cover_bm21_troops_snow
|
||||
sound,vehicle_bm21,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bm21_mobile_cover_snow"
|
||||
default:"vehicletype" "bm21_troops"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bm21_mobile_cover_troops (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile_cover" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bm21_mobile_cover_bm21_troops
|
||||
sound,vehicle_bm21,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bm21_mobile_cover"
|
||||
default:"vehicletype" "bm21_troops"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bm21_mobile_cover_no_bench_troops (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile_cover_no_bench" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bm21_mobile_cover_no_bench_bm21_troops
|
||||
sound,vehicle_bm21,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bm21_mobile_cover_no_bench"
|
||||
default:"vehicletype" "bm21_troops"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
+248
@@ -0,0 +1,248 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "bmp", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_bmp", "vehicle_bmp_dsty" );
|
||||
build_deathmodel( "vehicle_bmp_winter", "vehicle_bmp_woodland_dsty" );
|
||||
build_deathmodel( "vehicle_bmp_woodland", "vehicle_bmp_woodland_dsty" );
|
||||
build_deathmodel( "vehicle_bmp_woodland_low", "vehicle_bmp_dsty_low" );
|
||||
build_deathmodel( "vehicle_bmp_woodland_jeepride", "vehicle_bmp_dsty" );
|
||||
build_deathmodel( "vehicle_bmp_desert", "vehicle_bmp_dsty" );
|
||||
build_deathmodel( "vehicle_bmp_thermal", "vehicle_bmp_thermal_dsty" );
|
||||
build_deathmodel( "vehicle_bmp_low", "vehicle_bmp_dsty_low" );
|
||||
|
||||
bmp_death_fx = [];
|
||||
bmp_death_fx[ "vehicle_bmp" ] = "explosions/vehicle_explosion_bmp";
|
||||
bmp_death_fx[ "vehicle_bmp_winter" ] = "explosions/vehicle_explosion_bmp";
|
||||
bmp_death_fx[ "vehicle_bmp_woodland" ] = "explosions/vehicle_explosion_bmp";
|
||||
bmp_death_fx[ "vehicle_bmp_woodland_jeepride" ] = "explosions/vehicle_explosion_bmp";
|
||||
bmp_death_fx[ "vehicle_bmp_woodland_low" ] = "explosions/vehicle_explosion_bmp_low";
|
||||
bmp_death_fx[ "vehicle_bmp_desert" ] = "explosions/vehicle_explosion_bmp";
|
||||
bmp_death_fx[ "vehicle_bmp_thermal" ] = "explosions/large_vehicle_explosion_IR";
|
||||
bmp_death_fx[ "vehicle_bmp_low" ] = "explosions/vehicle_explosion_bmp_low";
|
||||
|
||||
// build_deathfx( effect, tag, sound, bEffectLooping, delay, bSoundlooping, waitDelay, stayontag, notifyString )
|
||||
build_deathfx( "fire/firelp_med_pm", "tag_deathfx" );
|
||||
build_deathfx( "fire/firelp_med_pm", "tag_cargofire", "fire_metal_medium", undefined, undefined, true, 0 );
|
||||
build_deathfx( bmp_death_fx[ model ], undefined, "exp_armor_vehicle", undefined, undefined, undefined, 0 );
|
||||
build_drive( %bmp_movement, %bmp_movement_backwards, 10 );
|
||||
|
||||
if ( issubstr( model, "_low" ) )
|
||||
build_turret( "bmp_turret2", "tag_turret2", "vehicle_bmp_machine_gun_low" );
|
||||
else
|
||||
build_turret( "bmp_turret2", "tag_turret2", "vehicle_bmp_machine_gun" );
|
||||
|
||||
build_radiusdamage( ( 0, 0, 53 ), 512, 300, 20, false );
|
||||
|
||||
build_treadfx();
|
||||
|
||||
build_life( 999, 500, 1500 );
|
||||
|
||||
build_team( "axis" );
|
||||
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
|
||||
build_frontarmor( .33 );// regens this much of the damage from attacks to the front
|
||||
|
||||
build_bulletshield( true );
|
||||
|
||||
build_grenadeshield( true );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
maps\_utility::ent_flag_init( "no_riders_until_unload" );
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
|
||||
// positions[ 0 ].vehicle_getinanim = %tigertank_hatch_open;
|
||||
// positions[ 1 ].vehicle_getoutanim = %tigertank_hatch_open;
|
||||
|
||||
positions[ 0 ].vehicle_getoutanim = %bmp_doors_open;
|
||||
positions[ 0 ].vehicle_getoutanim_clear = false;
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 4;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "tag_guy1";
|
||||
positions[ 1 ].sittag = "tag_guy2";
|
||||
positions[ 2 ].sittag = "tag_guy3";
|
||||
positions[ 3 ].sittag = "tag_guy4";
|
||||
|
||||
positions[ 0 ].idle = %bmp_idle_1;
|
||||
positions[ 1 ].idle = %bmp_idle_2;
|
||||
positions[ 2 ].idle = %bmp_idle_3;
|
||||
positions[ 3 ].idle = %bmp_idle_4;
|
||||
|
||||
positions[ 0 ].getout = %bmp_exit_1;
|
||||
positions[ 1 ].getout = %bmp_exit_2;
|
||||
positions[ 2 ].getout = %bmp_exit_3;
|
||||
positions[ 3 ].getout = %bmp_exit_4;
|
||||
|
||||
positions[ 0 ].getin = %humvee_driver_climb_in;
|
||||
positions[ 1 ].getin = %humvee_passenger_in_L;
|
||||
positions[ 2 ].getin = %humvee_passenger_in_R;
|
||||
positions[ 3 ].getin = %humvee_passenger_in_R;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_bmp (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bmp::main( "vehicle_bmp" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bmp_bmp
|
||||
sound,vehicle_bmp,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bmp"
|
||||
default:"vehicletype" "bmp"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bmp_winter_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bmp::main( "vehicle_bmp_winter", "bmp_physics" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bmp_winter
|
||||
sound,vehicle_bmp,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bmp_winter"
|
||||
default:"vehicletype" "bmp_physics"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bmp_winter (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bmp::main( "vehicle_bmp_winter" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bmp_winter
|
||||
sound,vehicle_bmp,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bmp_winter"
|
||||
default:"vehicletype" "bmp"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bmp_desert (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bmp::main( "vehicle_bmp_desert" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bmp_desert_bmp
|
||||
sound,vehicle_bmp,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bmp_desert"
|
||||
default:"vehicletype" "bmp"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bmp_low (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bmp::main( "vehicle_bmp_low" );
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bmp_low_bmp
|
||||
sound,vehicle_bmp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bmp_low"
|
||||
default:"vehicletype" "bmp"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bmp_thermal (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bmp::main( "vehicle_bmp_thermal" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bmp_thermal_bmp
|
||||
sound,vehicle_bmp,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bmp_thermal"
|
||||
default:"vehicletype" "bmp"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bmp_woodland (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bmp::main( "vehicle_bmp_woodland" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bmp_woodland_bmp
|
||||
sound,vehicle_bmp,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bmp_woodland"
|
||||
default:"vehicletype" "bmp"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bmp_woodland_jeepride (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bmp::main( "vehicle_bmp_woodland_jeepride" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bmp_woodland_jeepride_bmp
|
||||
sound,vehicle_bmp,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bmp_woodland_jeepride"
|
||||
default:"vehicletype" "bmp"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bmp_woodland_low (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bmp::main( "vehicle_bmp_woodland_low" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bmp_woodland_low_bmp
|
||||
sound,vehicle_bmp,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bmp_woodland_low"
|
||||
default:"vehicletype" "bmp"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
@@ -0,0 +1,74 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "bradley", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_deathmodel( "vehicle_bradley", "vehicle_bradley" );
|
||||
build_deathfx( "explosions/large_vehicle_explosion", undefined, "exp_armor_vehicle" );
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
build_mainturret();
|
||||
build_compassicon( "tank" );
|
||||
build_frontarmor( .33 );// regens this much of the damage from attacks to the front
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
/*
|
||||
positions[ 0 ].vehicle_getinanim = %tigertank_hatch_open;
|
||||
positions[ 1 ].vehicle_getoutanim = %tigertank_hatch_open;
|
||||
*/
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 11;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].getout_delete = true;
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_bradley (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bradley::main( "vehicle_bradley" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bradley_bradley
|
||||
sound,vehicle_bradley,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bradley"
|
||||
default:"vehicletype" "bradley"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_bradley_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bradley::main( "vehicle_bradley", "bradley_physics" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bradley_bradley
|
||||
sound,vehicle_bradley,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_bradley"
|
||||
default:"vehicletype" "bradley_physics"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,834 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
_breach global script
|
||||
|
||||
NOTE: Load \test\breach.d3dbsp to test all supported breaches
|
||||
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
Currently supported breaches( sBreachType )
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
"explosive_breach_left"
|
||||
"shotgunhinges_breach_left":
|
||||
"flash_breach_no_door_right":
|
||||
|
||||
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
How to use
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
1 ) Add any of the following above _load:::main();
|
||||
|
||||
maps\_breach_explosive_left::main();
|
||||
maps\_breach_flash_right::main();
|
||||
maps\_breach_hinges_left::main();
|
||||
|
||||
|
||||
* * * * AND * * * * *
|
||||
|
||||
maps\_breach::main();
|
||||
|
||||
|
||||
|
||||
2 ) ROOM VOLUME: Create an info_volume that encompasses the room being assaulted.
|
||||
( used to stun enemies during explosive breaches, determine where AI throws flash grenades,
|
||||
and to detect when the room is cleared )
|
||||
|
||||
3 ) DOOR: Have the room volume script_linkTo a door( script_model or script_brushmodel ) with an origin that
|
||||
points in towards the interior of the room( all stacking / breaching anims play on this origin ).
|
||||
see model com_door_01_handleleft for an example.
|
||||
|
||||
If you use a script_brushmodel, you will need to manually target it to a script_origin on the
|
||||
lower right corner of the door frame that points in towards the interior of the room.
|
||||
|
||||
4 ) NO DOOR: If the breach does not require a door( like for flashbang only breaches ), you need to have the
|
||||
room volume script_linkTo a script_origin on the edge of the door frame pointing in towards the room.
|
||||
|
||||
5 ) BLOCKER: The model door needs to target a script_brushmodel blocker( not necessary if you use
|
||||
a script_brushmodel door instead )
|
||||
|
||||
5 ) EXPLODER: All doors must script_linkTo a script_origin in the center of the door with a 'script_exploder' key
|
||||
of any number. Used to play default fx and will later by used by fx artists for additional
|
||||
smoke or custom effects in the room
|
||||
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
Function arguments
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
< volume > thread breach_think( aBreachers, sBreachType, sHintString, bSpawnHostiles, bPlayDefaultFx, bShoot );
|
||||
|
||||
< volume > = The room volume being breached
|
||||
aBreachers = The array of friendlies performing the breach( can not be more than 2 )
|
||||
sBreachType = which breach to perform. See / test / breach to see currently supported breaches
|
||||
sHintString = Pass a hintstrig to display if you trigger the breach with a "use" trigger
|
||||
bSpawnHostiles = true / false value if you want to spawn hostiles inside right before the breach is started
|
||||
bPlayDefaultFx = defaults to true. Set to false and add effects to the exploder instead if you like
|
||||
bShoot = some breaches have the AI firing randomly as they storm into a room while they are still playing the scripted anim. True by default
|
||||
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
PROPERTIES
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
.firstBreacher - to have a specific guy be the first to a breach. If undefined, will choose whichever AI is closest to the door at the time the breach script is called
|
||||
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
|
||||
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
#include maps\_anim;
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
main()
|
||||
{
|
||||
level._effect[ "_breach_doorbreach_detpack" ] = loadfx( "explosions/exp_pack_doorbreach" );
|
||||
level._effect[ "_breach_doorbreach_kick" ] = loadfx( "dust/door_kick" );
|
||||
level.scr_sound[ "breach_wooden_door" ] = "detpack_explo_main";
|
||||
level.scr_sound[ "breach_wood_door_kick" ] = "wood_door_kick";
|
||||
flag_init( "begin_the_breach" );
|
||||
}
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
BREACH CORE FUNCTIONS
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
|
||||
|
||||
breach_think( aBreachers, sBreachType, sHintString, bSpawnHostiles, bPlayDefaultFx, bShoot )
|
||||
{
|
||||
// self == > the room volume being breached
|
||||
self endon( "breach_abort" );
|
||||
|
||||
// Changing core function called when any scripted sequence calls a fire notetrack
|
||||
// used to determine whether "fire" notetracks should be obeyed or not
|
||||
if ( isdefined( bShoot ) && ( bShoot == false ) )
|
||||
{
|
||||
anim.fire_notetrack_functions[ "scripted" ] = ::breach_fire_straight;
|
||||
}
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
VARIABLE SETUP
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
self.flashthrown = false;
|
||||
self.closestAI = undefined;
|
||||
self.animEnt = undefined;
|
||||
self.breached = false;
|
||||
self.breachers = 0;
|
||||
self.breachersReady = false;
|
||||
self.singleBreacher = false;
|
||||
self.readyToBreach = false;
|
||||
self.AIareInTheRoom = false;
|
||||
self.aboutToBeBreached = false;
|
||||
self.cleared = false;
|
||||
self.hasDoor = true;
|
||||
self.hasFlashbangs = false;
|
||||
self.hostilesSpawned = false;
|
||||
assertEx( ( aBreachers.size <= 2 ), "You cannot send more than 2 AI to perform a breach" );
|
||||
assertEx( ( isdefined( self.targetname ) ), "Room volume must have a targetname to use the breach fuctions" );
|
||||
aVolumes = getentarray( self.targetname, "targetname" );
|
||||
assertEx( ( aVolumes.size == 1 ), "There are multiple room volumes with the same targetname: " + self.targetname );
|
||||
sRoomName = self.targetname;
|
||||
self.sBadplaceName = "badplace_" + sRoomName;
|
||||
self.badplace = getent( "badplace_" + sRoomName, "targetname" );
|
||||
if ( isdefined( self.badplace ) )
|
||||
assertEx( ( self.badplace.classname == "script_origin" ), "The badplace entity for volume " + self.targetname + " needs to be a script_origin" );
|
||||
self.breachtrigger = getent( "trigger_" + sRoomName, "targetname" );
|
||||
if ( !isdefined( bPlayDefaultFx ) )
|
||||
bPlayDefaultFx = true;
|
||||
if ( isdefined( self.breachtrigger ) )
|
||||
{
|
||||
switch( self.breachtrigger.classname )
|
||||
{
|
||||
case "trigger_use":
|
||||
assertEx( ( isdefined( sHintString ) ), "You need to pass a hintstring to the function 'breach_think' for the trigger_use " + self.breachtrigger.targetname );
|
||||
self.triggerHintString = sHintString;
|
||||
break;
|
||||
case "trigger_use_touch":
|
||||
assertEx( ( isdefined( sHintString ) ), "You need to pass a hintstring to the function 'breach_think' for the trigger_use " + self.breachtrigger.targetname );
|
||||
self.triggerHintString = sHintString;
|
||||
break;
|
||||
case "trigger_radius":
|
||||
break;
|
||||
case "trigger_multiple":
|
||||
break;
|
||||
default:
|
||||
assertmsg( "entity with targetname '" + self.breachtrigger.targetname + "' must be a trigger_multiple, trigger_radius, trigger_use or trigger_use_touch" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch( sBreachType )
|
||||
{
|
||||
case "explosive_breach_left":
|
||||
break;
|
||||
case "shotgunhinges_breach_left":
|
||||
break;
|
||||
case "flash_breach_no_door_right":
|
||||
self.hasDoor = false;
|
||||
self.hasFlashbangs = true;
|
||||
break;
|
||||
default:
|
||||
assertmsg( sBreachType + " is not a valid breachType" );
|
||||
break;
|
||||
}
|
||||
if ( self.hasDoor == true )
|
||||
{
|
||||
self.eDoor = getent( self.script_linkto, "script_linkname" );
|
||||
assertEx( ( isdefined( self.eDoor ) ), "Explosive breach room volume " + self.targetname + " needs to scriptLinkto a single door" );
|
||||
if ( self.eDoor.classname == "script_model" )
|
||||
{
|
||||
self.animEnt = spawn( "script_origin", self.eDoor.origin );
|
||||
self.animEnt.angles = self.eDoor.angles;
|
||||
}
|
||||
else if ( self.eDoor.classname == "script_brushmodel" )
|
||||
{
|
||||
self.animEnt = getent( self.eDoor.target, "targetname" );
|
||||
assertEx( ( isdefined( self.animEnt ) ), "Room volume " + self.targetname + " needs it's script_brushmodel door door to target a script_origin in the lower right hand corner of the door frame. Make this script_origin point in towards the room being breached." );
|
||||
assertEx( ( self.animEnt.classname == "script_origin" ), "Room volume " + self.targetname + " needs it's script_brushmodel door door to target a script_origin in the lower right hand corner of the door frame. Make this script_origin point in towards the room being breached." );
|
||||
self.eDoor.vector = anglestoforward( self.animEnt.angles );
|
||||
}
|
||||
self.animEnt.type = "Cover Right";
|
||||
self.eExploderOrigin = getent( self.eDoor.script_linkto, "script_linkname" );
|
||||
assertex( isdefined( self.eExploderOrigin ), "A script_brushmodel / script_model door needs to script_linkTo an exploder( script_origin ) to play particles when opened. Targetname: " + self.targetname );
|
||||
assertEx( ( self.eExploderOrigin.classname == "script_origin" ), "The exploder for this room volume needs to be a script_origin: " + self.targetname );
|
||||
self.iExploderNum = self.eExploderOrigin.script_exploder;
|
||||
assertEx( ( isdefined( self.iExploderNum ) ), "There is no exploder number in the key 'script_exploder' for volume " + self.targetname );
|
||||
}
|
||||
else if ( self.hasDoor == false )
|
||||
{
|
||||
self.animEnt = getent( self.script_linkto, "script_linkname" );
|
||||
assertEx( ( isdefined( self.animEnt ) ), "If there is no door to be breached, you must have the room volume scriptLinkTo a script_origin instead where the AI will play their idle and enter anims." );
|
||||
}
|
||||
if ( self.hasFlashbangs == true )
|
||||
{
|
||||
self.grenadeOrigin = getent( "flashthrow_" + sRoomName, "targetname" );
|
||||
assertEx( ( isdefined( self.grenadeOrigin ) ), "Breaches that have AI throwing flashbangs need a script origin in the center of the door frame with a targetname of: flashthrow_" + sRoomName );
|
||||
self.grenadeDest = getent( self.grenadeOrigin.target, "targetname" );
|
||||
assertEx( ( isdefined( self.grenadeDest ) ), "script_origin 'flashthrow_" + sRoomName + "' needs to target another script_origin where you want the flashbang to be thrown to" );
|
||||
}
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
CLEANUP AND FX
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
self thread breach_abort( aBreachers );
|
||||
self thread breach_cleanup( aBreachers );
|
||||
self thread breach_play_fx( sBreachType, bPlayDefaultFx );
|
||||
|
||||
|
||||
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
DECIDE WHO WILL TAKE UP FIRST POSITION
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
iFirstBreachers = 0;
|
||||
for ( i = 0;i < aBreachers.size;i++ )
|
||||
{
|
||||
if ( isdefined( aBreachers[ i ].firstBreacher ) )
|
||||
{
|
||||
iFirstBreachers++ ;
|
||||
self.closestAI = aBreachers[ i ];
|
||||
}
|
||||
}
|
||||
if ( iFirstBreachers > 0 )
|
||||
assertEx( iFirstBreachers == 1, ".firstBreacher property has been set on " + iFirstBreachers + " AI. Max is one AI " );
|
||||
else
|
||||
self.closestAI = getClosest( self.animEnt.origin, aBreachers );
|
||||
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
SEND EACH AI TO IDLE
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
if ( aBreachers.size == 1 )
|
||||
self.singleBreacher = true;
|
||||
for ( i = 0;i < aBreachers.size;i++ )
|
||||
aBreachers[ i ] thread breacher_think( self, sBreachType, bShoot );
|
||||
|
||||
while ( self.breachers < aBreachers.size )
|
||||
wait( 0.05 );
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
AI IS READY TO BREACH
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
self notify( "ready_to_breach" );
|
||||
self.readyToBreach = true;
|
||||
if ( isdefined( self.breachtrigger ) )
|
||||
{
|
||||
self.breachtrigger thread breach_trigger_think( self );
|
||||
self waittill( "execute_the_breach" );
|
||||
}
|
||||
else
|
||||
{
|
||||
self notify( "execute_the_breach" );
|
||||
}
|
||||
|
||||
flag_set( "begin_the_breach" );
|
||||
self.aboutToBeBreached = true;
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
SPAWN HOSTILES RIGHT AS ROOM IS BEING BREACHED( IF SPECIFIED IN ARGUMENT )
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
|
||||
if ( isdefined( bSpawnHostiles ) && ( bSpawnHostiles == true ) )
|
||||
{
|
||||
spawners = getentarray( "hostiles_" + sRoomName, "targetname" );
|
||||
assertEx( ( isdefined( spawners ) ), "Could not find spawners with targetname of hostiles_" + sRoomName + " for room volume " + self.targetname );
|
||||
// wait for the AI to start breaching the room before spawning hostiles
|
||||
self waittill( "spawn_hostiles" );
|
||||
spawnBreachHostiles( spawners );
|
||||
self.hostilesSpawned = true;
|
||||
}
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
GET ARRAY OF ALL HOSTILES TOUCHING THE ROOM VOLUME
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
// badplace to get AI out of the way of the door
|
||||
if ( isdefined( self.badplace ) )
|
||||
badplace_cylinder( self.sBadplaceName, -1, self.badplace.origin, self.badplace.radius, 200, "bad_guys" );
|
||||
|
||||
|
||||
ai = getaiarray( "bad_guys" );
|
||||
aHostiles = [];
|
||||
for ( i = 0;i < ai.size;i++ )
|
||||
{
|
||||
if ( ai[ i ] isTouching( self ) )
|
||||
aHostiles[ aHostiles.size ] = ai[ i ];
|
||||
}
|
||||
if ( aHostiles.size > 0 )
|
||||
array_thread( aHostiles, ::breach_enemies_stunned, self );
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
WAIT FOR ALL THE AI TO BE IN THE ROOM
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
while ( !self.AIareInTheRoom )
|
||||
wait( 0.05 );
|
||||
|
||||
self notify( "breach_complete" );
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
WAIT FOR ROOM TO BE CLEARED
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
if ( !aHostiles.size )
|
||||
return;
|
||||
|
||||
while ( !self.cleared )
|
||||
{
|
||||
wait( 0.05 );
|
||||
for ( i = 0;i < aHostiles.size;i++ )
|
||||
{
|
||||
if ( !isalive( aHostiles[ i ] ) )
|
||||
aHostiles = array_remove( aHostiles, aHostiles[ i ] );
|
||||
if ( aHostiles.size == 0 )
|
||||
self.cleared = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
breach_dont_fire()
|
||||
{
|
||||
while ( self.breaching == true )
|
||||
{
|
||||
|
||||
self waittillmatch( "single anim", "fire" );
|
||||
self.a.lastShootTime = gettime();
|
||||
}
|
||||
}
|
||||
|
||||
breacher_think( eVolume, sBreachType, bShoot )
|
||||
{
|
||||
// self == > the AI doing the breaching
|
||||
self.breaching = true;
|
||||
self.breachDoNotFire = undefined;
|
||||
if ( !isdefined( bShoot ) )
|
||||
bShoot = true;
|
||||
// self disable_ai_color();
|
||||
// self breach_set_animname( "generic" );// dont need to make people animname generic anymore
|
||||
self pushplayer( true );
|
||||
self thread give_infinite_ammo();
|
||||
|
||||
eVolume endon( "breach_abort" );
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
VARIABLE SETUP
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
self.ender = "stop_idle_" + self getentitynumber();
|
||||
AInumber = undefined;
|
||||
sAnimStart = undefined;
|
||||
sAnimIdle = undefined;
|
||||
sAnimBreach = undefined;
|
||||
sAnimFlash = undefined;
|
||||
|
||||
|
||||
|
||||
if ( self == eVolume.closestAI )
|
||||
AInumber = "01";
|
||||
else
|
||||
AInumber = "02";
|
||||
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
SPECIAL CASE: SINGLE EXPLOSIVVE GUY NEEDS TO BE NUMBER TWO IN THE STACK
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
if ( ( eVolume.singleBreacher == true ) && ( sBreachType == "explosive_breach_left" ) )
|
||||
AInumber = "02";
|
||||
|
||||
switch( sBreachType )
|
||||
{
|
||||
case "explosive_breach_left":
|
||||
if ( ( isdefined( self.usebreachapproach ) ) && ( self.usebreachapproach == false ) )
|
||||
sAnimStart = "detcord_stack_left_start_no_approach_" + AInumber;
|
||||
else
|
||||
sAnimStart = "detcord_stack_left_start_" + AInumber;
|
||||
sAnimIdle = "detcord_stack_leftidle_" + AInumber;
|
||||
sAnimBreach = "detcord_stack_leftbreach_" + AInumber;
|
||||
break;
|
||||
case "shotgunhinges_breach_left":
|
||||
sAnimStart = "shotgunhinges_breach_left_stack_start_" + AInumber;
|
||||
sAnimIdle = "shotgunhinges_breach_left_stack_idle_" + AInumber;
|
||||
sAnimBreach = "shotgunhinges_breach_left_stack_breach_" + AInumber;
|
||||
break;
|
||||
case "flash_breach_no_door_right":
|
||||
if ( eVolume.singleBreacher == true )
|
||||
{
|
||||
sAnimStart = "flash_stack_right_start_single";
|
||||
sAnimIdle = "flash_stack_right_idle_single";
|
||||
sAnimBreach = "flash_stack_right_breach_single";
|
||||
sAnimFlash = "flash_stack_right_flash_single";
|
||||
}
|
||||
else
|
||||
{
|
||||
sAnimStart = "flash_stack_right_start_" + AInumber;
|
||||
sAnimIdle = "flash_stack_right_idle_" + AInumber;
|
||||
sAnimBreach = "flash_stack_right_breach_" + AInumber;
|
||||
sAnimFlash = "flash_stack_right_flash_" + AInumber;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assertmsg( sBreachType + " is not a valid breachType" );
|
||||
break;
|
||||
}
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
AI TO BREACH IDLE
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
self breach_set_goaladius( 64 );
|
||||
|
||||
if ( !isdefined( self.usebreachapproach ) || self.usebreachapproach )
|
||||
{
|
||||
eVolume.animEnt anim_generic_reach( self, sAnimStart );
|
||||
}
|
||||
else
|
||||
{
|
||||
self.scriptedarrivalent = eVolume.animEnt;
|
||||
eVolume.animEnt anim_generic_reach_and_arrive( self, sAnimStart );
|
||||
}
|
||||
|
||||
eVolume.animEnt anim_generic( self, sAnimStart );
|
||||
eVolume.animEnt thread anim_generic_loop( self, sAnimIdle, self.ender );
|
||||
self.setGoalPos = self.origin;
|
||||
eVolume.breachers++ ;
|
||||
|
||||
self.scriptedarrivalent = undefined;
|
||||
eVolume waittill( "execute_the_breach" );
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
AI FLASHES THE ROOM
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
if ( ( !eVolume.flashthrown ) && ( isdefined( sAnimFlash ) ) )
|
||||
{
|
||||
eVolume.animEnt notify( self.ender );
|
||||
eVolume.animEnt thread anim_generic( self, sAnimFlash );
|
||||
wait( 1 );
|
||||
|
||||
// magic grenade from second guy
|
||||
if ( ( AInumber == "02" ) || ( eVolume.singleBreacher == true ) )
|
||||
{
|
||||
sHandTag = "J_Mid_LE_1";
|
||||
self attach( "projectile_m84_flashbang_grenade", sHandTag );
|
||||
oldGrenadeWeapon = self.grenadeWeapon;
|
||||
self.grenadeWeapon = "flash_grenade";
|
||||
self.grenadeAmmo++ ;
|
||||
if ( AInumber == "02" )
|
||||
self waittillmatch( "single anim", "grenade_throw" );
|
||||
if ( ( eVolume.singleBreacher == true ) && ( AInumber == "01" ) )
|
||||
self waittillmatch( "single anim", "fire" );
|
||||
self magicgrenade( eVolume.grenadeOrigin.origin, eVolume.grenadeDest.origin, level.iFlashFuse );
|
||||
self detach( "projectile_m84_flashbang_grenade", sHandTag );
|
||||
self.grenadeWeapon = oldGrenadeWeapon;
|
||||
self.grenadeAmmo = 0;
|
||||
}
|
||||
|
||||
self waittillmatch( "single anim", "end" );
|
||||
eVolume.animEnt thread anim_generic_loop( self, sAnimIdle, self.ender );
|
||||
wait( .1 );
|
||||
}
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
PLAY BREACH ANIMS ON BOTH AI
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
eVolume.animEnt notify( self.ender );
|
||||
|
||||
if ( bShoot == false )
|
||||
self.breachDoNotFire = true;
|
||||
eVolume.animEnt thread anim_generic( self, sAnimBreach );
|
||||
// eVolume.animEnt anim_generic( self, sAnimBreach );
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
CONDITIONAL: EXPLOSIVE BREACH
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
if ( sBreachType == "explosive_breach_left" )
|
||||
{
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
BLOW THE DOOR
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
if ( AInumber == "02" )
|
||||
{
|
||||
self thread detcord_logic( eVolume );
|
||||
self waittillmatch( "single anim", "pull fuse" );
|
||||
wait( 1 );
|
||||
eVolume notify( "spawn_hostiles" );
|
||||
eVolume notify( "detpack_about_to_blow" );
|
||||
self waittillmatch( "single anim", "explosion" );
|
||||
eVolume notify( "detpack_detonated" );
|
||||
eVolume.breached = true;
|
||||
eVolume.eDoor thread door_open( "explosive", eVolume );
|
||||
eVolume notify( "play_breach_fx" );
|
||||
}
|
||||
}
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
CONDITIONAL: SHOTGUN BREACH A
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
else if ( sBreachType == "shotgunhinges_breach_left" )
|
||||
{
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
SHOOT THE DOOR
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
if ( AInumber == "01" )
|
||||
{
|
||||
eVolume notify( "spawn_hostiles" );
|
||||
self waittillmatch( "single anim", "kick" );
|
||||
eVolume.eDoor thread door_open( "shotgun", eVolume );
|
||||
eVolume notify( "play_breach_fx" );
|
||||
}
|
||||
}
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
CONDITIONAL: SHACK BREACH
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
else if ( sBreachType == "flash_breach_no_door_right" )
|
||||
{
|
||||
// Nothing conditional to do for this breach yet
|
||||
}
|
||||
|
||||
/* -- -- -- -- -- -- -- -- -- -- -- -
|
||||
AI FINISHES ENTERING
|
||||
-- -- -- -- -- -- -- -- -- -- -- -- -*/
|
||||
self waittillmatch( "single anim", "end" );
|
||||
self notify( "breach_complete" );
|
||||
if ( bShoot == false )
|
||||
self.breachDoNotFire = undefined;
|
||||
|
||||
if ( isdefined( level.friendly_breach_thread ) )
|
||||
self thread [[ level.friendly_breach_thread ]]( eVolume );
|
||||
|
||||
eVolume.AIareInTheRoom = true;
|
||||
// self setgoalvolume( eVolume );
|
||||
self pushplayer( false );
|
||||
self breach_reset_animname();
|
||||
|
||||
while ( !eVolume.cleared )
|
||||
wait( 0.05 );
|
||||
|
||||
self.breaching = false;
|
||||
}
|
||||
|
||||
breach_fire_straight()
|
||||
{
|
||||
// Changing core function called when any scripted sequence calls a fire notetrack
|
||||
if ( isdefined( self.breachDoNotFire ) )
|
||||
return;
|
||||
animscripts\shared::fire_straight();
|
||||
}
|
||||
|
||||
detcord_logic( eVolume )
|
||||
{
|
||||
// self == > the AI placing the detcord
|
||||
self thread sound_effect_play( eVolume );
|
||||
self waittillmatch( "single anim", "attach prop right" );
|
||||
sHandTag = "TAG_INHAND";
|
||||
// spawn detcord model and attach to guy's hand
|
||||
|
||||
// attach detcord to AI hand
|
||||
self attach( "weapon_detcord", sHandTag );
|
||||
self waittillmatch( "single anim", "detach prop right" );
|
||||
// spawn detcord model and delete other one
|
||||
org_hand = self gettagorigin( sHandTag );
|
||||
angles_hand = self gettagangles( sHandTag );
|
||||
self detach( "weapon_detcord", sHandTag );
|
||||
model_detcord = spawn( "script_model", org_hand );
|
||||
model_detcord setmodel( "weapon_detcord" );
|
||||
model_detcord.angles = angles_hand;
|
||||
|
||||
// delete once door is breached
|
||||
eVolume waittill( "detpack_detonated" );
|
||||
radiusdamage( model_detcord.origin, 64, 50, 25 );
|
||||
model_detcord delete();
|
||||
}
|
||||
|
||||
sound_effect_play( eVolume )
|
||||
{
|
||||
self waittillmatch( "single anim", "sound effect" );
|
||||
thread play_sound_in_space( "detpack_plant_arming", eVolume.animEnt.origin );
|
||||
}
|
||||
|
||||
breach_enemies_stunned( eRoomVolume )
|
||||
{
|
||||
// self == > the room volume being breached
|
||||
self endon( "death" );
|
||||
eRoomVolume endon( "breach_aborted" );
|
||||
|
||||
eRoomVolume waittill( "detpack_detonated" );
|
||||
if ( distance( self.origin, eRoomVolume.animEnt.origin ) <= level.detpackStunRadius )
|
||||
{
|
||||
// self flashBangStart( 0.25 );
|
||||
level.stunnedAnimNumber++ ;
|
||||
if ( level.stunnedAnimNumber > 2 )
|
||||
level.stunnedAnimNumber = 1;
|
||||
sStunnedAnim = "exposed_flashbang_v" + level.stunnedAnimNumber;
|
||||
// self breach_set_animname( "generic" );// dont need to make people animname generic anymore
|
||||
self.allowdeath = true;
|
||||
self anim_generic_custom_animmode( self, "gravity", sStunnedAnim );
|
||||
//self anim_generic( self, sStunnedAnim );
|
||||
self breach_reset_animname();
|
||||
}
|
||||
}
|
||||
|
||||
breach_trigger_think( eRoomVolume )
|
||||
{
|
||||
// self == > the trigger
|
||||
eRoomVolume endon( "execute_the_breach" );
|
||||
eRoomVolume endon( "breach_aborted" );
|
||||
|
||||
self thread breach_trigger_cleanup( eRoomVolume );
|
||||
// self trigger_on();// wtf is this for?
|
||||
// if ( ( self.classname == "trigger_use" ) || ( self.classname == "trigger_use_touch" ) )
|
||||
// {
|
||||
// self setHintString( eRoomVolume.triggerHintString );
|
||||
// if ( isdefined( eRoomVolume.eDoor ) )
|
||||
// {
|
||||
// // spawn a flashing objective on door frame
|
||||
// eRoomVolume.eBreachmodel = spawn( "script_model", eRoomVolume.eDoor.origin );
|
||||
// eRoomVolume.eBreachmodel.angles = eRoomVolume.eDoor.angles;
|
||||
// eRoomVolume.eBreachmodel setmodel( level.door_objmodel );
|
||||
// }
|
||||
// }
|
||||
self waittill( "trigger" );
|
||||
eRoomVolume notify( "execute_the_breach" );
|
||||
}
|
||||
|
||||
breach_trigger_cleanup( eRoomVolume )
|
||||
{
|
||||
eRoomVolume waittill( "execute_the_breach" );
|
||||
self trigger_off();
|
||||
if ( isdefined( eRoomVolume.eBreachmodel ) )
|
||||
eRoomVolume.eBreachmodel delete();
|
||||
|
||||
}
|
||||
breach_abort( aBreachers )
|
||||
{
|
||||
// self == > the room volume being breached
|
||||
self endon( "breach_complete" );
|
||||
self waittill( "breach_abort" );
|
||||
|
||||
self.cleared = true;
|
||||
self thread breach_cleanup( aBreachers );
|
||||
}
|
||||
|
||||
breach_cleanup( aBreachers )
|
||||
{
|
||||
// self == > the room volume being breached
|
||||
while ( !self.cleared )
|
||||
wait( 0.05 );
|
||||
if ( isdefined( self.badplace ) )
|
||||
badplace_delete( self.sBadplaceName );
|
||||
|
||||
while ( !self.cleared )
|
||||
wait( 0.05 );
|
||||
|
||||
array_thread( aBreachers, ::breach_AI_reset, self );
|
||||
}
|
||||
|
||||
breach_AI_reset( eVolume )
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
self breach_reset_animname();
|
||||
self breach_reset_goaladius();
|
||||
eVolume.animEnt notify( self.ender );
|
||||
self notify( "stop_infinite_ammo" );
|
||||
|
||||
self pushplayer( false );
|
||||
}
|
||||
|
||||
breach_play_fx( sBreachType, bPlayDefaultFx )
|
||||
{
|
||||
// self == > the room volume being breached
|
||||
self endon( "breach_aborted" );
|
||||
self endon( "breach_complete" );
|
||||
|
||||
switch( sBreachType )
|
||||
{
|
||||
case "explosive_breach_left":
|
||||
self waittill( "play_breach_fx" );
|
||||
exploder( self.iExploderNum );
|
||||
thread play_sound_in_space( level.scr_sound[ "breach_wooden_door" ], self.eExploderOrigin.origin );
|
||||
if ( bPlayDefaultFx )
|
||||
playfx( level._effect[ "_breach_doorbreach_detpack" ], self.eExploderOrigin.origin, anglestoforward( self.eExploderOrigin.angles ) );
|
||||
break;
|
||||
case "shotgunhinges_breach_left":
|
||||
self waittill( "play_breach_fx" );
|
||||
exploder( self.iExploderNum );
|
||||
if ( bPlayDefaultFx )
|
||||
playfx( level._effect[ "_breach_doorbreach_kick" ], self.eExploderOrigin.origin, anglestoforward( self.eExploderOrigin.angles ) );
|
||||
break;
|
||||
case "flash_breach_no_door_right":
|
||||
// no effects since there is no door
|
||||
break;
|
||||
default:
|
||||
assertmsg( sBreachType + " is not a valid breachType" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
BREACH UTILITY FUNCTIONS
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
|
||||
|
||||
spawnHostile( eEntToSpawn )
|
||||
{
|
||||
spawnedGuy = eEntToSpawn dospawn();
|
||||
spawn_failed( spawnedGuy );
|
||||
assert( isDefined( spawnedGuy ) );
|
||||
return spawnedGuy;
|
||||
}
|
||||
|
||||
spawnBreachHostiles( arrayToSpawn )
|
||||
{
|
||||
assertEx( ( arrayToSpawn.size > 0 ), "The array passed to spawnBreachHostiles function is empty" );
|
||||
spawnedGuys = [];
|
||||
for ( i = 0;i < arrayToSpawn.size;i++ )
|
||||
{
|
||||
guy = spawnHostile( arrayToSpawn[ i ] );
|
||||
spawnedGuys[ spawnedGuys.size ] = guy;
|
||||
|
||||
}
|
||||
// check to ensure all the guys were spawned
|
||||
assertEx( ( arrayToSpawn.size == spawnedGuys.size ), "Not all guys were spawned successfully from spawnBreachHostiles" );
|
||||
|
||||
// Return an array containing all the spawned guys
|
||||
return spawnedGuys;
|
||||
}
|
||||
|
||||
give_infinite_ammo()
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "stop_infinite_ammo" );
|
||||
while ( isdefined( self.weapon ) )
|
||||
{
|
||||
if ( ( isdefined( self.weapon ) ) && ( self.weapon == "none" ) )
|
||||
break;
|
||||
self.bulletsInClip = weaponClipSize( self.weapon );
|
||||
wait( .5 );
|
||||
}
|
||||
}
|
||||
|
||||
door_open( sType, eVolume, bPlaySound )
|
||||
{
|
||||
if ( !isDefined( bPlaySound ) )
|
||||
bPlaySound = true;
|
||||
|
||||
if ( bPlaysound == true )
|
||||
self playsound( level.scr_sound[ "breach_wood_door_kick" ] );
|
||||
|
||||
|
||||
switch( sType )
|
||||
{
|
||||
case "explosive":
|
||||
self thread door_fall_over( eVolume.animEnt );
|
||||
self door_connectpaths();
|
||||
self playsound( level.scr_sound[ "breach_wooden_door" ] );
|
||||
earthquake( 0.4, 1, self.origin, 1000 );
|
||||
radiusdamage( self.origin, 56, level.maxDetpackDamage, level.minDetpackDamage );
|
||||
break;
|
||||
case "shotgun":
|
||||
self thread door_fall_over( eVolume.animEnt );
|
||||
self door_connectpaths();
|
||||
self playsound( level.scr_sound[ "breach_wooden_door" ] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
door_connectpaths()
|
||||
{
|
||||
|
||||
if ( self.classname == "script_brushmodel" )
|
||||
self connectpaths();
|
||||
else
|
||||
{
|
||||
blocker = getent( self.target, "targetname" );
|
||||
assertex( isdefined( blocker ), "A script_model door needs to target a script_brushmodel that blocks the door." );
|
||||
blocker hide();
|
||||
blocker notsolid();
|
||||
blocker connectpaths();
|
||||
}
|
||||
}
|
||||
|
||||
door_fall_over( animEnt )
|
||||
{
|
||||
assert( isdefined( animEnt ) );
|
||||
vector = undefined;
|
||||
if ( self.classname == "script_model" )
|
||||
vector = anglestoforward( self.angles );
|
||||
else if ( self.classname == "script_brushmodel" )
|
||||
vector = self.vector;
|
||||
else
|
||||
assertmsg( "door needs to be either a script_model or a script_brushmodel" );
|
||||
dist = ( vector[ 0 ] * 20, vector[ 1 ] * 20, vector[ 2 ] * 20 );
|
||||
|
||||
self moveto( self.origin + dist, .5, 0, .5 );
|
||||
|
||||
rotationDummy = spawn( "script_origin", ( 0, 0, 0 ) );
|
||||
rotationDummy.angles = animEnt.angles;
|
||||
rotationDummy.origin = ( self.origin[ 0 ], self.origin[ 1 ], animEnt.origin[ 2 ] );
|
||||
|
||||
self linkTo( rotationDummy );
|
||||
|
||||
rotationDummy rotatepitch( 90, 0.45, 0.40 );
|
||||
wait 0.45;
|
||||
rotationDummy rotatepitch( -4, 0.2, 0, 0.2 );
|
||||
wait 0.2;
|
||||
rotationDummy rotatepitch( 4, 0.15, 0.15 );
|
||||
wait 0.15;
|
||||
self unlink();
|
||||
rotationDummy delete();
|
||||
}
|
||||
|
||||
breach_set_goaladius( fRadius )
|
||||
{
|
||||
if ( !isdefined( self.old_goalradius ) )
|
||||
self.old_goalradius = self.goalradius;
|
||||
self.goalradius = fRadius;
|
||||
}
|
||||
|
||||
breach_reset_goaladius()
|
||||
{
|
||||
if ( isdefined( self.old_goalradius ) )
|
||||
self.goalradius = self.old_goalradius;
|
||||
self.old_goalradius = undefined;
|
||||
}
|
||||
|
||||
|
||||
breach_set_animname( animname )
|
||||
{
|
||||
if ( !isdefined( self.old_animname ) )
|
||||
self.old_animname = self.animname;
|
||||
self.animname = animname;
|
||||
}
|
||||
|
||||
breach_reset_animname()
|
||||
{
|
||||
if ( isdefined( self.old_animname ) )
|
||||
self.animname = self.old_animname;
|
||||
self.old_animname = undefined;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
/*-----------------------
|
||||
EXPLOSIVE BREACH (LEFT SIDE)
|
||||
-------------------------*/
|
||||
level.maxDetpackDamage = 100; // max damage done by breach detpacks
|
||||
level.minDetpackDamage = 50; // max damage done by breach detpacks
|
||||
level.detpackStunRadius = 250; // how close enemies have to be to detpack to be stunned
|
||||
level.door_objmodel = "com_door_breach_left_obj";
|
||||
level.stunnedAnimNumber = 1;
|
||||
|
||||
precacheModel( level.door_objmodel );
|
||||
precacheModel( "weapon_detcord" );
|
||||
|
||||
level.scr_anim[ "generic" ][ "detcord_stack_left_start_01" ] = %breach_stackL_approach;
|
||||
level.scr_anim[ "generic" ][ "detcord_stack_left_start_02" ] = %breach_explosive_approach;
|
||||
|
||||
level.scr_anim[ "generic" ][ "detcord_stack_left_start_no_approach_01" ] = %explosivebreach_v1_stackL_idle;
|
||||
level.scr_anim[ "generic" ][ "detcord_stack_left_start_no_approach_02" ] = %explosivebreach_v1_detcord_idle;
|
||||
|
||||
level.scr_anim[ "generic" ][ "detcord_stack_leftidle_01" ][ 0 ] = %explosivebreach_v1_stackL_idle;
|
||||
level.scr_anim[ "generic" ][ "detcord_stack_leftidle_02" ][ 0 ] = %explosivebreach_v1_detcord_idle;
|
||||
|
||||
level.scr_anim[ "generic" ][ "detcord_stack_leftbreach_01" ] = %explosivebreach_v1_stackL;
|
||||
level.scr_anim[ "generic" ][ "detcord_stack_leftbreach_02" ] = %explosivebreach_v1_detcord;
|
||||
|
||||
level.scr_anim[ "generic" ][ "exposed_flashbang_v1" ] = %exposed_flashbang_v1;
|
||||
level.scr_anim[ "generic" ][ "exposed_flashbang_v2" ] = %exposed_flashbang_v2;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
//level.door_objmodel = "com_door_breach_left_obj";
|
||||
//precacheModel( level.door_objmodel );
|
||||
/*-----------------------
|
||||
SHOTGUN BREACH A (HINGE SHOOT #1)
|
||||
-------------------------*/
|
||||
|
||||
level.scr_anim[ "generic" ][ "shotgunhinges_breach_left_stack_start_01" ] = %breach_sh_breacherL1_idle;
|
||||
level.scr_anim[ "generic" ][ "shotgunhinges_breach_left_stack_start_02" ] = %breach_sh_stackR1_idle;
|
||||
|
||||
level.scr_anim[ "generic" ][ "shotgunhinges_breach_left_stack_idle_01" ][ 0 ] = %breach_sh_breacherL1_idle;
|
||||
level.scr_anim[ "generic" ][ "shotgunhinges_breach_left_stack_idle_02" ][ 0 ] = %breach_sh_stackR1_idle;
|
||||
|
||||
level.scr_anim[ "generic" ][ "shotgunhinges_breach_left_stack_breach_01" ] = %breach_sh_breacherL1_enter;
|
||||
level.scr_anim[ "generic" ][ "shotgunhinges_breach_left_stack_breach_02" ] = %breach_sh_stackR1_enter;
|
||||
|
||||
// animated door breach ==> breach_sh_door
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
|
||||
main( model, type )
|
||||
{
|
||||
//SNDFILE=vehicle_hummer
|
||||
|
||||
precacheModel( "vehicle_m60a1_bridge" );
|
||||
build_template( "bridge_layer", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_bridge_layer", "vehicle_hummer_destroyed" );
|
||||
build_drive( %abrams_movement, %abrams_movement_backwards, 10 );
|
||||
|
||||
build_deathfx( "fire/firelp_med_pm", "TAG_CAB_FIRE", "fire_metal_medium", undefined, undefined, true, 0 );
|
||||
build_deathfx( "explosions/vehicle_explosion_hummer", "tag_deathfx", "car_explode" );
|
||||
|
||||
// build_drive( %humvee_50cal_driving_idle_forward, %humvee_50cal_driving_idle_backward, 10 );
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
model = spawn( "script_model", (0,0,0) );
|
||||
model setmodel( "vehicle_m60a1_bridge" );
|
||||
model linkto( self, "tag_bridge_attach", (0,0,0), (0,0,0) );
|
||||
self.bridge_model = model;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_bridge_layer (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_bridge_layer::main( "vehicle_bridge_layer" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_bridge_layer
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_bridge_layer,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_bridge_layer"
|
||||
default:"vehicletype" "bridge_layer"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,346 @@
|
||||
/*
|
||||
MISSION BRIEFING
|
||||
*/
|
||||
|
||||
main()
|
||||
{
|
||||
setsaveddvar( "hud_drawhud", 0 );
|
||||
|
||||
level.script = tolower( getdvar( "mapname" ) );
|
||||
if ( !isdefined( level.tmpmsg ) )
|
||||
level.tmpmsg = [];
|
||||
|
||||
player = getentarray( "player", "classname" )[ 0 ];
|
||||
setsaveddvar( "g_speed", 0 );
|
||||
player setViewmodel( "viewmodel_hands_cloth" ); // hack
|
||||
|
||||
precacheShader( "black" );
|
||||
|
||||
movieDefined = 0;
|
||||
for ( index = 0; index < level.slide.size; index++ )
|
||||
{
|
||||
if ( isdefined( level.slide[ index ][ "movie" ] ) )
|
||||
{
|
||||
movieDefined = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( movieDefined )
|
||||
{
|
||||
// movie
|
||||
wait 0.05;
|
||||
player gotothelevel( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Press &&BUTTON_SELECTCHOICE" to Skip."
|
||||
precacheString( &"SCRIPT_PLATFORM_FIRE_TO_SKIP" );
|
||||
for ( i = 0;i < level.slide.size;i++ )
|
||||
if ( isdefined( level.slide[ i ][ "image" ] ) )
|
||||
precacheshader( level.slide[ i ][ "image" ] );
|
||||
|
||||
player thread skipthebriefing();
|
||||
player dothebriefing();
|
||||
player gotothelevel( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Does the initial startup for a mission briefing
|
||||
// iFadeTime Is the length of time it will take to transition between images. Defaults to 500 (milliseconds) Set to 0 for instant change
|
||||
start( fFadeTime )
|
||||
{
|
||||
level.briefing_running = true;
|
||||
level.briefing_ending = false;
|
||||
level.PlaceNextImage = "A";
|
||||
|
||||
if ( isdefined( level.imageA ) )
|
||||
level.imageA destroy();
|
||||
if ( isdefined( level.imageB ) )
|
||||
level.imageB destroy();
|
||||
if ( isdefined( level.blackscreen ) )
|
||||
level.blackscreen destroy();
|
||||
if ( isdefined( level.FiretoSkip ) )
|
||||
level.FiretoSkip destroy();
|
||||
|
||||
if ( !isDefined( fFadeTime ) || !fFadeTime )
|
||||
{
|
||||
level.briefing_fadeInTime = 0.5;
|
||||
level.briefing_fadeOutTime = 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
level.briefing_fadeInTime = fFadeTime;
|
||||
level.briefing_fadeOutTime = fFadeTime;
|
||||
}
|
||||
|
||||
self endon( "briefingskip" );
|
||||
self thread skipCheck();
|
||||
|
||||
// Make the screen black
|
||||
level.blackscreen = newHudElem();
|
||||
level.blackscreen.sort = -1;
|
||||
level.blackscreen.alignX = "left";
|
||||
level.blackscreen.alignY = "top";
|
||||
level.blackscreen.x = 0;
|
||||
level.blackscreen.y = 0;
|
||||
level.blackscreen.horzAlign = "fullscreen";
|
||||
level.blackscreen.vertAlign = "fullscreen";
|
||||
level.blackscreen.foreground = true;
|
||||
|
||||
level.blackscreen.alpha = 1;
|
||||
level.blackscreen setShader( "black", 640, 480 );
|
||||
|
||||
// Fire to skip text
|
||||
level.FiretoSkip = newHudElem();
|
||||
level.FiretoSkip.sort = 1;
|
||||
level.FiretoSkip.alignX = "center";
|
||||
level.FiretoSkip.alignY = "top";
|
||||
level.FiretoSkip.fontScale = 2;
|
||||
level.FiretoSkip.x = 0;
|
||||
level.FiretoSkip.y = 60;
|
||||
level.FiretoSkip.horzAlign = "center";
|
||||
level.FiretoSkip.vertAlign = "fullscreen";
|
||||
level.FiretoSkip.foreground = true;
|
||||
// Press &&BUTTON_SELECTCHOICE" to Skip."
|
||||
level.FiretoSkip settext( &"SCRIPT_PLATFORM_FIRE_TO_SKIP" );
|
||||
level.FiretoSkip.alpha = 0.0;
|
||||
|
||||
thread fadeInFireToSkip();
|
||||
|
||||
//Image A
|
||||
level.imageA = newHudElem();
|
||||
level.imageA.alignX = "center";
|
||||
level.imageA.alignY = "middle";
|
||||
level.imageA.x = 320;
|
||||
level.imageA.y = 240;
|
||||
level.imageA.alpha = 0;
|
||||
level.imageA.horzAlign = "fullscreen";
|
||||
level.imageA.vertAlign = "fullscreen";
|
||||
level.imageA setShader( "black", 640, 360 );
|
||||
level.imageA.foreground = true;
|
||||
|
||||
//Image B
|
||||
level.imageB = newHudElem();
|
||||
level.imageB.alignX = "center";
|
||||
level.imageB.alignY = "middle";
|
||||
level.imageB.x = 320;
|
||||
level.imageB.y = 240;
|
||||
level.imageB.horzAlign = "fullscreen";
|
||||
level.imageB.vertAlign = "fullscreen";
|
||||
level.imageB.alpha = 0;
|
||||
level.imageB setShader( "black", 640, 360 );
|
||||
level.imageB.foreground = true;
|
||||
|
||||
self freezeControls( true );
|
||||
|
||||
wait .5;
|
||||
|
||||
for ( i = 0;i < level.slide.size;i++ )
|
||||
{
|
||||
soundplaying = false;
|
||||
if ( isdefined( level.slide[ i ][ "image" ] ) )
|
||||
{
|
||||
if ( level.script[ 0 ] != "m" )// movie_ maps don't play the sound
|
||||
self soundplay( "slide_advance" );
|
||||
wait .5;
|
||||
self thread image( level.slide[ i ][ "image" ] );
|
||||
}
|
||||
if ( isdefined( level.slide[ i ][ "dialog_wait" ] ) && self.dialogplaying[ level.slide[ i ][ "dialog_wait" ] ] )
|
||||
{
|
||||
self waittill( level.slide[ i ][ "dialog_wait" ] + "sounddone" );
|
||||
}
|
||||
if ( isdefined( level.slide[ i ][ "dialog" ] ) )
|
||||
{
|
||||
self soundplay( level.slide[ i ][ "dialog" ], level.slide[ i ][ "dialog" ] + "sounddone" );
|
||||
soundplaying = true;
|
||||
}
|
||||
if ( isdefined( level.slide[ i ][ "delay" ] ) )
|
||||
{
|
||||
wait( level.slide[ i ][ "delay" ] );
|
||||
}
|
||||
else if ( soundplaying )
|
||||
{
|
||||
self waittill( level.slide[ i ][ "dialog" ] + "sounddone" );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fadeInFireToSkip()
|
||||
{
|
||||
wait( 1 );
|
||||
thread fadeFireToSkip();
|
||||
level.FiretoSkip fadeOverTime( level.briefing_fadeOutTime );
|
||||
level.FiretoSkip.alpha = 1.0;
|
||||
}
|
||||
|
||||
// fades fire to skip after 7 seconds
|
||||
fadeFireToSkip()
|
||||
{
|
||||
wait 7;
|
||||
level.FiretoSkip fadeOverTime( level.briefing_fadeOutTime );
|
||||
level.FiretoSkip.alpha = 0.0;
|
||||
}
|
||||
|
||||
// waits till the briefing is done
|
||||
waitTillBriefingDone()
|
||||
{
|
||||
self waittill( "briefingend" );
|
||||
}
|
||||
|
||||
// This ends the briefing if the player says he wants to
|
||||
skipCheck()
|
||||
{
|
||||
self endon( "briefingend" );
|
||||
|
||||
player = getentarray( "player", "classname" )[ 0 ];
|
||||
|
||||
wait( 0.05 );
|
||||
|
||||
maps\_utility::set_console_status();
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
// we want to check if the "A" button has been pressed on xenon
|
||||
// instead of FIRE.
|
||||
if ( level.console )
|
||||
{
|
||||
if ( player buttonPressed( "BUTTON_A" ) )
|
||||
{
|
||||
self notify( "briefingskip" );
|
||||
end();
|
||||
return;
|
||||
}
|
||||
wait( 0.05 );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( player attackButtonPressed() )
|
||||
{
|
||||
self notify( "briefingskip" );
|
||||
end();
|
||||
return;
|
||||
}
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
|
||||
image( sImageShader )
|
||||
{
|
||||
self endon( "briefingskip" );
|
||||
|
||||
if ( level.PlaceNextImage == "A" )
|
||||
{
|
||||
level.PlaceNextImage = "B";
|
||||
level.imageA setShader( sImageShader, 640, 360 );
|
||||
thread imageFadeOut( "B" );
|
||||
level.imageA fadeOverTime( level.briefing_fadeInTime );
|
||||
level.imageA.alpha = 1;
|
||||
}
|
||||
else if ( level.PlaceNextImage == "B" )
|
||||
{
|
||||
level.PlaceNextImage = "A";
|
||||
level.imageB setShader( sImageShader, 640, 360 );
|
||||
thread imageFadeOut( "A" );
|
||||
level.imageB fadeOverTime( level.briefing_fadeInTime );
|
||||
level.imageB.alpha = 1;
|
||||
}
|
||||
}
|
||||
|
||||
imageFadeOut( elem )
|
||||
{
|
||||
if ( elem == "A" )
|
||||
{
|
||||
level.imageA fadeOverTime( level.briefing_fadeOutTime );
|
||||
level.imageA.alpha = 0;
|
||||
}
|
||||
else if ( elem == "B" )
|
||||
{
|
||||
level.imageB fadeOverTime( level.briefing_fadeOutTime );
|
||||
level.imageB.alpha = 0;
|
||||
}
|
||||
}
|
||||
|
||||
endThread()
|
||||
{
|
||||
// Check for the briefing already being ended
|
||||
if ( !level.briefing_running )
|
||||
return;
|
||||
if ( level.briefing_ending )
|
||||
return;
|
||||
|
||||
self notify( "briefingend" );
|
||||
level.briefing_ending = true;
|
||||
|
||||
// Make sure the briefing audio is ended on for slideshows
|
||||
if ( level.script[ 0 ] != "m" )
|
||||
{
|
||||
self playsound( "stop_voice" );
|
||||
}
|
||||
|
||||
// Fade the screen in
|
||||
thread imageFadeOut( "A" );
|
||||
thread imageFadeOut( "B" );
|
||||
|
||||
wait( 1.5 );
|
||||
// self freezeControls(false);
|
||||
|
||||
level.briefing_ending = false;
|
||||
}
|
||||
|
||||
end()
|
||||
{
|
||||
self thread endThread();
|
||||
}
|
||||
|
||||
soundplay( dialog, msg )
|
||||
{
|
||||
if ( isdefined( level.tmpmsg[ dialog ] ) )
|
||||
iprintlnbold( level.tmpmsg[ dialog ] );
|
||||
if ( isdefined( msg ) )
|
||||
{
|
||||
thread soundplay_flag( dialog, msg );
|
||||
self playsound( dialog, msg );
|
||||
}
|
||||
else
|
||||
self playsound( dialog );
|
||||
}
|
||||
|
||||
soundplay_flag( dialog, msg )
|
||||
{
|
||||
self.dialogplaying[ dialog ] = true;
|
||||
self waittill( msg );
|
||||
self.dialogplaying[ dialog ] = false;
|
||||
}
|
||||
|
||||
dothebriefing()
|
||||
{
|
||||
self start( 0.5 );
|
||||
if ( level.script[ 0 ] != "m" )// movie_ maps don't play the sound
|
||||
self soundplay( "slide_advance" );
|
||||
wait( 0.5 );
|
||||
end();
|
||||
}
|
||||
|
||||
skipthebriefing()
|
||||
{
|
||||
self waittill( "briefingskip" );
|
||||
gotothelevel( true );
|
||||
}
|
||||
|
||||
gotothelevel( skipMovie )
|
||||
{
|
||||
if ( !skipMovie )
|
||||
{
|
||||
for ( i = 0;i < level.slide.size;i++ )
|
||||
{
|
||||
if ( isdefined( level.slide[ i ][ "movie" ] ) )
|
||||
cinematic( level.slide[ i ][ "movie" ] );
|
||||
}
|
||||
}
|
||||
|
||||
changeLevel( level.levelToLoad, false );
|
||||
}
|
||||
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "btr80", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_btr80", "vehicle_btr80_d" );
|
||||
build_deathmodel( "vehicle_btr80_snow", "vehicle_btr80_snow_d" );
|
||||
build_deathmodel( "vehicle_btr80_low", "vehicle_btr80_d" );
|
||||
|
||||
btr80_death_fx = [];
|
||||
btr80_death_fx[ "vehicle_btr80" ] = "explosions/vehicle_explosion_btr80";
|
||||
btr80_death_fx[ "vehicle_btr80_snow" ] = "explosions/vehicle_explosion_btr80_snow";
|
||||
btr80_death_fx[ "vehicle_btr80_low" ] = "explosions/vehicle_explosion_btr80";
|
||||
|
||||
build_deathfx( "fire/firelp_med_pm", "TAG_CARGOFIRE", "fire_metal_medium", undefined, undefined, true, 0 );
|
||||
build_deathfx( btr80_death_fx[ model ], "tag_deathfx", "exp_armor_vehicle" );
|
||||
|
||||
build_light( model, "headlight_L", "TAG_FRONT_LIGHT_LEFT", "misc/car_headlight_btr80", "running", 0.0 );
|
||||
build_light( model, "taillight_L", "TAG_REAR_LIGHT_LEFT", "misc/car_taillight_btr80", "running", 0.1 );
|
||||
build_light( model, "taillight_R", "TAG_REAR_LIGHT_RIGHT", "misc/car_taillight_btr80", "running", 0.1 );
|
||||
|
||||
build_light( model, "brakeight_R", "TAG_REAR_LIGHT_RIGHT", "misc/car_brakelight_btr80", "brake", 0.0 );
|
||||
build_light( model, "brakelight_L", "TAG_REAR_LIGHT_LEFT", "misc/car_brakelight_btr80", "brake", 0.0 );
|
||||
|
||||
build_light( model, "spotlight", "TAG_FRONT_LIGHT_RIGHT","misc/spotlight_btr80", "spotlight", 0.2 );
|
||||
build_light( model, "spotlight_turret", "TAG_TURRET_LIGHT", "misc/spotlight_btr80", "spotlight_turret", 0.0 );
|
||||
|
||||
build_drive( %BTR80_movement, %BTR80_movement_backwards, 10 );
|
||||
|
||||
if ( issubstr( model, "_snow" ) )
|
||||
build_turret( "btr80_turret2", "tag_turret2", "vehicle_btr80_machine_gun_snow" );
|
||||
else
|
||||
build_turret( "btr80_turret2", "tag_turret2", "vehicle_btr80_machine_gun" );
|
||||
|
||||
build_radiusdamage( ( 0, 0, 53 ), 512, 300, 20, false );
|
||||
|
||||
build_treadfx();
|
||||
|
||||
build_life( 999, 500, 1500 );
|
||||
|
||||
build_team( "axis" );
|
||||
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
|
||||
build_frontarmor( .33 );// regens this much of the damage from attacks to the front
|
||||
|
||||
build_bulletshield( true );
|
||||
|
||||
build_grenadeshield( true );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
maps\_utility::ent_flag_init( "no_riders_until_unload" );
|
||||
maps\_vehicle::lights_on( "running" );
|
||||
//self thread test_brake_lights();
|
||||
}
|
||||
|
||||
test_brake_lights()
|
||||
{
|
||||
self endon( "death");
|
||||
while ( true )
|
||||
{
|
||||
wait 5;
|
||||
maps\_vehicle::lights_on( "brake" );
|
||||
wait 3;
|
||||
maps\_vehicle::lights_off( "brake" );
|
||||
}
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
|
||||
// positions[ 0 ].vehicle_getinanim = %tigertank_hatch_open;
|
||||
// positions[ 1 ].vehicle_getoutanim = %tigertank_hatch_open;
|
||||
|
||||
positions[ 0 ].vehicle_getoutanim = %BTR80_doorsL_open;
|
||||
positions[ 1 ].vehicle_getoutanim = %BTR80_doorsR_open;
|
||||
positions[ 2 ].vehicle_getoutanim = %BTR80_doorsL_open;
|
||||
positions[ 3 ].vehicle_getoutanim = %BTR80_doorsR_open;
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 4;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "tag_detach";
|
||||
positions[ 1 ].sittag = "tag_detach";
|
||||
positions[ 2 ].sittag = "tag_detach";
|
||||
positions[ 3 ].sittag = "tag_detach";
|
||||
|
||||
positions[ 0 ].idle = %BTR80_crew_idle;
|
||||
positions[ 1 ].idle = %BTR80_crew_idle;
|
||||
positions[ 2 ].idle = %BTR80_crew_idle;
|
||||
positions[ 3 ].idle = %BTR80_crew_idle;
|
||||
|
||||
positions[ 0 ].getout = %BTR80_exit_1; // left
|
||||
positions[ 1 ].getout = %BTR80_exit_2; // right
|
||||
positions[ 2 ].getout = %BTR80_exit_3; // left
|
||||
positions[ 3 ].getout = %BTR80_exit_4; // rigth
|
||||
|
||||
positions[ 0 ].getin = %humvee_driver_climb_in;
|
||||
positions[ 1 ].getin = %humvee_passenger_in_L;
|
||||
positions[ 2 ].getin = %humvee_passenger_in_R;
|
||||
positions[ 3 ].getin = %humvee_passenger_in_R;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_btr80 (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
Valid Light Groups:
|
||||
running - taillights and tacticle headlight
|
||||
brake - brighter taillight
|
||||
spotlight - lower spotlight
|
||||
spotlight_turret - spotlight on turret
|
||||
|
||||
Example Light Group Usage:
|
||||
on vehicle nodes or vehicle: "script_vehicle_lights_on" "running spotlight"
|
||||
on vehicle node: "script_vehicle_lights_off" "spotlight"
|
||||
in script: vehicle lights_on( "spotlight" );
|
||||
in script: vehicle lights_off( "spotlight" );
|
||||
|
||||
put this in your GSC:
|
||||
maps\_btr80::main( "vehicle_btr80" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_btr80
|
||||
sound,vehicle_btr80,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_btr80"
|
||||
default:"vehicletype" "btr80"
|
||||
default:"script_team" "axis"
|
||||
default:"script_vehicle_lights_on" "spotlight running"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_btr80_low (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
Valid Light Groups:
|
||||
running - taillights and tacticle headlight
|
||||
brake - brighter taillight
|
||||
spotlight - lower spotlight
|
||||
spotlight_turret - spotlight on turret
|
||||
|
||||
Example Light Group Usage:
|
||||
on vehicle nodes or vehicle: "script_vehicle_lights_on" "running spotlight"
|
||||
on vehicle node: "script_vehicle_lights_off" "spotlight"
|
||||
in script: vehicle lights_on( "spotlight" );
|
||||
in script: vehicle lights_off( "spotlight" );
|
||||
|
||||
put this in your GSC:
|
||||
maps\_btr80::main( "vehicle_btr80_low" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_btr80_low
|
||||
sound,vehicle_btr80,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_btr80_low"
|
||||
default:"vehicletype" "btr80"
|
||||
default:"script_team" "axis"
|
||||
default:"script_vehicle_lights_on" "spotlight running"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_btr80_snow (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_btr80::main( "vehicle_btr80_snow" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_btr80_snow
|
||||
sound,vehicle_btr80,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_btr80_snow"
|
||||
default:"vehicletype" "btr80"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_btr80_snow_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_btr80::main( "vehicle_btr80_snow", "btr80_physics" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_btr80_snow
|
||||
sound,vehicle_btr80,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_btr80_snow"
|
||||
default:"vehicletype" "btr80_physics"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_btr80_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_btr80::main( "vehicle_btr80", "btr80_physics" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_btr80
|
||||
sound,vehicle_btr80,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_btr80"
|
||||
default:"vehicletype" "btr80_physics"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
@@ -0,0 +1,18 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "bus", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_drive( %bus_driving_idle_forward, %bus_driving_idle_backward, 10 );
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
|
||||
build_compassicon( "automobile", false );
|
||||
build_team( "axis" );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_c130 (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_c130::main( "vehicle_ac130_low" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_c130
|
||||
|
||||
defaultmdl="vehicle_ac130_low"
|
||||
default:"vehicletype" "c130"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "c130", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_ac130_low" );
|
||||
|
||||
build_deathfx( "explosions/large_vehicle_explosion", undefined, "explo_metal_rand" );
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
build_mainturret();
|
||||
|
||||
build_light( model, "wingtip_green", "tag_light_L_wing", "misc/aircraft_light_wingtip_green", "running", 0.0 );
|
||||
build_light( model, "wingtip_red", "tag_light_R_wing", "misc/aircraft_light_wingtip_red", "running", 0.05 );
|
||||
build_light( model, "tail_red", "tag_light_tail", "misc/aircraft_light_white_blink", "running", 0.05);
|
||||
build_light( model, "white_blink", "tag_light_belly", "misc/aircraft_light_red_blink", "running", 1.0 );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
maps\_vehicle::lights_on( "running" );
|
||||
self hidepart( "tag_25mm" );
|
||||
self hidepart( "tag_40mm" );
|
||||
self hidepart( "tag_105mm" );
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 1;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
return positions;
|
||||
}
|
||||
+270
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
Radiant:
|
||||
Create as many trigger_use with targetname "generic_use_trigger" as you might need. 8x8x8 units or so.
|
||||
Make sure to place them where the player can't get to them, they will be moved to the correct loctaion in script.
|
||||
They will be reused so you only have to do as many as you might have C4 objectivs active at the same time.
|
||||
|
||||
Script:
|
||||
maps\_c4::main(); // Add in you main() function.
|
||||
<entity> maps\_c4::c4_location( tag, origin_offset, angles_offset, org );
|
||||
|
||||
org => optional parameter if you want to plant on an origin instead of a tag
|
||||
|
||||
<entity>.multiple_c4 = true;
|
||||
Set .multiple_c4 on the entity if more then one C4 in required before the detonator is given to the player.
|
||||
This must be set before <entity> maps\_c4::c4_location( ... ); is called.
|
||||
|
||||
Example:
|
||||
technical = maps\_vehicle::waittill_vehiclespawn( "technical" );
|
||||
technical maps\_c4::c4_location( "tag_origin", (76, 15, 55.5), (11, 0, 1.5) );
|
||||
technical waittill( "c4_detonation" );
|
||||
technical notify( "death" ); // this does the explosion and model swap for a vehicle. Other entities might need other ways to do the model swap.
|
||||
|
||||
If the target gets destroyed by something elese then the C4:
|
||||
<entity> notify( "clear_c4" ); // this will remove the c4 without detonation.
|
||||
|
||||
You can have more then one c4_location on any one entity. Once one is triggered the others will be deleted.
|
||||
|
||||
*/
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
main()
|
||||
{
|
||||
precacheModel( "weapon_c4" );
|
||||
precacheModel( "weapon_c4_obj" );
|
||||
precacheItem( "c4" );
|
||||
level._effect[ "c4_explosion" ] = loadfx( "explosions/grenadeExp_metal" );
|
||||
}
|
||||
|
||||
c4_location( tag, origin_offset, angles_offset, org )
|
||||
{
|
||||
//self ---> the entity the c4 is placed on
|
||||
tag_origin = undefined;
|
||||
|
||||
if ( !isdefined( origin_offset ) )
|
||||
origin_offset = ( 0, 0, 0 );
|
||||
if ( !isdefined( angles_offset ) )
|
||||
angles_offset = ( 0, 0, 0 );
|
||||
|
||||
if ( isdefined( tag ) )
|
||||
tag_origin = self gettagorigin( tag );
|
||||
else if ( isdefined( org ) )
|
||||
tag_origin = org;
|
||||
else
|
||||
assertmsg( "need to specify either a 'tag' or an 'org' parameter to attach the c4 to" );
|
||||
|
||||
c4_model = spawn( "script_model", tag_origin + origin_offset );
|
||||
c4_model setmodel( "weapon_c4_obj" );
|
||||
|
||||
if ( isdefined( tag ) )
|
||||
c4_model linkto( self, tag, origin_offset, angles_offset );
|
||||
else
|
||||
c4_model.angles = self.angles;
|
||||
|
||||
c4_model.trigger = get_use_trigger();
|
||||
// Press and hold &&1 to plant the explosives.
|
||||
c4_model.trigger sethintstring( &"SCRIPT_PLATFORM_HINT_PLANTEXPLOSIVES" );
|
||||
|
||||
if ( isdefined( tag ) )
|
||||
{
|
||||
c4_model.trigger linkto( self, tag, origin_offset, angles_offset );
|
||||
c4_model.trigger.islinked = true;
|
||||
}
|
||||
else
|
||||
c4_model.trigger.origin = c4_model.origin;
|
||||
|
||||
c4_model thread handle_use( self );
|
||||
if ( !isdefined( self.multiple_c4 ) )
|
||||
c4_model thread handle_delete( self );
|
||||
c4_model thread handle_clear_c4( self );
|
||||
|
||||
return c4_model;
|
||||
}
|
||||
|
||||
playC4Effects()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
wait .1;
|
||||
|
||||
playFXOnTag( getfx( "c4_light_blink" ), self, "tag_fx" );
|
||||
}
|
||||
|
||||
handle_use( c4_target )
|
||||
{
|
||||
//self ==> the c4 model
|
||||
//c4_target ==> the entity the c4 is placed on
|
||||
c4_target endon( "clear_c4" );
|
||||
|
||||
if ( !isdefined( c4_target.multiple_c4 ) )
|
||||
c4_target endon( "c4_planted" );
|
||||
|
||||
if ( !isdefined( c4_target.c4_count ) )
|
||||
c4_target.c4_count = 0;
|
||||
|
||||
c4_target.c4_count++ ;
|
||||
|
||||
self.trigger usetriggerrequirelookat();
|
||||
self.trigger waittill( "trigger", player );
|
||||
|
||||
level notify( "c4_in_place", self );
|
||||
|
||||
self.trigger unlink();
|
||||
self.trigger release_use_trigger();
|
||||
|
||||
self playsound( "c4_bounce_default" );
|
||||
self setmodel( "weapon_c4" );
|
||||
|
||||
self thread playC4Effects();
|
||||
|
||||
c4_target.c4_count -- ;
|
||||
|
||||
if ( !isdefined( c4_target.multiple_c4 ) || !c4_target.c4_count )
|
||||
player switch_to_detonator();
|
||||
|
||||
self thread handle_detonation( c4_target, player );
|
||||
|
||||
c4_target notify( "c4_planted", self );
|
||||
}
|
||||
|
||||
handle_delete( c4_target )
|
||||
{
|
||||
c4_target endon( "clear_c4" );
|
||||
self.trigger endon( "trigger" );
|
||||
|
||||
c4_target waittill( "c4_planted", c4_model );
|
||||
self.trigger unlink();
|
||||
self.trigger release_use_trigger();
|
||||
self delete();
|
||||
}
|
||||
|
||||
handle_detonation( c4_target, player )
|
||||
{
|
||||
c4_target endon( "clear_c4" );
|
||||
|
||||
player waittill( "detonate" );
|
||||
playfx( level._effect[ "c4_explosion" ], self.origin );
|
||||
|
||||
soundPlayer = spawn( "script_origin", self.origin );
|
||||
|
||||
if ( isdefined( level.c4_sound_override ) )
|
||||
soundPlayer playsound( "detpack_explo_main", "sound_done" );
|
||||
|
||||
self radiusdamage( self.origin, 256, 200, 50 );
|
||||
earthquake( 0.4, 1, self.origin, 1000 );
|
||||
|
||||
if ( isdefined( self ) )
|
||||
self delete();
|
||||
|
||||
player thread remove_detonator();
|
||||
|
||||
c4_target notify( "c4_detonation" );
|
||||
|
||||
soundPlayer waittill( "sound_done" );// not working?
|
||||
soundPlayer delete();
|
||||
}
|
||||
|
||||
handle_clear_c4( c4_target )
|
||||
{
|
||||
//self ==> the c4 model
|
||||
//c4_target ==> the entity the c4 is placed on
|
||||
c4_target endon( "c4_detonation" );
|
||||
|
||||
c4_target waittill( "clear_c4" );
|
||||
|
||||
if ( !isdefined( self ) )
|
||||
return;
|
||||
|
||||
if ( isdefined( self.trigger.inuse ) && self.trigger.inuse )
|
||||
self.trigger release_use_trigger();
|
||||
|
||||
if ( isdefined( self ) )
|
||||
self delete();
|
||||
|
||||
level.player thread remove_detonator();
|
||||
}
|
||||
|
||||
remove_detonator()
|
||||
{
|
||||
level endon( "c4_in_place" );
|
||||
|
||||
wait 1;
|
||||
|
||||
had_empty_old_weapon = false;
|
||||
if ( "c4" == self getcurrentweapon() && ( isdefined( self.old_weapon ) ) )
|
||||
{
|
||||
if ( self.old_weapon == "none" )
|
||||
{
|
||||
had_empty_old_weapon = true;
|
||||
self switchtoweapon( self GetWeaponsListPrimaries()[ 0 ] );
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ( ( self HasWeapon( self.old_weapon ) ) && ( self.old_weapon != "c4" ) )
|
||||
self switchtoweapon( self.old_weapon );
|
||||
else
|
||||
self switchtoweapon( self GetWeaponsListPrimaries()[ 0 ] );
|
||||
}
|
||||
}
|
||||
|
||||
self.old_weapon = undefined;
|
||||
|
||||
if ( 0 != self getammocount( "c4" ) )
|
||||
return;
|
||||
|
||||
self waittill( "weapon_change" );
|
||||
self takeweapon( "c4" );
|
||||
}
|
||||
|
||||
switch_to_detonator()
|
||||
{
|
||||
c4_weapon = undefined;
|
||||
if ( !isdefined( self.old_weapon ) )
|
||||
self.old_weapon = self getcurrentweapon();
|
||||
|
||||
// if the player doesn't have the C4 weapon give it to him.
|
||||
weapons = self GetWeaponsListAll();
|
||||
for ( i = 0; i < weapons.size; i++ )
|
||||
{
|
||||
if ( weapons[ i ] != "c4" )
|
||||
continue;
|
||||
c4_weapon = weapons[ i ];
|
||||
}
|
||||
if ( !isdefined( c4_weapon ) )
|
||||
{
|
||||
self giveWeapon( "c4" );
|
||||
self SetWeaponAmmoClip( "c4", 0 );
|
||||
self SetActionSlot( 2, "weapon", "c4" );
|
||||
}
|
||||
|
||||
self switchtoweapon( "c4" );
|
||||
}
|
||||
|
||||
get_use_trigger()
|
||||
{
|
||||
ents = getentarray( "generic_use_trigger", "targetname" );
|
||||
assertex( isdefined( ents ) && ents.size > 0, "Missing use trigger with targetname: generic_use_trigger." );
|
||||
for ( i = 0; i < ents.size; i++ )
|
||||
{
|
||||
if ( isdefined( ents[ i ].inuse ) && ents[ i ].inuse )
|
||||
continue;
|
||||
if ( !isdefined( ents[ i ].inuse ) )
|
||||
ents[ i ] enablelinkto();
|
||||
ents[ i ].inuse = true;
|
||||
ents[ i ].oldorigin = ents[ i ].origin;
|
||||
return ents[ i ];
|
||||
}
|
||||
assertmsg( "all generic use triggers are in use. Place more of them in the map." );
|
||||
}
|
||||
|
||||
release_use_trigger()
|
||||
{
|
||||
|
||||
if ( isdefined( self.islinked ) )
|
||||
self unlink();
|
||||
self.islinked = undefined;
|
||||
self.origin = self.oldorigin;
|
||||
self.inuse = false;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
#include maps\_anim;
|
||||
|
||||
initChickens()
|
||||
{
|
||||
// wait until the end of the frame so that maps can init their cages
|
||||
// in their _anim instead of only above _load
|
||||
waittillframeend;
|
||||
|
||||
cages = getentarray( "caged_chicken", "targetname" );
|
||||
array_thread( cages, ::spawnChicken );
|
||||
}
|
||||
|
||||
spawnChicken()
|
||||
{
|
||||
chicken = spawn_anim_model( "chicken" );
|
||||
self thread anim_single_solo( chicken, "cage_freakout" );
|
||||
|
||||
anime = chicken getanim( "cage_freakout" );
|
||||
starttime = RandomFloatRange( 0, 1.0 );
|
||||
chicken SetAnimTime( anime, starttime );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
chicken playsound( "animal_chicken_idle", "sounddone" );
|
||||
chicken waittill( "sounddone" );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "camera", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_deathmodel( "vehicle_camera" );
|
||||
build_compassicon( "camera", false );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_camera (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_camera::main( "vehicle_camera" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_camera_camera
|
||||
|
||||
|
||||
defaultmdl="vehicle_camera"
|
||||
default:"vehicletype" "camera"
|
||||
*/
|
||||
@@ -0,0 +1,195 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_anim;
|
||||
|
||||
initCarry()
|
||||
{
|
||||
anims();
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
anims()
|
||||
{
|
||||
level.scr_anim[ "generic" ][ "wounded_idle" ][ 0 ] = %wounded_carry_closet_idle_wounded;
|
||||
|
||||
level.scr_anim[ "generic" ][ "pickup_wounded" ] = %wounded_carry_pickup_closet_wounded_straight;
|
||||
level.scr_anim[ "generic" ][ "pickup_carrier" ] = %wounded_carry_pickup_closet_carrier_straight;
|
||||
|
||||
level.scr_anim[ "generic" ][ "wounded_walk_loop" ][ 0 ] = %wounded_carry_fastwalk_wounded_relative;
|
||||
level.scr_anim[ "generic" ][ "carrier_walk_loop" ] = %wounded_carry_fastwalk_carrier;
|
||||
/*
|
||||
level.scr_anim[ "generic" ][ "wounded_walk_loop" ][ 0 ] = %wounded_carry_sprint_wounded;
|
||||
level.scr_anim[ "generic" ][ "carrier_walk_loop" ] = %wounded_carry_sprint_carrier;
|
||||
*/
|
||||
level.scr_anim[ "generic" ][ "putdown_wounded" ] = %wounded_carry_putdown_closet_wounded;
|
||||
level.scr_anim[ "generic" ][ "putdown_carrier" ] = %wounded_carry_putdown_closet_carrier;
|
||||
}
|
||||
|
||||
setWounded( eNode )
|
||||
{
|
||||
assert( isAI( self ) );
|
||||
assert( isAlive( self ) );
|
||||
assert( isdefined( eNode ) );
|
||||
|
||||
self animscripts\shared::DropAIWeapon();
|
||||
|
||||
// make the president go into his wounded idle
|
||||
self.woundedNode = eNode;
|
||||
self.woundedNode thread anim_generic_loop( self, "wounded_idle", "stop_wounded_idle" );
|
||||
self.allowdeath = true;
|
||||
}
|
||||
|
||||
move_president_to_node( wounded, eNode )
|
||||
{
|
||||
goto_and_pickup_wounded( wounded, eNode );
|
||||
carry_to_and_putdown_wounded( wounded, eNode );
|
||||
}
|
||||
|
||||
move_president_to_node_nopickup( wounded, eNode )
|
||||
{
|
||||
wounded forceTeleport( self.origin, self.angles );
|
||||
carry_to_and_putdown_wounded( wounded, eNode );
|
||||
}
|
||||
|
||||
goto_and_pickup_wounded( wounded, eNode )
|
||||
{
|
||||
//##############################
|
||||
// don't use this, internal only
|
||||
// use move_president_to_node()
|
||||
//##############################
|
||||
|
||||
assert( isdefined( self ) );
|
||||
assert( isAI( self ) );
|
||||
assert( isAlive( self ) );
|
||||
assert( isdefined( wounded ) );
|
||||
assert( isAI( wounded ) );
|
||||
assert( isAlive( wounded ) );
|
||||
assert( isdefined( eNode ) );
|
||||
assert( isdefined( wounded.woundedNode ) );
|
||||
|
||||
// get the carrier to the president
|
||||
wounded.woundedNode anim_generic_reach( self, "pickup_carrier" );
|
||||
|
||||
// carrier picks up the president, they both play the pickup anim
|
||||
wounded notify( "stop_wounded_idle" );
|
||||
wounded.woundedNode notify( "stop_wounded_idle" );
|
||||
wounded.allowdeath = true;
|
||||
wounded.woundedNode thread anim_generic( wounded, "pickup_wounded" );
|
||||
wounded.woundedNode anim_generic( self, "pickup_carrier" );
|
||||
|
||||
self.dontMelee = true;
|
||||
wounded invisibleNotSolid();
|
||||
}
|
||||
|
||||
|
||||
link_wounded( wounded )
|
||||
{
|
||||
self endon( "death" );
|
||||
wounded endon( "death" );
|
||||
|
||||
wounded linkto( self, "tag_origin" );
|
||||
|
||||
// wait for carrier to get a path and start move script
|
||||
wait 0.05;
|
||||
wounded thread anim_generic_loop( wounded, "wounded_walk_loop", "stop_carried_loop" );
|
||||
}
|
||||
|
||||
|
||||
carry_to_and_putdown_wounded( wounded, eNode )
|
||||
{
|
||||
//##############################
|
||||
// don't use this, internal only
|
||||
// use move_president_to_node()
|
||||
//##############################
|
||||
|
||||
assert( isdefined( self ) );
|
||||
assert( isAI( self ) );
|
||||
assert( isAlive( self ) );
|
||||
assert( isdefined( wounded ) );
|
||||
assert( isAI( wounded ) );
|
||||
assert( isAlive( wounded ) );
|
||||
assert( isdefined( eNode ) );
|
||||
|
||||
wounded.being_carried = true;
|
||||
|
||||
// once the carrier arrives set his walk anim to the carry walk
|
||||
self thread set_generic_run_anim( "carrier_walk_loop", true );
|
||||
|
||||
wounded notify( "stop_wounded_idle" );
|
||||
wounded.woundedNode notify( "stop_wounded_idle" );
|
||||
|
||||
// president gets linked to the carrier and plays a loop anim
|
||||
|
||||
setsaveddvar( "ai_friendlyFireBlockDuration", 0 );
|
||||
self animmode( "none" );
|
||||
self.allowpain = false;
|
||||
self.disableBulletWhizbyReaction = true;
|
||||
self.ignoreall = true;
|
||||
self.ignoreme = true;
|
||||
self.grenadeawareness = 0;
|
||||
self setFlashbangImmunity( true );
|
||||
self.neverEnableCqb = true;
|
||||
self.disablearrivals = true;
|
||||
self.disableexits = true;
|
||||
self.nododgemove = true;
|
||||
|
||||
self disable_cqbwalk();
|
||||
|
||||
self.oldgoal = self.goalradius;
|
||||
|
||||
self thread link_wounded( wounded );
|
||||
|
||||
while( isdefined( eNode.target ) )
|
||||
{
|
||||
self.ignoresuppression = true;
|
||||
self.disablearrivals = true;
|
||||
goal = getent( eNode.target, "targetname" );
|
||||
if( !isdefined( goal.target ) )
|
||||
{
|
||||
eNode = goal;
|
||||
break;
|
||||
}
|
||||
self.goalradius = 64;
|
||||
self setgoalpos( goal.origin );
|
||||
self waittill( "goal" );
|
||||
eNode = goal;
|
||||
}
|
||||
|
||||
// carrier walks to the new node for putdown anim
|
||||
eNode anim_generic_reach( self, "putdown_carrier" );
|
||||
|
||||
// carrier arrives, put down the president. They both play putdown anim
|
||||
wounded.woundedNode = eNode;
|
||||
wounded notify( "stop_carried_loop" );
|
||||
wounded unlink();
|
||||
|
||||
self.ignoresuppression = false;
|
||||
self.disablearrivals = false;
|
||||
self.goalradius = self.oldgoal;
|
||||
|
||||
self thread clear_run_anim();
|
||||
wounded.woundedNode thread anim_generic( self, "putdown_carrier" );
|
||||
wounded.woundedNode anim_generic( wounded, "putdown_wounded" );
|
||||
|
||||
setsaveddvar( "ai_friendlyFireBlockDuration", 2000 );
|
||||
self.allowpain = true;
|
||||
self.disableBulletWhizbyReaction = false;
|
||||
self.ignoreall = false;
|
||||
//self.ignoreme = false;
|
||||
self.grenadeawareness = 1;
|
||||
self setFlashbangImmunity( false );
|
||||
self.dontMelee = undefined;
|
||||
self.neverEnableCqb = undefined;
|
||||
self.disablearrivals = undefined;
|
||||
self.disableexits = undefined;
|
||||
self.nododgemove = false;
|
||||
self pushplayer( false );
|
||||
|
||||
wounded visibleSolid();
|
||||
|
||||
wounded.woundedNode thread anim_generic_loop( wounded, "wounded_idle", "stop_wounded_idle" );
|
||||
wounded.allowdeath = true;
|
||||
|
||||
wounded notify( "stop_putdown" );
|
||||
wounded.being_carried = undefined;
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
#include maps\_utility;
|
||||
#include animscripts\utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
/*
|
||||
=============
|
||||
///ScriptDocBegin
|
||||
"Name: enable_casual_killer( <enable_casual_killer> )"
|
||||
"Summary: "
|
||||
"Module: Entity"
|
||||
"CallOn: An entity"
|
||||
"MandatoryArg: <param1>: "
|
||||
"OptionalArg: <param2>: "
|
||||
"Example: "
|
||||
"SPMP: singleplayer"
|
||||
///ScriptDocEnd
|
||||
=============
|
||||
*/
|
||||
enable_casual_killer()
|
||||
{
|
||||
if( isdefined( self.casual_killer ) )
|
||||
return;
|
||||
|
||||
self disable_turnAnims();
|
||||
self disable_surprise();
|
||||
|
||||
self.casual_killer = true;
|
||||
self.no_pistol_switch = true;
|
||||
self.ignoresuppression = true;
|
||||
self.maxFaceEnemyDist = 0;
|
||||
self.noRunReload = true;
|
||||
self.ammoCheatInterval = 2000;
|
||||
self.disableBulletWhizbyReaction = true;
|
||||
self.useChokePoints = false;
|
||||
self.disableDoorBehavior = true;
|
||||
self.combatmode = "no_cover";
|
||||
self.oldgrenadeawareness = self.grenadeawareness;
|
||||
self.grenadeawareness = 0;
|
||||
self.oldGrenadeReturnThrow = self.noGrenadeReturnThrow;
|
||||
self.noGrenadeReturnThrow = true;
|
||||
|
||||
self.old_walkDist = self.walkDist;
|
||||
self.old_walkDistFacingMotion = self.walkDistFacingMotion;
|
||||
self.walkDist = 0;
|
||||
self.walkDistFacingMotion = 0;
|
||||
|
||||
self init_casual_killer_animsets();
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
///ScriptDocBegin
|
||||
"Name: disable_casual_killer( <disable_casual_killer> )"
|
||||
"Summary: "
|
||||
"Module: Entity"
|
||||
"CallOn: An entity"
|
||||
"MandatoryArg: <param1>: "
|
||||
"OptionalArg: <param2>: "
|
||||
"Example: "
|
||||
"SPMP: singleplayer"
|
||||
///ScriptDocEnd
|
||||
=============
|
||||
*/
|
||||
disable_casual_killer()
|
||||
{
|
||||
if( !isdefined( self.casual_killer ) )
|
||||
return;
|
||||
|
||||
self enable_turnAnims();
|
||||
|
||||
self.casual_killer = undefined;
|
||||
self.no_pistol_switch = undefined;
|
||||
self.ignoresuppression = false;
|
||||
self.maxFaceEnemyDist = 512;
|
||||
self.noRunReload = undefined;
|
||||
self.disableBulletWhizbyReaction = undefined;
|
||||
self.useChokePoints = true;
|
||||
self.disableDoorBehavior = undefined;
|
||||
self.combatmode = "cover";
|
||||
self.grenadeawareness = self.oldgrenadeawareness;
|
||||
self.noGrenadeReturnThrow = self.oldGrenadeReturnThrow;
|
||||
|
||||
self.walkDist = self.old_walkDist;
|
||||
self.walkDistFacingMotion = self.old_walkDistFacingMotion;
|
||||
|
||||
self animscripts\animset::clear_custom_animset();
|
||||
|
||||
self.prevMoveMode = "none";
|
||||
|
||||
self allowedStances( "stand", "crouch", "prone" );
|
||||
|
||||
self animscripts\animset::set_animset_run_n_gun();
|
||||
|
||||
self.customMoveTransition = undefined;
|
||||
self.permanentCustomMoveTransition = undefined;
|
||||
self.approachTypeFunc = undefined;
|
||||
self.approachConditionCheckFunc = undefined;
|
||||
self.disableCoverArrivalsOnly = undefined;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
init_casual_killer_animsets()
|
||||
{
|
||||
// move animations
|
||||
animset = [];
|
||||
animset[ "sprint" ] = %casual_killer_jog_A;
|
||||
animset[ "straight" ] = %casual_killer_walk_F;
|
||||
|
||||
animset[ "move_f" ] = %casual_killer_walk_F;
|
||||
animset[ "move_l" ] = %walk_left;
|
||||
animset[ "move_r" ] = %walk_right;
|
||||
animset[ "move_b" ] = %walk_backward;
|
||||
|
||||
animset[ "crouch" ] = %crouch_fastwalk_F;
|
||||
animset[ "crouch_l" ] = %crouch_fastwalk_L;
|
||||
animset[ "crouch_r" ] = %crouch_fastwalk_R;
|
||||
animset[ "crouch_b" ] = %crouch_fastwalk_B;
|
||||
|
||||
animset[ "stairs_up" ] = %traverse_stair_run_01;
|
||||
animset[ "stairs_down" ] = %traverse_stair_run_down;
|
||||
|
||||
self.customMoveAnimSet[ "run" ] = animset;
|
||||
self.customMoveAnimSet[ "walk" ] = animset;
|
||||
//self.customMoveAnimSet[ "cqb" ] = animset;
|
||||
|
||||
self.customIdleAnimSet = [];
|
||||
self.customIdleAnimSet[ "stand" ] = %casual_killer_stand_aim5;
|
||||
self.customIdleAnimSet[ "stand_add" ] = %casual_killer_stand_idle;
|
||||
|
||||
self.a.pose = "stand";
|
||||
self allowedStances( "stand" );
|
||||
|
||||
// combat animations
|
||||
animset = anim.animsets.defaultStand;
|
||||
|
||||
animset[ "add_aim_up" ] = %casual_killer_stand_aim8;
|
||||
animset[ "add_aim_down" ] = %casual_killer_stand_aim2;
|
||||
animset[ "add_aim_left" ] = %casual_killer_stand_aim4;
|
||||
animset[ "add_aim_right" ] = %casual_killer_stand_aim6;
|
||||
|
||||
animset[ "straight_level" ] = %casual_killer_stand_aim5;
|
||||
|
||||
animset[ "fire" ] = %casual_killer_stand_auto;
|
||||
animset[ "single" ] = array( %casual_killer_stand_auto );
|
||||
|
||||
// remove this burst, semi nonsense soon
|
||||
animset[ "burst2" ] = %casual_killer_stand_auto;
|
||||
animset[ "burst3" ] = %casual_killer_stand_auto;
|
||||
animset[ "burst4" ] = %casual_killer_stand_auto;
|
||||
animset[ "burst5" ] = %casual_killer_stand_auto;
|
||||
animset[ "burst6" ] = %casual_killer_stand_auto;
|
||||
animset[ "semi2" ] = %casual_killer_stand_auto;
|
||||
animset[ "semi3" ] = %casual_killer_stand_auto;
|
||||
animset[ "semi4" ] = %casual_killer_stand_auto;
|
||||
animset[ "semi5" ] = %casual_killer_stand_auto;
|
||||
|
||||
animset[ "exposed_idle" ] = array( %casual_killer_stand_idle );
|
||||
|
||||
self animscripts\animset::init_animset_complete_custom_stand( animset );
|
||||
self animscripts\animset::init_animset_complete_custom_crouch( animset );
|
||||
|
||||
self set_casual_killer_run_n_gun();
|
||||
|
||||
animscripts\init_move_transitions::init_move_transition_arrays();
|
||||
|
||||
//exits
|
||||
self.customMoveTransition = ::casual_killer_startMoveTransition;
|
||||
self.permanentCustomMoveTransition = true;
|
||||
|
||||
//arrivals
|
||||
anim.coverTrans[ "casual_killer" ] = [];
|
||||
anim.coverTrans[ "casual_killer" ][ 1 ] = %casual_killer_walk_stop;
|
||||
anim.coverTrans[ "casual_killer" ][ 2 ] = %casual_killer_walk_stop;
|
||||
anim.coverTrans[ "casual_killer" ][ 3 ] = %casual_killer_walk_stop;
|
||||
anim.coverTrans[ "casual_killer" ][ 4 ] = %casual_killer_walk_stop;
|
||||
anim.coverTrans[ "casual_killer" ][ 6 ] = %casual_killer_walk_stop;
|
||||
anim.coverTrans[ "casual_killer" ][ 7 ] = %casual_killer_walk_stop;
|
||||
anim.coverTrans[ "casual_killer" ][ 8 ] = %casual_killer_walk_stop;
|
||||
anim.coverTrans[ "casual_killer" ][ 9 ] = %casual_killer_walk_stop;
|
||||
|
||||
anim.coverTrans[ "casual_killer_sprint" ] = [];
|
||||
anim.coverTrans[ "casual_killer_sprint" ][ 1 ] = %casual_killer_jog_stop;
|
||||
anim.coverTrans[ "casual_killer_sprint" ][ 2 ] = %casual_killer_jog_stop;
|
||||
anim.coverTrans[ "casual_killer_sprint" ][ 3 ] = %casual_killer_jog_stop;
|
||||
anim.coverTrans[ "casual_killer_sprint" ][ 4 ] = %casual_killer_jog_stop;
|
||||
anim.coverTrans[ "casual_killer_sprint" ][ 6 ] = %casual_killer_jog_stop;
|
||||
anim.coverTrans[ "casual_killer_sprint" ][ 7 ] = %casual_killer_jog_stop;
|
||||
anim.coverTrans[ "casual_killer_sprint" ][ 8 ] = %casual_killer_jog_stop;
|
||||
anim.coverTrans[ "casual_killer_sprint" ][ 9 ] = %casual_killer_jog_stop;
|
||||
|
||||
casual_killerTransTypes = [];
|
||||
casual_killerTransTypes[0] = "casual_killer";
|
||||
casual_killerTransTypes[1] = "casual_killer_sprint";
|
||||
|
||||
for ( j = 0; j < casual_killerTransTypes.size; j++ )
|
||||
{
|
||||
trans = casual_killerTransTypes[ j ];
|
||||
|
||||
for ( i = 1; i <= 9; i++ )
|
||||
{
|
||||
if ( i == 5 )
|
||||
continue;
|
||||
|
||||
if ( isdefined( anim.coverTrans[ trans ][ i ] ) )
|
||||
{
|
||||
anim.coverTransDist [ trans ][ i ] = getMoveDelta( anim.coverTrans[ trans ][ i ], 0, 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anim.coverTransAngles[ "casual_killer" ][ 1 ] = 45;
|
||||
anim.coverTransAngles[ "casual_killer" ][ 2 ] = 0;
|
||||
anim.coverTransAngles[ "casual_killer" ][ 3 ] = -45;
|
||||
anim.coverTransAngles[ "casual_killer" ][ 4 ] = 90;
|
||||
anim.coverTransAngles[ "casual_killer" ][ 6 ] = -90;
|
||||
anim.coverTransAngles[ "casual_killer" ][ 8 ] = 180;
|
||||
|
||||
anim.coverTransAngles[ "casual_killer_sprint" ][ 1 ] = 45;
|
||||
anim.coverTransAngles[ "casual_killer_sprint" ][ 2 ] = 0;
|
||||
anim.coverTransAngles[ "casual_killer_sprint" ][ 3 ] = -45;
|
||||
anim.coverTransAngles[ "casual_killer_sprint" ][ 4 ] = 90;
|
||||
anim.coverTransAngles[ "casual_killer_sprint" ][ 6 ] = -90;
|
||||
anim.coverTransAngles[ "casual_killer_sprint" ][ 8 ] = 180;
|
||||
|
||||
anim.arrivalEndStance[ "casual_killer" ] = "stand";
|
||||
anim.arrivalEndStance[ "casual_killer_sprint" ] = "stand";
|
||||
|
||||
self.approachTypeFunc = ::casual_killer_approach_type;
|
||||
self.approachConditionCheckFunc = ::casual_killer_approach_conditions;
|
||||
self.disableCoverArrivalsOnly = true;
|
||||
}
|
||||
|
||||
casual_killer_approach_conditions( node )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
casual_killer_approach_type()
|
||||
{
|
||||
if( self casual_killer_is_jogging() )
|
||||
return "casual_killer_sprint";
|
||||
|
||||
return "casual_killer";
|
||||
}
|
||||
|
||||
casual_killer_startMoveTransition()
|
||||
{
|
||||
if ( isdefined( self.disableExits ) )
|
||||
return;
|
||||
|
||||
self orientmode( "face angle", self.angles[1] );
|
||||
self animmode( "zonly_physics", false );
|
||||
|
||||
rate = randomfloatrange( 0.9, 1.1 );
|
||||
|
||||
|
||||
if( self casual_killer_is_jogging() )
|
||||
startAnim = %casual_killer_jog_start;
|
||||
else
|
||||
startAnim = %casual_killer_walk_start;
|
||||
|
||||
self setFlaggedAnimKnobAllRestart( "startmove", startAnim, %body, 1, .1, rate );
|
||||
self animscripts\shared::DoNoteTracks( "startmove" );
|
||||
|
||||
self OrientMode( "face default" );
|
||||
self animmode( "none", false );
|
||||
|
||||
if ( animHasNotetrack( startAnim, "code_move" ) )
|
||||
self animscripts\shared::DoNoteTracks( "startmove" ); // return on code_move
|
||||
}
|
||||
|
||||
casual_killer_is_jogging()
|
||||
{
|
||||
if( !isdefined( self.run_overrideanim ) )
|
||||
return false;
|
||||
|
||||
if( isarray( self.run_overrideanim ) )
|
||||
{
|
||||
if( self.run_overrideanim[0] == %casual_killer_jog_A || self.run_overrideanim[0] == %casual_killer_jog_B )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if( self.run_overrideanim == %casual_killer_jog_A || self.run_overrideanim == %casual_killer_jog_B )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
set_casual_killer_run_n_gun( type )
|
||||
{
|
||||
self.maxRunNGunAngle = 90;
|
||||
self.runNGunTransitionPoint = 1;
|
||||
self.runNGunIncrement = 0.2;
|
||||
|
||||
if( !isdefined( type ) )
|
||||
type = "straight";
|
||||
|
||||
self clearanim( %run_n_gun, 0.2 );
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case "straight":
|
||||
self.runNGunAnims[ "F" ] = %casual_killer_walk_shoot_F;
|
||||
self.runNGunAnims[ "L" ] = %casual_killer_walk_shoot_L;
|
||||
self.runNGunAnims[ "R" ] = %casual_killer_walk_shoot_R;
|
||||
self.runNGunAnims[ "LB" ] = %casual_killer_walk_shoot_L;
|
||||
self.runNGunAnims[ "RB" ] = %casual_killer_walk_shoot_R;
|
||||
break;
|
||||
|
||||
case "down":
|
||||
self.runNGunAnims[ "F" ] = %casual_killer_walk_shoot_F_aimdown;
|
||||
self.runNGunAnims[ "L" ] = %casual_killer_walk_shoot_L_aimdown;
|
||||
self.runNGunAnims[ "R" ] = %casual_killer_walk_shoot_R_aimdown;
|
||||
self.runNGunAnims[ "LB" ] = %casual_killer_walk_shoot_L_aimdown;
|
||||
self.runNGunAnims[ "RB" ] = %casual_killer_walk_shoot_R_aimdown;
|
||||
break;
|
||||
}
|
||||
}
|
||||
+4441
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,425 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_anim;
|
||||
#include maps\_climb;
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
CONST_traceFX_dist = 10;
|
||||
|
||||
friendly_climb_anims()
|
||||
{
|
||||
level.scr_anim[ "price" ][ "price_climb_intro" ] = %cliffhanger_price_intro;
|
||||
level.scr_anim[ "price" ][ "price_climb_intro_idle" ][ 0 ] = %cliffhanger_price_intro_idle;
|
||||
level.scr_anim[ "price" ][ "price_climb_start" ] = %cliffhanger_climb_up_start;
|
||||
level.scr_anim[ "price" ][ "price_climb_mid" ] = %cliffhanger_climb_up_mid;
|
||||
level.scr_anim[ "price" ][ "price_jump" ] = %cliffhanger_jump_price;
|
||||
level.scr_anim[ "price" ][ "price_idle" ][ 0 ] = %cliffhanger_jump_Price_idle;
|
||||
level.scr_anim[ "price" ][ "price_reach" ] = %cliffhanger_jump_Price_reach;
|
||||
|
||||
level.scr_anim[ "generic" ][ "faux_player" ] = %invasion_parachute_ground_detach_idle;
|
||||
|
||||
|
||||
|
||||
level.scr_anim[ "price" ][ "climb_catch" ] = %cliffhanger_gaz_bigjump;
|
||||
|
||||
addNotetrack_customFunction( "price", "catch", ::price_catches_player, "climb_catch" );
|
||||
|
||||
|
||||
addNotetrack_customFunction( "price", "exhale", ::price_exhales );
|
||||
addNotetrack_customFunction( "price", "puff", ::price_puffs );
|
||||
|
||||
addNotetrack_customFunction( "price", "attach_axe", ::attach_left_pick );
|
||||
addNotetrack_customFunction( "price", "detach_axe", ::detach_left_pick );
|
||||
addNotetrack_customFunction( "price", "attach_second_axe", ::attach_right_pick );
|
||||
addNotetrack_customFunction( "price", "detach_second_axe", ::detach_right_pick );
|
||||
addNotetrack_customFunction( "price", "attach_gun", ::price_gun_recall );
|
||||
|
||||
addNotetrack_customFunction( "price", "attach_pick", ::attach_pick );
|
||||
addNotetrack_customFunction( "price", "pick_slide_left", ::pick_left_fx );
|
||||
|
||||
addNotetrack_customFunction( "price", "pick_in_left", ::pick_left_hit );
|
||||
addNotetrack_customFunction( "price", "pick_in_right", ::pick_right_hit );
|
||||
addNotetrack_customFunction( "price", "pick_out_left", ::pick_left_out );
|
||||
addNotetrack_customFunction( "price", "pick_out_right", ::pick_right_out );
|
||||
|
||||
addNotetrack_customFunction( "price", "footstep_right_small", ::ledge_scoot_fx_right );
|
||||
addNotetrack_customFunction( "price", "footstep_left_small", ::ledge_scoot_fx_left );
|
||||
addNotetrack_customFunction( "price", "footstep_right_large", ::ledge_scoot_fx_right );
|
||||
addNotetrack_customFunction( "price", "footstep_left_large", ::ledge_scoot_fx_left );
|
||||
addNotetrack_customFunction( "price", "bigjump_fx", ::big_jump_grab_fx );
|
||||
|
||||
level.price_last_climb_hit = "none";
|
||||
}
|
||||
|
||||
price_catches_player( price )
|
||||
{
|
||||
if ( isdefined( level.rumble_ent ) )
|
||||
level.rumble_ent delete();
|
||||
|
||||
level.player PlayRumbleOnEntity( "damage_light" );
|
||||
flag_set( "player_was_caught" );
|
||||
}
|
||||
|
||||
big_jump_grab_fx( price )
|
||||
{
|
||||
//iprintlnbold( "Exploder 4" );
|
||||
exploder( 4 );
|
||||
|
||||
}
|
||||
|
||||
ledge_scoot_fx_left( price )
|
||||
{
|
||||
if ( flag( "reached_top" ) )
|
||||
return;
|
||||
|
||||
//price traceFX_on_tag( "footstep_ice_climbing", "J_Ankle_LE", 5 );
|
||||
playfxontag( getfx( "footstep_ice_climbing" ), price, "J_Ankle_LE" );
|
||||
}
|
||||
|
||||
ledge_scoot_fx_right( price )
|
||||
{
|
||||
if ( flag( "reached_top" ) )
|
||||
return;
|
||||
|
||||
//price traceFX_on_tag( "footstep_ice_climbing", "J_Ankle_RI", 5 );
|
||||
playfxontag( getfx( "footstep_ice_climbing" ), price, "J_Ankle_RI" );
|
||||
}
|
||||
|
||||
pick_warning( warning )
|
||||
{
|
||||
/#
|
||||
if ( !getdvarint( "debug_pickwarning" ) )
|
||||
return;
|
||||
|
||||
if ( level.price_last_climb_hit == warning )
|
||||
{
|
||||
iprintlnbold( "Called same hit twice in a row (" + warning + ")" );
|
||||
}
|
||||
|
||||
level.price_last_climb_hit = warning;
|
||||
#/
|
||||
}
|
||||
|
||||
pick_left_hit( price )
|
||||
{
|
||||
/# pick_warning( "left_in" ); #/
|
||||
|
||||
// temporarily detach the other one so we can get the right tag
|
||||
price Detach( "weapon_ice_picker", "tag_inhand" );
|
||||
price traceFX_on_tag( "ice_pick", "TAG_ICE_PICKER_FX", CONST_traceFX_dist );
|
||||
price anim_spawn_tag_model( "weapon_ice_picker", "tag_inhand" );
|
||||
}
|
||||
|
||||
pick_left_fx( price )
|
||||
{
|
||||
// temporarily detach the other one so we can get the right tag
|
||||
price Detach( "weapon_ice_picker", "tag_inhand" );
|
||||
price traceFX_on_tag( "ice_pick", "TAG_ICE_PICKER_FX", CONST_traceFX_dist );
|
||||
price anim_spawn_tag_model( "weapon_ice_picker", "tag_inhand" );
|
||||
}
|
||||
|
||||
pick_right_hit( price )
|
||||
{
|
||||
/# pick_warning( "right_in" ); #/
|
||||
|
||||
// temporarily detach the other one so we can get the right tag
|
||||
price Detach( "weapon_ice_picker", "tag_weapon_left" );
|
||||
price traceFX_on_tag( "ice_pick", "TAG_ICE_PICKER_FX", CONST_traceFX_dist );
|
||||
price anim_spawn_tag_model( "weapon_ice_picker", "tag_weapon_left" );
|
||||
}
|
||||
|
||||
pick_left_out( price )
|
||||
{
|
||||
/# pick_warning( "left_out" ); #/
|
||||
|
||||
// temporarily detach the other one so we can get the right tag
|
||||
price Detach( "weapon_ice_picker", "tag_inhand" );
|
||||
price traceFX_on_tag( "ice_pick_out", "TAG_ICE_PICKER_FX", CONST_traceFX_dist );
|
||||
price anim_spawn_tag_model( "weapon_ice_picker", "tag_inhand" );
|
||||
}
|
||||
|
||||
pick_right_out( price )
|
||||
{
|
||||
/# pick_warning( "right_out" ); #/
|
||||
// temporarily detach the other one so we can get the right tag
|
||||
price Detach( "weapon_ice_picker", "tag_weapon_left" );
|
||||
price traceFX_on_tag( "ice_pick_out", "TAG_ICE_PICKER_FX", CONST_traceFX_dist );
|
||||
price anim_spawn_tag_model( "weapon_ice_picker", "tag_weapon_left" );
|
||||
}
|
||||
|
||||
attach_pick( price )
|
||||
{
|
||||
if ( isdefined( price.picks ) )
|
||||
return;
|
||||
price.picks = true;
|
||||
price anim_spawn_tag_model( "weapon_ice_picker", "tag_weapon_left" );
|
||||
price anim_spawn_tag_model( "weapon_ice_picker", "tag_inhand" );
|
||||
}
|
||||
|
||||
attach_left_pick( price )
|
||||
{
|
||||
price anim_spawn_tag_model( "weapon_ice_picker", "tag_weapon_left" );
|
||||
}
|
||||
|
||||
attach_right_pick( price )
|
||||
{
|
||||
price anim_spawn_tag_model( "weapon_ice_picker", "tag_inhand" );
|
||||
}
|
||||
|
||||
detach_left_pick( price )
|
||||
{
|
||||
price Detach( "weapon_ice_picker", "tag_weapon_left" );
|
||||
}
|
||||
|
||||
detach_right_pick( price )
|
||||
{
|
||||
price Detach( "weapon_ice_picker", "tag_inhand" );
|
||||
}
|
||||
|
||||
price_gun_recall( price )
|
||||
{
|
||||
price gun_recall();
|
||||
}
|
||||
|
||||
detach_picks()
|
||||
{
|
||||
if ( !isdefined( self.picks ) )
|
||||
return;
|
||||
self.picks = undefined;
|
||||
self Detach( "weapon_ice_picker", "tag_weapon_left" );
|
||||
self Detach( "weapon_ice_picker", "tag_inhand" );
|
||||
}
|
||||
|
||||
price_exhales( price )
|
||||
{
|
||||
playfxOnTag( getfx( "cigar_exhale" ), price, "tag_eye" );
|
||||
wait( 6.5 );
|
||||
price Detach( "prop_price_cigar", "tag_inhand" );
|
||||
|
||||
}
|
||||
|
||||
price_puffs( price )
|
||||
{
|
||||
playfxOnTag( getfx( "cigar_glow_puff" ), price, "tag_cigarglow" );
|
||||
wait( 1 );
|
||||
playfxOnTag( getfx( "cigar_smoke_puff" ), price, "tag_eye" );
|
||||
}
|
||||
|
||||
right_stab_fx( player_model )
|
||||
{
|
||||
level.player PlayRumbleOnEntity( "icepick_climb" );
|
||||
fx_tag_name = get_icepick_tag_name( "right" );
|
||||
fx_tag = spawn_icepick_fx_tag( player_model, fx_tag_name );
|
||||
fx_tag traceFX_on_tag( "player_ice_pick", "tag_origin", 10 );
|
||||
fx_tag delete();
|
||||
}
|
||||
|
||||
stab_fx( arm_model, arm )
|
||||
{
|
||||
level.player PlayRumbleOnEntity( "icepick_climb" );
|
||||
fx_tag_name = get_icepick_tag_name( arm );
|
||||
fx_tag = spawn_icepick_fx_tag( arm_model, fx_tag_name );
|
||||
fx_tag traceFX_on_tag( "player_ice_pick", "tag_origin", 10 );
|
||||
fx_tag delete();
|
||||
}
|
||||
|
||||
stab_fx_current( arm_model )
|
||||
{
|
||||
arm = level.arm_ent_globals.current_arm;
|
||||
stab_fx( arm_model, arm );
|
||||
}
|
||||
|
||||
stab_fx_left( arm_model )
|
||||
{
|
||||
arm = "left";
|
||||
stab_fx( arm_model, arm );
|
||||
}
|
||||
|
||||
stab_fx_right( arm_model )
|
||||
{
|
||||
arm = "right";
|
||||
stab_fx( arm_model, arm );
|
||||
}
|
||||
|
||||
#using_animtree( "player" );
|
||||
player_animations()
|
||||
{
|
||||
level.scr_animtree[ "player_rig" ] = #animtree;
|
||||
level.scr_model[ "player_rig" ] = "viewhands_player_arctic_wind";
|
||||
level.scr_anim[ "player_rig" ][ "big_jump" ] = %player_icepicker_bigjump;
|
||||
level.scr_anim[ "player_rig" ]["climb_finish" ] = %player_icepicker_bigjump_end_getup;
|
||||
|
||||
level.scr_anim[ "player_rig" ][ "big_jump_both_in" ] = %player_icepicker_bigjump_slide_both_in;
|
||||
level.scr_anim[ "player_rig" ][ "big_jump_both_out" ] = %player_icepicker_bigjump_slide_both_out;
|
||||
level.scr_anim[ "player_rig" ][ "big_jump_left" ] = %player_icepicker_bigjump_slide_left_in;
|
||||
level.scr_anim[ "player_rig" ][ "big_jump_right" ] = %player_icepicker_bigjump_slide_right_in;
|
||||
|
||||
level.scr_anim[ "player_rig" ][ "first_pullup_left" ] = %player_icepicker_climbup_from_left;
|
||||
level.scr_anim[ "player_rig" ][ "first_pullup_right" ] = %player_icepicker_climbup_from_right;
|
||||
|
||||
level.scr_anim[ "player_rig" ][ "controller_slide" ] = %cliffhanger_bigjump;
|
||||
level.scr_anim[ "player_rig" ][ "controller_climb" ] = %player_climb;
|
||||
|
||||
level.scr_anim[ "player_rig" ][ "controller_both_in" ] = %slide_both_in;
|
||||
level.scr_anim[ "player_rig" ][ "controller_both_out" ] = %slide_both_out;
|
||||
level.scr_anim[ "player_rig" ][ "controller_left" ] = %slide_left;
|
||||
level.scr_anim[ "player_rig" ][ "controller_right" ] = %slide_right;
|
||||
|
||||
//addNotetrack_customFunction( "player_rig", "detach_pick_fall", maps\_climb::detach_pick_2, "big_jump" );
|
||||
//addNotetrack_customFunction( "player_rig", "detach_pick", maps\_climb::detach_pick, "big_jump" );
|
||||
addNotetrack_customFunction( "player_rig", "start_gaz", maps\_climb::gaz_catches_player );
|
||||
addNotetrack_customFunction( "player_rig", "stab", ::right_stab_fx, "big_jump" );
|
||||
|
||||
addNotetrack_customFunction( "player_rig", "stab", ::stab_fx_current, "climbing" );
|
||||
addNotetrack_customFunction( "player_rig", "stab_left", ::stab_fx_left, "climbing" );
|
||||
addNotetrack_customFunction( "player_rig", "stab_right", ::stab_fx_right, "climbing" );
|
||||
|
||||
}
|
||||
|
||||
get_anims_for_climbing_direction( anims, dir, arm )
|
||||
{
|
||||
anims[ "root" ] = %climb_root;
|
||||
anims[ "player_climb_root" ] = %player_climb;
|
||||
anims[ "wrist" ] = %climb_wrist;
|
||||
anims[ "jump_down_start" ] = %player_icepicker_drop_down_start;
|
||||
anims[ "jump_down_end" ] = %player_icepicker_drop_down_end;
|
||||
anims[ "big_jump" ] = %player_icepicker_bigjump;
|
||||
anims[ "big_jump_both_in" ] = %player_icepicker_bigjump_slide_both_in;
|
||||
anims[ "big_jump_both_out" ] = %player_icepicker_bigjump_slide_both_out;
|
||||
anims[ "big_jump_left" ] = %player_icepicker_bigjump_slide_left_in;
|
||||
anims[ "big_jump_right" ] = %player_icepicker_bigjump_slide_right_in;
|
||||
anims[ "sleeve_flap" ] = %player_sleeve_flapping;
|
||||
anims[ "climb_finish" ] = %player_icepicker_bigjump_end_getup;
|
||||
|
||||
anims[ "start_climb_left" ] = %player_icepicker_start_climb_up_left;
|
||||
anims[ "start_climb_right" ] = %player_icepicker_start_climb_up_right;
|
||||
anims[ "early_climb_left" ] = %player_icepicker_start_climb_up_left_early;
|
||||
anims[ "early_climb_right" ] = %player_icepicker_start_climb_up_right_early;
|
||||
|
||||
|
||||
if ( dir == "up" )
|
||||
{
|
||||
if ( arm == "right" )
|
||||
{
|
||||
anims[ "stab" ] = %player_icepicker_right_high_stab_a;
|
||||
anims[ "settle" ] = %player_icepicker_right_high_settle_a;
|
||||
anims[ "fail" ] = %player_icepicker_right_high_stab_fail_a;
|
||||
anims[ "idle" ] = %player_icepicker_right_idle;
|
||||
anims[ "additive" ] = %climb_right_additive;
|
||||
anims[ "additive_in" ] = %player_icepicker_right_high_stab_in;
|
||||
anims[ "additive_out" ] = %player_icepicker_right_high_stab_out;
|
||||
anims[ "wrist_in" ] = %player_icepicker_right_high_wrist_in;
|
||||
anims[ "wrist_out" ] = %player_icepicker_right_high_wrist_out;
|
||||
anims[ "fall" ] = %player_icepicker_right_fall;
|
||||
anims[ "fall_small" ] = %player_icepicker_right_fall_small;
|
||||
}
|
||||
else
|
||||
{
|
||||
anims[ "stab" ] = %player_icepicker_left_high_stab_a;
|
||||
anims[ "settle" ] = %player_icepicker_left_high_settle_a;
|
||||
anims[ "fail" ] = %player_icepicker_left_high_stab_fail_a;
|
||||
anims[ "idle" ] = %player_icepicker_left_idle;
|
||||
anims[ "additive" ] = %climb_left_additive;
|
||||
anims[ "additive_in" ] = %player_icepicker_left_high_stab_in;
|
||||
anims[ "additive_out" ] = %player_icepicker_left_high_stab_out;
|
||||
anims[ "wrist_in" ] = %player_icepicker_left_high_wrist_in;
|
||||
anims[ "wrist_out" ] = %player_icepicker_left_high_wrist_out;
|
||||
anims[ "fall" ] = %player_icepicker_left_fall;
|
||||
anims[ "fall_small" ] = %player_icepicker_left_fall_small;
|
||||
}
|
||||
|
||||
anims[ "additive_in_strength" ] = 1;
|
||||
anims[ "additive_out_strength" ] = 1;
|
||||
return anims;
|
||||
}
|
||||
|
||||
if ( dir == "right" )
|
||||
{
|
||||
if ( arm == "right" )
|
||||
{
|
||||
anims[ "additive" ] = %climb_right_additive;
|
||||
anims[ "additive_in_strength" ] = 0.5;
|
||||
anims[ "additive_out_strength" ] = 1;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
anims[ "fail" ] = %player_icepicker_left_high_stab_fail_a;
|
||||
anims[ "additive" ] = %climb_left_additive;
|
||||
anims[ "additive_in_strength" ] = 0.5;
|
||||
anims[ "additive_out_strength" ] = 0.5;
|
||||
}
|
||||
return anims;
|
||||
}
|
||||
|
||||
if ( dir == "left" )
|
||||
{
|
||||
if ( arm == "right" )
|
||||
{
|
||||
anims[ "fail" ] = %player_icepicker_right_high_stab_fail_a;
|
||||
anims[ "additive" ] = %climb_right_additive;
|
||||
anims[ "additive_in_strength" ] = 0.5;
|
||||
anims[ "additive_out_strength" ] = 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
anims[ "additive" ] = %climb_left_additive;
|
||||
anims[ "additive_in_strength" ] = 0.5;
|
||||
anims[ "additive_out_strength" ] = 1;
|
||||
|
||||
anims[ "vertical_corrector" ] = %climb_left_vertical_corrector;
|
||||
}
|
||||
return anims;
|
||||
}
|
||||
|
||||
assertex( 0, "No dir " + dir );
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "script_model" );
|
||||
climb_preview_anim()
|
||||
{
|
||||
anims = [];
|
||||
anims[ "cliff_hero1_pose_A" ] = %cliff_hero1_pose_A;
|
||||
anims[ "cliff_hero1_pose_B" ] = %cliff_hero1_pose_B;
|
||||
anims[ "cliff_hero1_pose_C" ] = %cliff_hero1_pose_C;
|
||||
anims[ "cliff_hero1_pose_D" ] = %cliff_hero1_pose_D;
|
||||
anims[ "cliff_hero2_pose_A" ] = %cliff_hero2_pose_A;
|
||||
anims[ "cliff_hero2_pose_B" ] = %cliff_hero2_pose_B;
|
||||
anims[ "cliff_hero2_pose_C" ] = %cliff_hero2_pose_C;
|
||||
anims[ "cliff_hero2_pose_D" ] = %cliff_hero2_pose_D;
|
||||
anims[ "cliff_hero1_pose_jump1" ] = %cliff_hero1_pose_jump1;
|
||||
anims[ "cliff_hero1_pose_jump2" ] = %cliff_hero1_pose_jump2;
|
||||
anims[ "cliff_hero1_pose_jump3" ] = %cliff_hero1_pose_jump3;
|
||||
anims[ "cliff_hero1_pose_jump4" ] = %cliff_hero1_pose_jump4;
|
||||
anims[ "cliff_hero1_pose_jump5" ] = %cliff_hero1_pose_jump5;
|
||||
anims[ "cliff_hero1_pose_jump6" ] = %cliff_hero1_pose_jump6;
|
||||
self useanimtree( #animtree );
|
||||
animation = anims[ self.animation ];
|
||||
origin = GetStartOrigin( self.origin, self.angles, animation );
|
||||
angles = GetStartAngles( self.origin, self.angles, animation );
|
||||
thread climb_preview_animates( animation, origin, angles );
|
||||
|
||||
self anim_spawn_tag_model( "weapon_ice_picker", "tag_weapon_left" );
|
||||
self anim_spawn_tag_model( "weapon_ice_picker", "tag_inhand" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
if ( distance( level.player.origin, self.origin ) < 150 )
|
||||
break;
|
||||
wait( 0.05 );
|
||||
}
|
||||
self delete();
|
||||
}
|
||||
|
||||
climb_preview_animates( animation, origin, angles )
|
||||
{
|
||||
self endon( "death" );
|
||||
for ( ;; )
|
||||
{
|
||||
self.origin = origin;
|
||||
self.angles = angles;
|
||||
self setflaggedanim( "anim", animation, 1, 0, 1 );
|
||||
self waittillmatch( "anim", "end" );
|
||||
}
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "cobra", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_deathmodel( "vehicle_cobra_helicopter", "vehicle_cobra_helicopter" );
|
||||
build_deathmodel( "vehicle_cobra_helicopter_low" );
|
||||
build_deathmodel( "vehicle_cobra_helicopter_fly" );
|
||||
build_deathmodel( "vehicle_cobra_helicopter_fly_low" );
|
||||
build_drive( %bh_rotors, undefined, 0, 3.0 );
|
||||
|
||||
cobra_death_fx = [];
|
||||
cobra_death_fx[ "vehicle_cobra_helicopter" ] = "explosions/large_vehicle_explosion";
|
||||
cobra_death_fx[ "vehicle_cobra_helicopter_low" ] = "explosions/large_vehicle_explosion";
|
||||
cobra_death_fx[ "vehicle_cobra_helicopter_fly" ] = "explosions/large_vehicle_explosion";
|
||||
cobra_death_fx[ "vehicle_cobra_helicopter_fly_low" ] = "explosions/large_vehicle_explosion";
|
||||
|
||||
build_deathfx( "explosions/grenadeexp_default", "tag_engine_left", "hind_helicopter_hit", undefined, undefined, undefined, 0.2, true );
|
||||
build_deathfx( "explosions/grenadeexp_default", "tail_rotor_jnt", "hind_helicopter_secondary_exp", undefined, undefined, undefined, 0.5, true );
|
||||
build_deathfx( "fire/fire_smoke_trail_L", "tail_rotor_jnt", "hind_helicopter_dying_loop", true, 0.05, true, 0.5, true );
|
||||
build_deathfx( "explosions/aerial_explosion", "tag_engine_right", "hind_helicopter_secondary_exp", undefined, undefined, undefined, 2.5, true );
|
||||
build_deathfx( "explosions/aerial_explosion", "tag_deathfx", "hind_helicopter_secondary_exp", undefined, undefined, undefined, 4.0 );
|
||||
build_deathfx( cobra_death_fx[ model ], undefined, "hind_helicopter_crash", undefined, undefined, undefined, - 1, undefined, "stop_crash_loop_sound" );
|
||||
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
build_mainturret();
|
||||
|
||||
randomStartDelay = randomfloatrange( 0, 1 );
|
||||
build_light( model, "wingtip_green", "tag_light_L_wing", "misc/aircraft_light_wingtip_green", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_red", "tag_light_R_wing", "misc/aircraft_light_wingtip_red", "running", randomStartDelay );
|
||||
build_light( model, "white_blink", "tag_light_belly", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "white_blink_tail", "tag_light_tail", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
build_compassicon( "helicopter", false );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
//self.delete_on_death = true;
|
||||
self.script_badplace = false;// All helicopters dont need to create bad places
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 2;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "tag_pilot";
|
||||
positions[ 1 ].sittag = "tag_gunner";
|
||||
|
||||
positions[ 0 ].bHasGunWhileRiding = false;
|
||||
positions[ 1 ].bHasGunWhileRiding = false;
|
||||
|
||||
|
||||
positions[ 0 ].idle[ 0 ] = %helicopter_pilot1_idle;
|
||||
positions[ 0 ].idle[ 1 ] = %helicopter_pilot1_twitch_clickpannel;
|
||||
positions[ 0 ].idle[ 2 ] = %helicopter_pilot1_twitch_lookback;
|
||||
positions[ 0 ].idle[ 3 ] = %helicopter_pilot1_twitch_lookoutside;
|
||||
positions[ 0 ].idleoccurrence[ 0 ] = 500;
|
||||
positions[ 0 ].idleoccurrence[ 1 ] = 100;
|
||||
positions[ 0 ].idleoccurrence[ 2 ] = 100;
|
||||
positions[ 0 ].idleoccurrence[ 3 ] = 100;
|
||||
|
||||
positions[ 1 ].idle[ 0 ] = %helicopter_pilot2_idle;
|
||||
positions[ 1 ].idle[ 1 ] = %helicopter_pilot2_twitch_clickpannel;
|
||||
positions[ 1 ].idle[ 2 ] = %helicopter_pilot2_twitch_lookoutside;
|
||||
positions[ 1 ].idle[ 3 ] = %helicopter_pilot2_twitch_radio;
|
||||
positions[ 1 ].idleoccurrence[ 0 ] = 450;
|
||||
positions[ 1 ].idleoccurrence[ 1 ] = 100;
|
||||
positions[ 1 ].idleoccurrence[ 2 ] = 100;
|
||||
positions[ 1 ].idleoccurrence[ 3 ] = 100;
|
||||
|
||||
return positions;
|
||||
|
||||
// add generic helicopter pilot anims
|
||||
// - helicopter_pilot1_idle
|
||||
// - helicopter_pilot1_twitch_clickpannel
|
||||
// - helicopter_pilot1_twitch_lookback
|
||||
// - helicopter_pilot1_twitch_lookoutside
|
||||
// - helicopter_pilot2_idle
|
||||
// - helicopter_pilot2_twitch_clickpannel
|
||||
// - helicopter_pilot2_twitch_lookoutside
|
||||
// - helicopter_pilot2_twitch_radio
|
||||
// - adjust mi17 / mi24 / mi28 / cobra tag for new anims
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_cobra_helicopter (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_cobra::main( "vehicle_cobra_helicopter" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_cobra_helicopter_cobra
|
||||
sound,vehicle_cobra,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_cobra_helicopter"
|
||||
default:"vehicletype" "cobra"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_cobra_helicopter_fly (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_cobra::main( "vehicle_cobra_helicopter_fly" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_cobra_helicopter_fly_cobra
|
||||
sound,vehicle_cobra,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_cobra_helicopter_fly"
|
||||
default:"vehicletype" "cobra"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_cobra_helicopter_fly_low (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_cobra::main( "vehicle_cobra_helicopter_fly_low" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_cobra_helicopter_fly_low_cobra
|
||||
sound,vehicle_cobra,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_cobra_helicopter_fly_low"
|
||||
default:"vehicletype" "cobra"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_cobra_helicopter_low (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_cobra::main( "vehicle_cobra_helicopter_low" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_cobra_helicopter_low_cobra
|
||||
sound,vehicle_cobra,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_cobra_helicopter_low"
|
||||
default:"vehicletype" "cobra"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,69 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "cobra_player", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_deathmodel( "vehicle_cobra_helicopter" );
|
||||
build_deathmodel( "vehicle_cobra_helicopter_fly" );
|
||||
|
||||
// this doesn't happen very much but it's a nicer cleaner format than the case statement.
|
||||
cobra_death_fx = [];
|
||||
cobra_death_fx[ "vehicle_cobra_helicopter" ] = "explosions/helicopter_explosion_hind_desert";
|
||||
cobra_death_fx[ "vehicle_cobra_helicopter_fly" ] = "explosions/helicopter_explosion_hind_desert";
|
||||
|
||||
build_deathfx( "explosions/grenadeexp_default", "tag_engine_left", "hind_helicopter_hit", undefined, undefined, undefined, 0.2, true );
|
||||
build_deathfx( "explosions/grenadeexp_default", "tail_rotor_jnt", "hind_helicopter_secondary_exp", undefined, undefined, undefined, 0.5, true );
|
||||
build_deathfx( "fire/fire_smoke_trail_L", "tail_rotor_jnt", "hind_helicopter_dying_loop", true, 0.05, true, 0.5, true );
|
||||
build_deathfx( "explosions/aerial_explosion", "tag_engine_right", "hind_helicopter_secondary_exp", undefined, undefined, undefined, 2.5, true );
|
||||
build_deathfx( "explosions/aerial_explosion", "tag_deathfx", "hind_helicopter_secondary_exp", undefined, undefined, undefined, 4.0 );
|
||||
build_deathfx( cobra_death_fx[ model ], undefined, "hind_helicopter_crash", undefined, undefined, undefined, - 1, undefined, "stop_crash_loop_sound" );
|
||||
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
build_mainturret();
|
||||
|
||||
randomStartDelay = randomfloatrange( 0, 1 );
|
||||
build_light( model, "wingtip_green", "tag_light_L_wing", "misc/aircraft_light_wingtip_green", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_red", "tag_light_R_wing", "misc/aircraft_light_wingtip_red", "running", randomStartDelay );
|
||||
build_light( model, "white_blink", "tag_light_belly", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "white_blink_tail", "tag_light_tail", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
self.delete_on_death = true;
|
||||
self.script_badplace = false;// All helicopters dont need to create bad places
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_cobra_helicopter_player (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_cobra_player::main( "vehicle_cobra_helicopter" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_cobra_helicopter_cobra
|
||||
sound,vehicle_cobra,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_cobra_helicopter"
|
||||
default:"vehicletype" "cobra_player"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_cobra_helicopter_fly_player (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_cobra_player::main( "vehicle_cobra_helicopter_fly" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_cobra_helicopter_fly_cobra
|
||||
sound,vehicle_cobra,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_cobra_helicopter_fly"
|
||||
default:"vehicletype" "cobra_player"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
File diff suppressed because it is too large.
Load diff
+1721
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,92 @@
|
||||
setupMiniMap( material )
|
||||
{
|
||||
level.minimap_image = material;
|
||||
if ( !isdefined( level._loadStarted ) )
|
||||
{
|
||||
println( "^1Warning: shouldn't call setupMiniMap until after _load::main()" );
|
||||
}
|
||||
|
||||
// use 0 for no required map aspect ratio.
|
||||
requiredMapAspectRatio = getdvarfloat( "scr_requiredMapAspectRatio", 1 );
|
||||
|
||||
corners = getentarray( "minimap_corner", "targetname" );
|
||||
if ( corners.size != 2 )
|
||||
{
|
||||
println( "^1Error: There are not exactly two \"minimap_corner\" entities in the map. Could not set up minimap." );
|
||||
return;
|
||||
}
|
||||
|
||||
corner0 = ( corners[ 0 ].origin[ 0 ], corners[ 0 ].origin[ 1 ], 0 );
|
||||
corner1 = ( corners[ 1 ].origin[ 0 ], corners[ 1 ].origin[ 1 ], 0 );
|
||||
|
||||
cornerdiff = corner1 - corner0;
|
||||
|
||||
north = ( cos( getnorthyaw() ), sin( getnorthyaw() ), 0 );
|
||||
west = ( 0 - north[ 1 ], north[ 0 ], 0 );
|
||||
|
||||
// we need the northwest and southeast corners. all we know is that corner0 is opposite of corner1.
|
||||
if ( vectordot( cornerdiff, west ) > 0 ) {
|
||||
// corner1 is further west than corner0
|
||||
if ( vectordot( cornerdiff, north ) > 0 ) {
|
||||
// corner1 is northwest, corner0 is southeast
|
||||
northwest = corner1;
|
||||
southeast = corner0;
|
||||
}
|
||||
else {
|
||||
// corner1 is southwest, corner0 is northeast
|
||||
side = vecscale( north, vectordot( cornerdiff, north ) );
|
||||
northwest = corner1 - side;
|
||||
southeast = corner0 + side;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// corner1 is further east than corner0
|
||||
if ( vectordot( cornerdiff, north ) > 0 ) {
|
||||
// corner1 is northeast, corner0 is southwest
|
||||
side = vecscale( north, vectordot( cornerdiff, north ) );
|
||||
northwest = corner0 + side;
|
||||
southeast = corner1 - side;
|
||||
}
|
||||
else {
|
||||
// corner1 is southeast, corner0 is northwest
|
||||
northwest = corner0;
|
||||
southeast = corner1;
|
||||
}
|
||||
}
|
||||
|
||||
// expand map area to fit required aspect ratio
|
||||
if ( requiredMapAspectRatio > 0 )
|
||||
{
|
||||
northportion = vectordot( northwest - southeast, north );
|
||||
westportion = vectordot( northwest - southeast, west );
|
||||
mapAspectRatio = westportion / northportion;
|
||||
if ( mapAspectRatio < requiredMapAspectRatio )
|
||||
{
|
||||
incr = requiredMapAspectRatio / mapAspectRatio;
|
||||
addvec = vecscale( west, westportion * ( incr - 1 ) * 0.5 );
|
||||
}
|
||||
else
|
||||
{
|
||||
incr = mapAspectRatio / requiredMapAspectRatio;
|
||||
addvec = vecscale( north, northportion * ( incr - 1 ) * 0.5 );
|
||||
}
|
||||
northwest += addvec;
|
||||
southeast -= addvec;
|
||||
}
|
||||
|
||||
// This level.map_extents stuff seems to rely on northyaw being in a specific direction. It is not correct in the general case. I would not recommend using it.
|
||||
level.map_extents = [];
|
||||
level.map_extents[ "top" ] = northwest[ 1 ];
|
||||
level.map_extents[ "left" ] = southeast[ 0 ];
|
||||
level.map_extents[ "bottom" ] = southeast[ 1 ];
|
||||
level.map_extents[ "right" ] = northwest[ 0 ];
|
||||
level.map_width = level.map_extents[ "right" ] - level.map_extents[ "left" ];
|
||||
level.map_height = level.map_extents[ "top" ] - level.map_extents[ "bottom" ];
|
||||
|
||||
setMiniMap( material, northwest[ 0 ], northwest[ 1 ], southeast[ 0 ], southeast[ 1 ] );
|
||||
}
|
||||
|
||||
vecscale( vec, scalar )
|
||||
{
|
||||
return( vec[ 0 ] * scalar, vec[ 1 ] * scalar, vec[ 2 ] * scalar );
|
||||
}
|
||||
+1315
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,92 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
//SNDFILE=vehicle_coupe_car
|
||||
build_template( "coupe", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_destructible( "vehicle_coupe_gold_destructible", "vehicle_coupe_gold" );
|
||||
build_destructible( "vehicle_coupe_gray_destructible", "vehicle_coupe_gray" );
|
||||
|
||||
build_radiusdamage( ( 0, 0, 32 ), 300, 200, 100, false );
|
||||
build_drive( %uaz_driving_idle_forward, %uaz_driving_idle_backward, 10 );
|
||||
build_deathquake( 1, 1.6, 500 );
|
||||
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
positions[ 0 ].vehicle_getoutanim = %uaz_driver_exit_into_stand_door;
|
||||
positions[ 1 ].vehicle_getoutanim = %uaz_passenger_exit_into_stand_door;
|
||||
|
||||
positions[ 0 ].vehicle_getoutanim_clear = false;
|
||||
positions[ 1 ].vehicle_getoutanim_clear = false;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
|
||||
for ( i = 0;i < 2;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
positions[ 0 ].sittag = "tag_driver";
|
||||
positions[ 0 ].idle = %luxurysedan_driver_idle;
|
||||
positions[ 0 ].death = %luxurysedan_driver_idle;
|
||||
|
||||
positions[ 1 ].sittag = "tag_passenger";
|
||||
positions[ 1 ].idle = %uaz_passenger_idle_drive;
|
||||
positions[ 1 ].death = %uaz_passenger_idle_drive;
|
||||
|
||||
positions[ 0 ].getout = %humvee_passenger_out_L;
|
||||
positions[ 1 ].getout = %humvee_passenger_out_R;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_coupe_gray (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_coupe::main( "vehicle_coupe_gray_destructible" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_coupe_gray
|
||||
sound,vehicle_coupe,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_coupe_gray_destructible"
|
||||
default:"vehicletype" "coupe"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_coupe_gold (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_coupe::main( "vehicle_coupe_gold_destructible" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_coupe_gold
|
||||
sound,vehicle_coupe,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_coupe_gold_destructible"
|
||||
default:"vehicletype" "coupe"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,58 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
#include common_scripts\_createFxMenu;
|
||||
#include common_scripts\_createfx;
|
||||
#include common_scripts\_fx;
|
||||
|
||||
createfx()
|
||||
{
|
||||
level.func_position_player = ::func_position_player;
|
||||
level.func_position_player_get = ::func_position_player_get;
|
||||
level.func_loopfxthread = ::loopfxthread;
|
||||
level.func_oneshotfxthread = ::oneshotfxthread;
|
||||
level.func_create_loopsound = ::create_loopsound;
|
||||
// level.func_exploder_preload = ::exploder_before_load;;
|
||||
// level.func_exploder_postload = ::exploder_after_load;;
|
||||
level.func_updatefx = ::restart_fx_looper;
|
||||
level.func_process_fx_rotater = ::process_fx_rotater;
|
||||
|
||||
level.mp_createfx = false;
|
||||
|
||||
// SP only stuff
|
||||
ai = getaiarray();
|
||||
for ( i = 0;i < ai.size;i++ )
|
||||
ai[ i ] delete();
|
||||
|
||||
thread createFxLogic();
|
||||
|
||||
thread func_get_level_fx(); // start gettin these on start
|
||||
createfx_common();
|
||||
|
||||
level waittill( "eternity" );
|
||||
}
|
||||
|
||||
func_position_player_get( lastPlayerOrigin )
|
||||
{
|
||||
if ( distance( lastPlayerOrigin, level.player.origin ) > 64 )
|
||||
{
|
||||
// save the players position so we can go back here on a map restart
|
||||
setdvar( "createfx_playerpos_x", level.player.origin[ 0 ] );
|
||||
setdvar( "createfx_playerpos_y", level.player.origin[ 1 ] );
|
||||
setdvar( "createfx_playerpos_z", level.player.origin[ 2 ] );
|
||||
}
|
||||
|
||||
return level.player.origin;
|
||||
}
|
||||
|
||||
func_position_player()
|
||||
{
|
||||
// if we're still on the same map then..
|
||||
// set the players position so map restart doesnt move your origin in createfx
|
||||
|
||||
playerPos = [];
|
||||
playerPos[ 0 ] = getdvarint( "createfx_playerpos_x" );
|
||||
playerPos[ 1 ] = getdvarint( "createfx_playerpos_y" );
|
||||
playerPos[ 2 ] = getdvarint( "createfx_playerpos_z" );
|
||||
|
||||
level.player setOrigin( ( playerPos[ 0 ], playerPos[ 1 ], playerPos[ 2 ] ) );
|
||||
}
|
||||
@@ -0,0 +1,607 @@
|
||||
#include maps\_utility;
|
||||
|
||||
/*
|
||||
path_editmode = ""; //toggles value, edit or view default to view.
|
||||
path_select_next = ""; // selects next psourceposition;
|
||||
path_select_prev = ""; // selects prev psourceposition
|
||||
path_setview = ""; // sets the view of the currently selected position.
|
||||
path_help ""; //prints to console some help text
|
||||
path_dump ""; //dumps view list to the console to be cut and pasted into script somewhere
|
||||
*/
|
||||
|
||||
init()
|
||||
{
|
||||
flag_init( "path_Notviewing" );
|
||||
flag_init( "path_refresh" );
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
/#
|
||||
|
||||
if ( !isdefined( level.flag ) || !isdefined( level.flag[ "path_refresh" ] ) )
|
||||
{
|
||||
flag_init( "path_refresh" );
|
||||
flag_init( "path_Notviewing" );
|
||||
}
|
||||
|
||||
level.path_selectrad = 128;
|
||||
precacheshader( "psourcecreate" );
|
||||
precacheshader( "psourcemodify" );
|
||||
|
||||
setdvar( "path_delete", "" );
|
||||
setdvar( "path_editmode", "" );
|
||||
setdvar( "path_select_next", "" );
|
||||
setdvar( "path_select_prev", "" );
|
||||
setdvar( "path_setview", "" );
|
||||
setdvar( "path_help", "" );
|
||||
setdvar( "path_dump", "" );
|
||||
setdvar( "path_select_new", "" );
|
||||
setdvar( "path_enable", "0" );
|
||||
setdvar( "path_setid", "0" );
|
||||
level.pathmodsize = 35;
|
||||
level.pathmod = newhudelem();
|
||||
level.pathmod.alignX = "center";
|
||||
level.pathmod.alignY = "top";
|
||||
level.pathmod.horzAlign = "center";
|
||||
level.pathmod.vertAlign = "top";
|
||||
level.pathmod.x = 0;
|
||||
level.pathmod.y = 0;
|
||||
level.pathmod.alpha = .5;
|
||||
level.pathmod setshader( "psourcemodify", level.pathmodsize * 2, level.pathmodsize );
|
||||
|
||||
level.path_editmode = false;
|
||||
if ( !isdefined( level.path_views ) )
|
||||
level.path_views = [];
|
||||
if ( !isdefined( level.path_views[ level.path_selectid ] ) )
|
||||
level.path_views[ level.path_selectid ] = [];
|
||||
|
||||
if ( !isdefined( level.path_selectid ) )
|
||||
level.path_selectid = path_createid( "default" );
|
||||
|
||||
if ( !isdefined( level.path_selectindex ) )
|
||||
level.path_selectindex = level.path_views.size;
|
||||
level.path_viewindex = undefined;
|
||||
thread path_viewmode();
|
||||
|
||||
// this handles all of the dvar settings
|
||||
while ( 1 )
|
||||
{
|
||||
path_enable(); // pauses if not enabled.
|
||||
path_editmode_update();
|
||||
path_select_next();
|
||||
path_select_prev();
|
||||
path_select_new();
|
||||
path_setid();
|
||||
path_setview();
|
||||
path_delete();
|
||||
path_dump();
|
||||
path_help();
|
||||
wait .05;
|
||||
}
|
||||
#/
|
||||
}
|
||||
|
||||
path_enable()
|
||||
{
|
||||
if ( getdvar( "path_enable" ) != "1" )
|
||||
{
|
||||
flag_set( "path_refresh" ); // makes everything stop drawing.
|
||||
level.pathmod.alpha = 0;
|
||||
}
|
||||
path_waittill_enable();
|
||||
level.pathmod.alpha = 1;
|
||||
}
|
||||
|
||||
path_waittill_enable()
|
||||
{
|
||||
while ( getdvar( "path_enable" ) != "1" )
|
||||
wait .1;
|
||||
}
|
||||
|
||||
path_viewmode()
|
||||
{
|
||||
wait .1;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
path_waittill_enable();
|
||||
flag_set( "path_Notviewing" );
|
||||
flag_clear( "path_refresh" );
|
||||
thread path_connectlines();
|
||||
for ( i = 0;i < level.path_views[ level.path_selectid ].size;i++ )
|
||||
level.path_views[ level.path_selectid ][ i ] thread path_viewwait( i );
|
||||
thread path_activatebutton();
|
||||
thread path_handleselectindex();
|
||||
flag_wait( "path_refresh" );
|
||||
flag_wait( "path_Notviewing" );
|
||||
}
|
||||
}
|
||||
|
||||
path_connectlines()
|
||||
{
|
||||
level endon( "path_refresh" );
|
||||
dots = [];
|
||||
for ( i = 0;i < level.path_views[ level.path_selectid ].size;i++ )
|
||||
{
|
||||
dots[ i ] = level.path_views[ level.path_selectid ][ i ].origin;
|
||||
}
|
||||
while ( 1 )
|
||||
{
|
||||
plot_points( dots, 1, 0, 0, .05 );
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
|
||||
path_activatebutton()
|
||||
{
|
||||
level endon( "path_refresh" );
|
||||
while ( 1 )
|
||||
{
|
||||
while ( !level.player usebuttonpressed() )
|
||||
wait .05;
|
||||
pick = path_getvisible();
|
||||
if ( isdefined( pick.index ) )
|
||||
{
|
||||
level.path_selectindex = pick.index;
|
||||
level.path_selectid = path_createid( pick.ident );
|
||||
}
|
||||
while ( level.player usebuttonpressed() )
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
|
||||
path_handleselectindex()
|
||||
{
|
||||
level endon( "path_refresh" );
|
||||
lastselect = level.path_selectindex;
|
||||
while ( 1 )
|
||||
{
|
||||
if ( !isdefined( level.path_views[ level.path_selectid ][ lastselect ] ) )
|
||||
level.pathmod setshader( "psourcecreate", level.pathmodsize * 2, level.pathmodsize );
|
||||
|
||||
if ( lastselect == level.path_selectindex )
|
||||
{
|
||||
wait .05;
|
||||
continue;
|
||||
}
|
||||
lastselect = level.path_selectindex;
|
||||
if ( isdefined( level.path_views[ level.path_selectid ][ lastselect ] ) )
|
||||
level.path_views[ level.path_selectid ][ lastselect ] thread path_hudshow();
|
||||
}
|
||||
}
|
||||
|
||||
path_hudshow()
|
||||
{
|
||||
flag_clear( "path_Notviewing" );
|
||||
level.pathmod setshader( "psourcemodify", level.pathmodsize * 2, level.pathmodsize );
|
||||
level.player freezecontrols( true );
|
||||
level.player setorigin( self.origin + ( level.player.origin - level.player geteye() ) - vector_multiply( anglestoforward( self.angles ), 3 ) );
|
||||
level.player setplayerangles( self.angles );
|
||||
flag_set( "path_refresh" );
|
||||
while ( level.player islookingorg( self ) && level.player usebuttonpressed() )
|
||||
wait .05;
|
||||
level.player freezecontrols( false );
|
||||
flag_set( "path_Notviewing" );
|
||||
}
|
||||
|
||||
|
||||
path_getvisible()
|
||||
{
|
||||
outident = undefined;
|
||||
index = undefined;
|
||||
dist = 1000000;
|
||||
for ( j = 0;j < level.paths_selectid_list.size;j++ )
|
||||
{
|
||||
ident = level.paths_selectid_list[ j ];
|
||||
for ( i = 0;i < level.path_views[ ident ].size;i++ )
|
||||
{
|
||||
if ( level.player islookingorg( level.path_views[ ident ][ i ] ) )
|
||||
{
|
||||
newdist = distance( level.player geteye(), level.path_views[ ident ][ i ].origin );
|
||||
if ( newdist < dist )
|
||||
{
|
||||
dist = newdist;
|
||||
index = i;
|
||||
outident = ident;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
outvar = spawnstruct();
|
||||
outvar.index = index;
|
||||
outvar.ident = outident;
|
||||
return outvar;
|
||||
}
|
||||
|
||||
path_viewwait( index )
|
||||
{
|
||||
level endon( "path_refresh" );
|
||||
arrowlength = 55;
|
||||
viewradexpandmax = 8;
|
||||
viewradexpandcount = 0;
|
||||
viewraddir = 1;
|
||||
frametime = .05;
|
||||
while ( 1 )
|
||||
{
|
||||
if ( distance( flat_origin( self.origin ), flat_origin( level.player.origin ) ) < 32 )
|
||||
{
|
||||
wait .05;
|
||||
continue;
|
||||
}
|
||||
thread draw_arrow_time( self.origin, self.origin + vector_multiply( anglestoforward( self.angles ), arrowlength ), ( 0, 1, 1 ), frametime );
|
||||
|
||||
if ( level.path_selectindex == index )
|
||||
thread plot_circle_star_fortime( level.path_selectrad, frametime, ( 1, 1, 0 ) );
|
||||
else
|
||||
thread plot_circle_fortime( level.path_selectrad, frametime, ( 0, 1, 0 ) );
|
||||
if ( isdefined( level.path_viewindex ) && level.path_viewindex == index )
|
||||
{
|
||||
if ( viewradexpandcount > viewradexpandmax )
|
||||
viewraddir = -1;
|
||||
else if ( viewradexpandcount < 0 )
|
||||
viewraddir = 1;
|
||||
viewradexpandcount += viewraddir;
|
||||
viewrad = level.path_selectrad + 3 + viewradexpandcount;
|
||||
viewcolor = ( 0, 1, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
viewrad = level.path_selectrad + 3;
|
||||
viewcolor = ( 0, 1, 0 );
|
||||
}
|
||||
thread plot_circle_fortime( viewrad, frametime, viewcolor );
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
|
||||
plot_circle_star_fortime( radius, time, color )
|
||||
{
|
||||
if ( !isdefined( color ) )
|
||||
color = ( 0, 1, 0 );
|
||||
hangtime = .05;
|
||||
circleres = 16;
|
||||
hemires = circleres / 2;
|
||||
circleinc = 360 / circleres;
|
||||
circleres++ ;
|
||||
plotpoints = [];
|
||||
rad = 0;
|
||||
plotpoints = [];
|
||||
rad = 0.000;
|
||||
timer = gettime() + ( time * 1000 );
|
||||
|
||||
while ( gettime() < timer )
|
||||
{
|
||||
angletoplayer = vectortoangles( self.origin - level.player geteye() );
|
||||
for ( i = 0;i < circleres;i++ )
|
||||
{
|
||||
plotpoints[ plotpoints.size ] = self.origin + vector_multiply( anglestoforward( ( angletoplayer + ( rad, 90, 0 ) ) ), radius );
|
||||
rad += circleinc;
|
||||
}
|
||||
for ( i = 0;i < plotpoints.size;i++ )
|
||||
line( plotpoints[ i ], self.origin, color, 1 );
|
||||
plotpoints = [];
|
||||
wait hangtime;
|
||||
}
|
||||
}
|
||||
|
||||
plot_circle_fortime( radius, time, color )
|
||||
{
|
||||
if ( !isdefined( color ) )
|
||||
color = ( 0, 1, 0 );
|
||||
hangtime = .05;
|
||||
circleres = 16;
|
||||
hemires = circleres / 2;
|
||||
circleinc = 360 / circleres;
|
||||
circleres++ ;
|
||||
plotpoints = [];
|
||||
rad = 0;
|
||||
|
||||
plotpoints = [];
|
||||
rad = 0.000;
|
||||
timer = gettime() + ( time * 1000 );
|
||||
while ( gettime() < timer )
|
||||
{
|
||||
angletoplayer = vectortoangles( self.origin - level.player geteye() );
|
||||
for ( i = 0;i < circleres;i++ )
|
||||
{
|
||||
plotpoints[ plotpoints.size ] = self.origin + vector_multiply( anglestoforward( ( angletoplayer + ( rad, 90, 0 ) ) ), radius );
|
||||
rad += circleinc;
|
||||
}
|
||||
plot_points( plotpoints, color[ 0 ], color[ 1 ], color[ 2 ], hangtime );
|
||||
plotpoints = [];
|
||||
wait hangtime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
path_select_next()
|
||||
{
|
||||
if ( getdvar( "path_select_next" ) == "" )
|
||||
return;
|
||||
if ( !( level.path_selectindex == level.path_views[ level.path_selectid ].size ) )
|
||||
level.path_selectindex++ ;
|
||||
|
||||
setdvar( "path_select_next", "" );
|
||||
|
||||
}
|
||||
|
||||
path_select_prev()
|
||||
{
|
||||
if ( getdvar( "path_select_prev" ) == "" )
|
||||
return;
|
||||
if ( !( level.path_selectindex == 0 ) )
|
||||
level.path_selectindex -- ;
|
||||
setdvar( "path_select_prev", "" );
|
||||
|
||||
}
|
||||
|
||||
path_select_new()
|
||||
{
|
||||
if ( getdvar( "path_select_new" ) == "" )
|
||||
return;
|
||||
level.path_selectindex = level.path_views[ level.path_selectid ].size;
|
||||
setdvar( "path_select_new", "" );
|
||||
|
||||
}
|
||||
|
||||
|
||||
path_setid()
|
||||
{
|
||||
if ( getdvar( "path_setid" ) == "" )
|
||||
return;
|
||||
level.path_selectid = path_createid( getdvar( "path_setid" ) );
|
||||
level.path_selectindex = 0;// set current selection to first whenever it's changed
|
||||
}
|
||||
|
||||
path_setview()
|
||||
{
|
||||
if ( getdvar( "path_setview" ) == "" )
|
||||
return;
|
||||
view = path_getcurrentview();
|
||||
//add trigger stuff here
|
||||
//check for trigger
|
||||
path_setvieworgang( view );
|
||||
setdvar( "path_setview", "" );
|
||||
flag_set( "path_refresh" );
|
||||
}
|
||||
|
||||
path_setvieworgang( view )
|
||||
{
|
||||
view.origin = level.player geteye();
|
||||
view.angles = level.player getplayerangles();
|
||||
}
|
||||
|
||||
path_trigger_setvieworgang( view )
|
||||
{
|
||||
view.origin = level.player geteye();
|
||||
view.radius = 200;
|
||||
}
|
||||
|
||||
path_dump()
|
||||
{
|
||||
if ( getdvar( "path_dump" ) == "" )
|
||||
return;
|
||||
println( " " );
|
||||
println( " " );
|
||||
println( " " );
|
||||
println( "--------******--------" );
|
||||
// println (" photo source dump (paste these to your level script before maps\_load::main() ) ");
|
||||
println( " path dump " );
|
||||
println( "--------******--------" );
|
||||
println( " " );
|
||||
println( " " );
|
||||
for ( j = 0;j < level.paths_selectid_list.size;j++ )
|
||||
{
|
||||
ident = level.paths_selectid_list[ j ];
|
||||
println( "path ident: " + ident );
|
||||
for ( i = 0;i < level.path_views[ ident ].size;i++ )
|
||||
println( level.path_views[ ident ][ i ].origin + "," + level.path_views[ ident ][ i ].angles );
|
||||
}
|
||||
// todo: [level.path_selectid] list
|
||||
// println ("thread maps\\\_photosource::photosource_init();");
|
||||
for ( j = 0;j < level.paths_selectid_list.size;j++ )
|
||||
{
|
||||
ident = level.paths_selectid_list[ j ];
|
||||
for ( i = 0;i < level.path_views[ ident ].size;i++ )
|
||||
{
|
||||
println( "maps\\\_createpath::path_create(\"" + level.path_views[ ident ][ i ].origin + "," + level.path_views[ ident ][ i ].angles + ");" );
|
||||
}
|
||||
}
|
||||
// println ("thread maps\\\_photosource::photosource_main();");
|
||||
println( " " );
|
||||
println( " " );
|
||||
println( " " );
|
||||
setdvar( "path_dump", "" );
|
||||
|
||||
}
|
||||
|
||||
|
||||
path_help()
|
||||
{
|
||||
if ( getdvar( "path_help" ) == "" )
|
||||
return;
|
||||
println( " " );
|
||||
println( " " );
|
||||
println( "Photo refrenence - Help " );
|
||||
println( " " );
|
||||
println( " photo reference is a tool to help communicate art direction within the level " );
|
||||
println( " An artist or a level designer can run this tool to place images of photo " );
|
||||
println( " source like a gallery throughout the level." );
|
||||
println( " " );
|
||||
println( " before starting do /exec psource.cfg" );
|
||||
println( " " );
|
||||
println( "path_enable ( 7 Key ) - toggles psource on and off" );
|
||||
println( "path_setview ( 8 Key ) - sets the view of the currently selected position." );
|
||||
println( "path_select_prev ( [ Key ) - selects prev psourceposition" );
|
||||
println( "path_select_next ( ] Key ) - selects next psourceposition" );
|
||||
println( "path_select_new ( \\ Key ) - selects NEW psourceposition, used to create a new position on setview" );
|
||||
println( "path_help ( h Key ) - prints to console this help text" );
|
||||
println( "path_dump ( u Key ) - dumps view list to the console to be cut and pasted into script somewhere" );
|
||||
println( "path_delete ( del Key ) - deletes the currently selected view (yellow star in circle)" );
|
||||
println( " " );
|
||||
println( "Pressing the usebutton on a sphere will teleport you so that you can see " );
|
||||
println( "the desired angle of the piece of reference, this also selects the view" );
|
||||
println( "and highlights it yellow" );
|
||||
println( " " );
|
||||
println( "To change the image of the currently selected view go to the console and enter this dvar" );
|
||||
println( "path_image <materialname>" );
|
||||
println( " " );
|
||||
println( "Once you have all your views press the dump button, open your console.log and paste the script to your level script" );
|
||||
setdvar( "path_help", "" );
|
||||
}
|
||||
|
||||
|
||||
path_delete()
|
||||
{
|
||||
if ( getdvar( "path_delete" ) == "" )
|
||||
return;
|
||||
newarray = [];
|
||||
for ( i = 0;i < level.path_views[ level.path_selectid ].size;i++ )
|
||||
if ( i != level.path_selectindex )
|
||||
newarray[ newarray.size ] = level.path_views[ level.path_selectid ][ i ];
|
||||
level.path_views = newarray;
|
||||
flag_set( "path_refresh" );
|
||||
setdvar( "path_delete", "" );
|
||||
}
|
||||
|
||||
path_select_template()
|
||||
{
|
||||
if ( getdvar( "path_select_template" ) == "" )
|
||||
return;
|
||||
setdvar( "path_select_template", "" );
|
||||
}
|
||||
|
||||
path_editmode_update()
|
||||
{
|
||||
if ( getdvar( "path_editmode" ) == "" )
|
||||
return;
|
||||
if ( !level.path_editmode )
|
||||
level.path_editmode = true;
|
||||
else
|
||||
level.path_editmode = false;
|
||||
setdvar( "path_editmode", "" );
|
||||
}
|
||||
|
||||
path_image_update()
|
||||
{
|
||||
if ( getdvar( "path_image" ) == "" )
|
||||
return;
|
||||
view = path_getcurrentview();
|
||||
setdvar( "path_image", "" );
|
||||
}
|
||||
|
||||
path_getcurrentview()
|
||||
{
|
||||
//add trigger stuff here
|
||||
view = undefined;
|
||||
if ( isdefined( level.path_views[ level.path_selectid ] ) && isdefined( level.path_views[ level.path_selectid ][ level.path_selectindex ] ) )
|
||||
view = level.path_views[ level.path_selectindex ][ level.path_selectid ];
|
||||
else
|
||||
view = path_newview( false );
|
||||
return view;
|
||||
}
|
||||
|
||||
path_trigger_newview( bScriptAdded )
|
||||
{
|
||||
view = spawnstruct();
|
||||
if ( !bScriptAdded )
|
||||
path_trigger_setvieworgang( view );
|
||||
if ( isdefined( level.path_triggers[ level.path_selectid ][ level.path_selectindex ] ) )
|
||||
level.path_triggers[ level.path_selectid ][ level.path_selectindex ] delete();
|
||||
level.path_triggers[ level.path_selectid ][ level.path_selectindex ] = view;
|
||||
if ( !bScriptAdded )
|
||||
flag_set( "path_refresh" );
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
path_newview( bScriptAdded )
|
||||
{
|
||||
view = spawnstruct();
|
||||
if ( !bScriptAdded )
|
||||
{
|
||||
path_setvieworgang( view );
|
||||
}
|
||||
if ( isdefined( level.path_views[ level.path_selectid ][ level.path_selectindex ] ) )
|
||||
level.path_views[ level.path_selectid ][ level.path_selectindex ] delete();
|
||||
level.path_views[ level.path_selectid ][ level.path_selectindex ] = view;
|
||||
if ( !bScriptAdded )
|
||||
flag_set( "path_refresh" );
|
||||
return view;
|
||||
}
|
||||
|
||||
path_createid( ident )
|
||||
{
|
||||
if ( !isdefined( level.paths_selectid_list ) )
|
||||
level.paths_selectid_list = [];
|
||||
for ( i = 0;i < level.paths_selectid_list.size;i++ )
|
||||
{
|
||||
if ( ident == level.paths_selectid_list[ i ] )
|
||||
return ident;
|
||||
}
|
||||
level.paths_selectid_list[ level.paths_selectid_list.size ] = ident;
|
||||
return ident;
|
||||
}
|
||||
|
||||
//use this in level file to initialize all the stuff.
|
||||
path_create( position, angle, ident )
|
||||
{
|
||||
/#
|
||||
if ( !isdefined( ident ) )
|
||||
ident = "default";
|
||||
level.path_selectid = path_createid( ident );
|
||||
if ( !isdefined( level.flag ) )
|
||||
level.flag = [];
|
||||
if ( !isdefined( level.flag[ "path_Notviewing" ] ) )
|
||||
init();
|
||||
if ( !isdefined( level.path_selectindex ) )
|
||||
level.path_selectindex = 0;
|
||||
if ( !isdefined( level.path_views ) )
|
||||
level.path_views = [];
|
||||
if ( !isdefined( level.path_views[ level.path_selectid ] ) )
|
||||
level.path_views[ level.path_selectid ] = [];
|
||||
view = path_newview( true );
|
||||
view.origin = position;
|
||||
view.angles = angle;
|
||||
level.path_selectindex++ ;
|
||||
#/
|
||||
}
|
||||
|
||||
path_trigger_create( position, radius, ident )
|
||||
{
|
||||
/#
|
||||
if ( !isdefined( ident ) )
|
||||
ident = "default";
|
||||
level.path_selectid = path_createid( ident );
|
||||
if ( !isdefined( level.flag ) )
|
||||
level.flag = [];
|
||||
if ( !isdefined( level.flag[ "path_Notviewing" ] ) )
|
||||
init();
|
||||
if ( !isdefined( level.path_selectindex ) )
|
||||
level.path_selectindex = 0;
|
||||
if ( !isdefined( level.path_triggers ) )
|
||||
level.path_triggers = [];
|
||||
if ( !isdefined( level.path_triggers[ level.path_selectid ] ) )
|
||||
level.path_triggers[ level.path_selectid ] = [];
|
||||
view = path_trigger_newview( true );
|
||||
view.origin = position;
|
||||
view.angles = angle;
|
||||
level.path_selectindex++ ;
|
||||
#/
|
||||
}
|
||||
|
||||
islookingorg( view )
|
||||
{
|
||||
normalvec = vectorNormalize( view.origin - self geteye() );
|
||||
veccomp = vectorNormalize( ( view.origin - ( 0, 0, level.path_selectrad * 2 ) ) - self geteye() );
|
||||
insidedot = vectordot( normalvec, veccomp );
|
||||
|
||||
anglevec = anglestoforward( self getplayerangles() );
|
||||
vectordot = vectordot( anglevec, normalvec );
|
||||
if ( vectordot > insidedot )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
+2262
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,81 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
#include maps\_debug;
|
||||
#include maps\_hud_util;
|
||||
init()
|
||||
{
|
||||
precacheShader( "damage_feedback" );
|
||||
|
||||
if ( getDvar( "scr_damagefeedback" ) == "" )
|
||||
setDvar( "scr_damagefeedback", "0" );
|
||||
|
||||
if ( !getDvarInt( "scr_damagefeedback", 0 ) )
|
||||
return;
|
||||
|
||||
array_thread( level.players, ::init_damage_feedback );
|
||||
array_thread( level.players, ::monitorDamage );
|
||||
}
|
||||
|
||||
init_damage_feedback()
|
||||
{
|
||||
self.hud_damagefeedback = newClientHudElem( self );
|
||||
self.hud_damagefeedback.alignX = "center";
|
||||
self.hud_damagefeedback.alignY = "middle";
|
||||
self.hud_damagefeedback.horzAlign = "center";
|
||||
self.hud_damagefeedback.vertAlign = "middle";
|
||||
self.hud_damagefeedback.alpha = 0;
|
||||
self.hud_damagefeedback.archived = true;
|
||||
self.hud_damagefeedback setShader( "damage_feedback", 24, 24 * 2 );
|
||||
self.hud_damagefeedback.y = 12; // aligns it to the center of the crosshair.
|
||||
}
|
||||
|
||||
monitorDamage()
|
||||
{
|
||||
if ( !getDvarInt( "scr_damagefeedback", 0 ) )
|
||||
return;
|
||||
|
||||
self add_damage_function( ::damagefeedback_took_damage );
|
||||
}
|
||||
|
||||
damagefeedback_took_damage( damage, attacker, direction_vec, point, type, modelName, tagName )
|
||||
{
|
||||
if ( !isplayer( attacker ) )
|
||||
return;
|
||||
if ( isdefined( self.bullet_resistance ) )
|
||||
{
|
||||
legal_bullet_types = [];
|
||||
legal_bullet_types[ "MOD_PISTOL_BULLET" ] = true;
|
||||
legal_bullet_types[ "MOD_RIFLE_BULLET" ] = true;
|
||||
|
||||
if ( isdefined( legal_bullet_types[ type ] ) )
|
||||
{
|
||||
if ( damage <= self.bullet_resistance )
|
||||
return;
|
||||
}
|
||||
}
|
||||
attacker updateDamageFeedback( self );
|
||||
}
|
||||
|
||||
updateDamageFeedback( attacked )
|
||||
{
|
||||
if ( !isPlayer( self ) )
|
||||
return;
|
||||
if ( !isdefined( attacked.team ) )
|
||||
return;
|
||||
if ( ( attacked.team == self.team ) || ( attacked.team == "neutral" ) )
|
||||
return;
|
||||
self playlocalsound( "SP_hit_alert" );
|
||||
|
||||
fadeTime = 1; //fade out crosshair damage indicator over this time
|
||||
|
||||
//If in slomo, fade out damage indicator faster (the value entered for the slomo time fraction
|
||||
if ( isdefined( level.slowmo.speed_slow ) )
|
||||
fadeTime = level.slowmo.speed_slow;
|
||||
|
||||
self.hud_damagefeedback.alpha = 1;
|
||||
self.hud_damagefeedback fadeOverTime( fadeTime );
|
||||
self.hud_damagefeedback.alpha = 0;
|
||||
|
||||
offset = getdvarfloat( "cg_crosshairVerticalOffset" ) * 240;
|
||||
self.hud_damagefeedback.y = 12 - int( offset );
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
level.scr_anim[ "dead_guy" ][ "death1" ] = %exposed_death_nerve;
|
||||
level.scr_anim[ "dead_guy" ][ "death2" ] = %exposed_death_falltoknees;
|
||||
level.scr_anim[ "dead_guy" ][ "death3" ] = %exposed_death_headtwist;
|
||||
level.scr_anim[ "dead_guy" ][ "death4" ] = %exposed_crouch_death_twist;
|
||||
level.scr_anim[ "dead_guy" ][ "death5" ] = %exposed_crouch_death_fetal;
|
||||
level.scr_anim[ "dead_guy" ][ "death6" ] = %death_sitting_pose_v1;
|
||||
level.scr_anim[ "dead_guy" ][ "death7" ] = %death_sitting_pose_v2;
|
||||
level.scr_anim[ "dead_guy" ][ "death8" ] = %death_pose_on_desk;
|
||||
level.scr_anim[ "dead_guy" ][ "death9" ] = %death_pose_on_window;
|
||||
level.scr_animtree[ "dead_guy" ] = #animtree;
|
||||
|
||||
level.dead_body_count = 1;
|
||||
|
||||
// 6 corpses are retained after savegame load, so make sure
|
||||
// we have room to simulate all corpses plus our deadbody counts
|
||||
maxSim = getdvarint( "ragdoll_max_simulating" ) - 6;
|
||||
|
||||
if ( maxSim > 0 )
|
||||
level.max_number_of_dead_bodies = maxSim;
|
||||
else
|
||||
level.max_number_of_dead_bodies = 0;
|
||||
|
||||
struct = spawnstruct();
|
||||
struct.bodies = [];
|
||||
|
||||
// triggers can spawn bodies
|
||||
run_thread_on_targetname( "trigger_body", ::trigger_body, struct );
|
||||
|
||||
// spawn preplaced bodies with no trigger
|
||||
run_thread_on_targetname( "dead_body", ::spawn_dead_body, struct );
|
||||
}
|
||||
|
||||
trigger_body( struct )
|
||||
{
|
||||
self waittill( "trigger" );
|
||||
targets = getentarray( self.target, "targetname" );
|
||||
array_thread( targets, ::spawn_dead_body, struct );
|
||||
}
|
||||
|
||||
spawn_dead_body( struct )
|
||||
{
|
||||
if ( !getdvarint( "ragdoll_enable" ) && isdefined( self.script_parameters ) && self.script_parameters == "require_ragdoll" )
|
||||
return;
|
||||
|
||||
if ( level.max_number_of_dead_bodies == 0 )
|
||||
return;
|
||||
|
||||
index = undefined;
|
||||
if ( isdefined( self.script_index ) )
|
||||
{
|
||||
index = self.script_index;
|
||||
}
|
||||
else
|
||||
{
|
||||
level.dead_body_count++ ;
|
||||
if ( level.dead_body_count > 3 )
|
||||
level.dead_body_count = 1;
|
||||
index = level.dead_body_count;
|
||||
}
|
||||
|
||||
model = spawn( "script_model", ( 0, 0, 0 ) );
|
||||
model.origin = self.origin;
|
||||
model.angles = self.angles;
|
||||
model.animname = "dead_guy";
|
||||
model assign_animtree();
|
||||
|
||||
struct que_body( model );
|
||||
|
||||
model [[ level.scr_deadbody[ index ] ]]();
|
||||
|
||||
assertex( isdefined( self.script_noteworthy ), "Dead guy needs script_noteworthy death1 through 5" );
|
||||
|
||||
if ( !isdefined( self.script_trace ) )
|
||||
{
|
||||
trace = bullettrace( model.origin + ( 0, 0, 5 ), model.origin + ( 0, 0, -64 ), false, undefined );
|
||||
model.origin = trace[ "position" ];
|
||||
}
|
||||
|
||||
model setflaggedanim( "flag", model getanim( self.script_noteworthy ), 1, 0, 1 );
|
||||
model waittillmatch( "flag", "end" );
|
||||
|
||||
if ( !isdefined( self.script_start ) )
|
||||
model startragdoll();
|
||||
}
|
||||
|
||||
que_body( model )
|
||||
{
|
||||
self.bodies[ self.bodies.size ] = model;
|
||||
if ( self.bodies.size <= level.max_number_of_dead_bodies )
|
||||
return;
|
||||
self.bodies[ 0 ] delete();
|
||||
self.bodies = array_removeUndefined( self.bodies );
|
||||
}
|
||||
+3065
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,627 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
|
||||
init()
|
||||
{
|
||||
level._effect[ "c4_light_blink" ] = loadfx( "misc/light_c4_blink" );
|
||||
level._effect[ "claymore_laser" ] = loadfx( "misc/claymore_laser" );
|
||||
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
level.players[ i ] thread watchGrenadeUsage();
|
||||
}
|
||||
}
|
||||
|
||||
watchGrenadeUsage()
|
||||
{
|
||||
level.c4explodethisframe = false;
|
||||
self endon( "death" );
|
||||
self.c4array = [];
|
||||
self.throwingGrenade = false;
|
||||
|
||||
thread watchC4();
|
||||
thread watchC4Detonation();
|
||||
thread watchC4AltDetonation();
|
||||
thread watchClaymores();
|
||||
thread begin_semtex_grenade_tracking();
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "grenade_pullback", weaponName );
|
||||
self.throwingGrenade = true;
|
||||
|
||||
if ( weaponName == "c4" )
|
||||
self beginC4Tracking();
|
||||
else if ( weaponName == "smoke_grenade_american" )
|
||||
self beginsmokegrenadetracking();
|
||||
//else if ( weaponName == "semtex_grenade" )
|
||||
// self beginsemtexgrenadetracking();
|
||||
else
|
||||
self beginGrenadeTracking();
|
||||
}
|
||||
}
|
||||
|
||||
beginsmokegrenadetracking()
|
||||
{
|
||||
self waittill( "grenade_fire", grenade, weaponName );
|
||||
if ( !isdefined( level.smokegrenades ) )
|
||||
level.smokegrenades = 0;
|
||||
if ( level.smokegrenades > 2 && getdvar( "player_sustainAmmo" ) != "0" )
|
||||
grenade delete();
|
||||
else
|
||||
grenade thread smoke_grenade_death();
|
||||
}
|
||||
|
||||
begin_semtex_grenade_tracking()
|
||||
{
|
||||
while( 1 )
|
||||
{
|
||||
self waittill( "grenade_fire", grenade, weaponName );
|
||||
if ( weaponName == "semtex_grenade" )
|
||||
{
|
||||
thread track_semtex_grenade( grenade );
|
||||
grenade thread semtex_sticky_handle( self );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
track_semtex_grenade( grenade )
|
||||
{
|
||||
self.throwingGrenade = false;
|
||||
|
||||
if( !isdefined( level.thrown_semtex_grenades ) )
|
||||
level.thrown_semtex_grenades = 1;
|
||||
else
|
||||
level.thrown_semtex_grenades++;
|
||||
|
||||
grenade waittill ( "death" );
|
||||
|
||||
waittillframeend;
|
||||
level.thrown_semtex_grenades--;
|
||||
}
|
||||
|
||||
semtex_sticky_handle( attacker )
|
||||
{
|
||||
self waittill ("missile_stuck", entity );
|
||||
|
||||
if( !isdefined( entity ) )
|
||||
return;
|
||||
|
||||
// just handling vehicles for now.
|
||||
if( entity.code_classname != "script_vehicle" )
|
||||
return;
|
||||
|
||||
entity.has_semtex_on_it = true;
|
||||
|
||||
self waittill ( "explode" );
|
||||
|
||||
if( !isdefined( entity ) || !isalive( entity ) )
|
||||
return; // possible it could be dead at this point
|
||||
|
||||
if(
|
||||
entity maps\_vehicle::is_godmode()
|
||||
|| entity maps\_vehicle::attacker_isonmyteam( attacker )
|
||||
)
|
||||
{
|
||||
entity.has_semtex_on_it = undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
entity kill( entity.origin, attacker );
|
||||
|
||||
}
|
||||
|
||||
smoke_grenade_death()
|
||||
{
|
||||
level.smokegrenades++ ;
|
||||
wait 50;
|
||||
level.smokegrenades -- ;
|
||||
}
|
||||
|
||||
beginGrenadeTracking()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
self waittill( "grenade_fire", grenade, weaponName );
|
||||
if ( weaponName == "fraggrenade" )
|
||||
grenade thread grenade_earthQuake();
|
||||
|
||||
self.throwingGrenade = false;
|
||||
}
|
||||
|
||||
|
||||
beginC4Tracking()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
self waittill_any( "grenade_fire", "weapon_change" );
|
||||
self.throwingGrenade = false;
|
||||
}
|
||||
|
||||
|
||||
watchC4()
|
||||
{
|
||||
//maxc4 = 2;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
self waittill( "grenade_fire", c4, weapname );
|
||||
if ( weapname == "c4" )
|
||||
{
|
||||
if ( !self.c4array.size )
|
||||
self thread watchC4AltDetonate();
|
||||
|
||||
/*if ( self.c4array.size >= maxc4 )
|
||||
{
|
||||
newarray = [];
|
||||
for ( i = 0; i < self.c4array.size; i++ )
|
||||
{
|
||||
if ( isdefined(self.c4array[i]) )
|
||||
newarray[newarray.size] = self.c4array[i];
|
||||
}
|
||||
self.c4array = newarray;
|
||||
for ( i = 0; i < self.c4array.size - maxc4 + 1; i++ )
|
||||
{
|
||||
self.c4array[i] delete();
|
||||
}
|
||||
newarray = [];
|
||||
for ( i = 0; i < maxc4 - 1; i++ )
|
||||
{
|
||||
newarray[i] = self.c4array[self.c4array.size - maxc4 + 1 + i];
|
||||
}
|
||||
self.c4array = newarray;
|
||||
}*/
|
||||
|
||||
self.c4array[ self.c4array.size ] = c4;
|
||||
if ( self.c4array.size > 15 && getdvar( "player_sustainAmmo" ) != "0" )
|
||||
self.c4array[ 0 ] delete();
|
||||
c4.owner = self;
|
||||
// c4 thread maps\mp\gametypes\_shellshock::c4_earthQuake();
|
||||
c4 thread c4Damage();
|
||||
self thread c4death( c4 );
|
||||
c4 thread playC4Effects();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c4death( c4 )
|
||||
{
|
||||
// this allows me to delete the first one thrown and reconstruct the array for cheats that enable all the ammo. - Nate
|
||||
c4 waittill( "death" );
|
||||
self.c4array = array_remove_nokeys( self.c4array, c4 );
|
||||
}
|
||||
|
||||
watchClaymores()
|
||||
{
|
||||
self endon( "spawned_player" );
|
||||
self endon( "disconnect" );
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
self waittill( "grenade_fire", claymore, weapname );
|
||||
if ( weapname == "claymore" || weapname == "claymore_mp" )
|
||||
{
|
||||
claymore.owner = self;
|
||||
claymore thread c4Damage();
|
||||
claymore thread claymoreDetonation();
|
||||
claymore thread playClaymoreEffects();
|
||||
claymore thread claymoreMakeSentient( self.team );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
claymoreMakeSentient( team )
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
wait 1; // let claymore planting animation finish, and settle
|
||||
|
||||
self MakeEntitySentient( team, true );
|
||||
self.attackerAccuracy = 2;
|
||||
self.maxVisibleDist = 750;
|
||||
self.threatBias = -1000;
|
||||
}
|
||||
|
||||
claymoreDetonation()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
// wait until we settle
|
||||
self waittill( "missile_stuck" );
|
||||
|
||||
detonateRadius = 192;// matches MP
|
||||
|
||||
damagearea = spawn( "trigger_radius", self.origin + ( 0, 0, 0 - detonateRadius ), 9, detonateRadius, detonateRadius * 2 );
|
||||
|
||||
self thread deleteOnDeath( damagearea );
|
||||
|
||||
if ( !isdefined( level.claymores ) )
|
||||
level.claymores = [];
|
||||
level.claymores = array_add( level.claymores, self );
|
||||
|
||||
// limit the number of active claymores
|
||||
if ( !is_specialop() && level.claymores.size > 15 )
|
||||
{
|
||||
level.claymores[ 0 ] delete();
|
||||
}
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
damagearea waittill( "trigger", ent );
|
||||
|
||||
if ( isdefined( self.owner ) && ent == self.owner )
|
||||
continue;
|
||||
|
||||
if ( isplayer( ent ) )
|
||||
continue;// no enemy claymores in SP.
|
||||
|
||||
if ( ent damageConeTrace( self.origin, self ) > 0 )
|
||||
{
|
||||
self playsound( "claymore_activated_SP" );
|
||||
wait 0.4;
|
||||
if ( isdefined( self.owner ) )
|
||||
self detonate( self.owner );
|
||||
else
|
||||
self detonate( undefined );
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deleteOnDeath( ent )
|
||||
{
|
||||
self waittill( "death" );
|
||||
// stupid getarraykeys in array_remove reversing the order - nate
|
||||
level.claymores = array_remove_nokeys( level.claymores, self );
|
||||
wait .05;
|
||||
if ( isdefined( ent ) )
|
||||
ent delete();
|
||||
}
|
||||
|
||||
watchC4Detonation()
|
||||
{
|
||||
self endon( "death" );
|
||||
while ( 1 )
|
||||
{
|
||||
self waittill( "detonate" );
|
||||
weap = self getCurrentWeapon();
|
||||
if ( weap == "c4" )
|
||||
{
|
||||
for ( i = 0; i < self.c4array.size; i++ )
|
||||
{
|
||||
if ( isdefined( self.c4array[ i ] ) )
|
||||
self.c4array[ i ] thread waitAndDetonate( 0.1 );
|
||||
}
|
||||
self.c4array = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watchC4AltDetonation()
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "disconnect" );
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
self waittill( "alt_detonate" );
|
||||
weap = self getCurrentWeapon();
|
||||
if ( weap != "c4" )
|
||||
{
|
||||
newarray = [];
|
||||
for ( i = 0; i < self.c4array.size; i++ )
|
||||
{
|
||||
c4 = self.c4array[ i ];
|
||||
if ( isdefined( self.c4array[ i ] ) )
|
||||
c4 thread waitAndDetonate( 0.1 );
|
||||
}
|
||||
self.c4array = newarray;
|
||||
self notify( "detonated" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
waitAndDetonate( delay )
|
||||
{
|
||||
self endon( "death" );
|
||||
wait delay;
|
||||
|
||||
self detonate();
|
||||
}
|
||||
|
||||
|
||||
c4Damage()
|
||||
{
|
||||
// self endon( "death" );
|
||||
|
||||
self.health = 100;
|
||||
self setcandamage( true );
|
||||
self.maxhealth = 100000;
|
||||
self.health = self.maxhealth;
|
||||
|
||||
attacker = undefined;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
self waittill( "damage", amount, attacker );
|
||||
|
||||
// don't allow people to destroy C4 on their team if FF is off
|
||||
// if ( !friendlyFireCheck(self.owner, attacker) )
|
||||
// continue;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
self playsound( "claymore_activated_SP" );
|
||||
|
||||
if ( level.c4explodethisframe )
|
||||
wait .1 + randomfloat( .4 );
|
||||
else
|
||||
wait .05;
|
||||
|
||||
if ( !isdefined( self ) )
|
||||
return;
|
||||
|
||||
level.c4explodethisframe = true;
|
||||
|
||||
thread resetC4ExplodeThisFrame();
|
||||
|
||||
if ( isplayer( attacker ) )
|
||||
self detonate( attacker );
|
||||
else
|
||||
self detonate();
|
||||
// won't get here; got death notify.
|
||||
}
|
||||
|
||||
resetC4ExplodeThisFrame()
|
||||
{
|
||||
wait .05;
|
||||
level.c4explodethisframe = false;
|
||||
}
|
||||
|
||||
saydamaged( orig, amount )
|
||||
{
|
||||
for ( i = 0; i < 60; i++ )
|
||||
{
|
||||
print3d( orig, "damaged! " + amount );
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
playC4Effects()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
self waittill( "missile_stuck" );
|
||||
|
||||
PlayFXOnTag( getfx( "c4_light_blink" ), self, "tag_fx" );
|
||||
}
|
||||
|
||||
playClaymoreEffects()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
self waittill( "missile_stuck" );
|
||||
|
||||
PlayFXOnTag( getfx( "claymore_laser" ), self, "tag_fx" );
|
||||
}
|
||||
|
||||
clearFXOnDeath( fx )
|
||||
{
|
||||
self waittill( "death" );
|
||||
fx delete();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// these functions are used with scripted weapons (like c4, claymores, artillery)
|
||||
// returns an array of objects representing damageable entities (including players) within a given sphere.
|
||||
// each object has the property damageCenter, which represents its center (the location from which it can be damaged).
|
||||
// each object also has the property entity, which contains the entity that it represents.
|
||||
// to damage it, call damageEnt() on it.
|
||||
getDamageableEnts( pos, radius, doLOS, startRadius )
|
||||
{
|
||||
ents = [];
|
||||
|
||||
if ( !isdefined( doLOS ) )
|
||||
doLOS = false;
|
||||
|
||||
if ( !isdefined( startRadius ) )
|
||||
startRadius = 0;
|
||||
|
||||
// players
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
if ( !isalive( level.players[ i ] ) || level.players[ i ].sessionstate != "playing" )
|
||||
continue;
|
||||
|
||||
playerpos = level.players[ i ].origin + ( 0, 0, 32 );
|
||||
dist = distance( pos, playerpos );
|
||||
if ( dist < radius && ( !doLOS || weaponDamageTracePassed( pos, playerpos, startRadius, undefined ) ) )
|
||||
{
|
||||
newent = spawnstruct();
|
||||
newent.isPlayer = true;
|
||||
newent.isADestructable = false;
|
||||
newent.entity = level.players[ i ];
|
||||
newent.damageCenter = playerpos;
|
||||
ents[ ents.size ] = newent;
|
||||
}
|
||||
}
|
||||
|
||||
// grenades
|
||||
grenades = getentarray( "grenade", "classname" );
|
||||
for ( i = 0; i < grenades.size; i++ )
|
||||
{
|
||||
entpos = grenades[ i ].origin;
|
||||
dist = distance( pos, entpos );
|
||||
if ( dist < radius && ( !doLOS || weaponDamageTracePassed( pos, entpos, startRadius, grenades[ i ] ) ) )
|
||||
{
|
||||
newent = spawnstruct();
|
||||
newent.isPlayer = false;
|
||||
newent.isADestructable = false;
|
||||
newent.entity = grenades[ i ];
|
||||
newent.damageCenter = entpos;
|
||||
ents[ ents.size ] = newent;
|
||||
}
|
||||
}
|
||||
|
||||
destructables = getentarray( "destructable", "targetname" );
|
||||
for ( i = 0; i < destructables.size; i++ )
|
||||
{
|
||||
entpos = destructables[ i ].origin;
|
||||
dist = distance( pos, entpos );
|
||||
if ( dist < radius && ( !doLOS || weaponDamageTracePassed( pos, entpos, startRadius, destructables[ i ] ) ) )
|
||||
{
|
||||
newent = spawnstruct();
|
||||
newent.isPlayer = false;
|
||||
newent.isADestructable = true;
|
||||
newent.entity = destructables[ i ];
|
||||
newent.damageCenter = entpos;
|
||||
ents[ ents.size ] = newent;
|
||||
}
|
||||
}
|
||||
|
||||
return ents;
|
||||
}
|
||||
|
||||
weaponDamageTracePassed( from, to, startRadius, ignore )
|
||||
{
|
||||
midpos = undefined;
|
||||
|
||||
diff = to - from;
|
||||
if ( lengthsquared( diff ) < startRadius * startRadius )
|
||||
midpos = to;
|
||||
dir = vectornormalize( diff );
|
||||
midpos = from + ( dir[ 0 ] * startRadius, dir[ 1 ] * startRadius, dir[ 2 ] * startRadius );
|
||||
|
||||
trace = bullettrace( midpos, to, false, ignore );
|
||||
|
||||
if ( getdvarint( "scr_damage_debug" ) != 0 )
|
||||
{
|
||||
if ( trace[ "fraction" ] == 1 )
|
||||
{
|
||||
thread debugline( midpos, to, ( 1, 1, 1 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
thread debugline( midpos, trace[ "position" ], ( 1, .9, .8 ) );
|
||||
thread debugline( trace[ "position" ], to, ( 1, .4, .3 ) );
|
||||
}
|
||||
}
|
||||
|
||||
return( trace[ "fraction" ] == 1 );
|
||||
}
|
||||
|
||||
// eInflictor = the entity that causes the damage (e.g. a claymore)
|
||||
// eAttacker = the player that is attacking
|
||||
// iDamage = the amount of damage to do
|
||||
// sMeansOfDeath = string specifying the method of death (e.g. "MOD_PROJECTILE_SPLASH")
|
||||
// sWeapon = string specifying the weapon used (e.g. "claymore_mp")
|
||||
// damagepos = the position damage is coming from
|
||||
// damagedir = the direction damage is moving in
|
||||
damageEnt( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, damagepos, damagedir )
|
||||
{
|
||||
if ( self.isPlayer )
|
||||
{
|
||||
self.damageOrigin = damagepos;
|
||||
self.entity thread [[ level.callbackPlayerDamage ]](
|
||||
eInflictor,// eInflictor The entity that causes the damage.( e.g. a turret )
|
||||
eAttacker,// eAttacker The entity that is attacking.
|
||||
iDamage,// iDamage Integer specifying the amount of damage done
|
||||
0,// iDFlags Integer specifying flags that are to be applied to the damage
|
||||
sMeansOfDeath,// sMeansOfDeath Integer specifying the method of death
|
||||
sWeapon,// sWeapon The weapon number of the weapon used to inflict the damage
|
||||
damagepos,// vPoint The point the damage is from?
|
||||
damagedir,// vDir The direction of the damage
|
||||
"none",// sHitLoc The location of the hit
|
||||
0// psOffsetTime The time offset for the damage
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// destructable walls and such can only be damaged in certain ways.
|
||||
if ( self.isADestructable && ( sWeapon == "artillery_mp" || sWeapon == "claymore_mp" ) )
|
||||
return;
|
||||
|
||||
self.entity notify( "damage", iDamage, eAttacker );
|
||||
}
|
||||
}
|
||||
|
||||
debugline( a, b, color )
|
||||
{
|
||||
for ( i = 0; i < 30 * 20; i++ )
|
||||
{
|
||||
line( a, b, color );
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onWeaponDamage( eInflictor, sWeapon, meansOfDeath, damage )
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
switch( sWeapon )
|
||||
{
|
||||
case "concussion_grenade_mp":
|
||||
// should match weapon settings in gdt
|
||||
radius = 512;
|
||||
scale = 1 - ( distance( self.origin, eInflictor.origin ) / radius );
|
||||
|
||||
time = 1 + ( 4 * scale );
|
||||
|
||||
wait( 0.05 );
|
||||
self shellShock( "concussion_grenade_mp", time );
|
||||
break;
|
||||
default:
|
||||
// shellshock will only be done if meansofdeath is an appropriate type and if there is enough damage.
|
||||
// maps\mp\gametypes\_shellshock::shellshockOnDamage( meansOfDeath, damage );
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
watchC4AltDetonate()
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "disconnect" );
|
||||
self endon( "detonated" );
|
||||
level endon( "game_ended" );
|
||||
|
||||
buttonTime = 0;
|
||||
for ( ;; )
|
||||
{
|
||||
if ( self UseButtonPressed() )
|
||||
{
|
||||
buttonTime = 0;
|
||||
while ( self UseButtonPressed() )
|
||||
{
|
||||
buttonTime += 0.05;
|
||||
wait( 0.05 );
|
||||
}
|
||||
|
||||
println( "pressTime1: " + buttonTime );
|
||||
if ( buttonTime >= 0.5 )
|
||||
continue;
|
||||
|
||||
buttonTime = 0;
|
||||
while ( !self UseButtonPressed() && buttonTime < 0.5 )
|
||||
{
|
||||
buttonTime += 0.05;
|
||||
wait( 0.05 );
|
||||
}
|
||||
|
||||
println( "delayTime: " + buttonTime );
|
||||
if ( buttonTime >= 0.5 )
|
||||
continue;
|
||||
|
||||
if ( !self.c4Array.size )
|
||||
return;
|
||||
|
||||
self notify( "alt_detonate" );
|
||||
}
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
- each trigger_use has the same target name
|
||||
trigger_use must have origin brush or it will be usable even if activate_notify is set
|
||||
also needs that so the use icon goes away after use
|
||||
- each trigger_use targets the script_model of the documents
|
||||
- add script call, example script call:
|
||||
thread maps\_documents::main(1, "Capture the enemy documents", "documents_triggers");
|
||||
The "objective_number" parameter is the number of this objective,
|
||||
the "array_targetname" parameter is the target name of the trigger_use(s)
|
||||
The "activate_notify" parameter is the notify the bombs wait for before becoming usable
|
||||
*/
|
||||
|
||||
|
||||
main( objective_number, objective_text, array_targetname, activate_notify )
|
||||
{
|
||||
documents = getentarray( array_targetname, "targetname" );
|
||||
println( array_targetname, " documents.size: ", documents.size );
|
||||
|
||||
for ( i = 0;i < documents.size;i++ )
|
||||
{
|
||||
documents[ i ].document = getent( documents[ i ].target, "targetname" );
|
||||
documents[ i ].used = 0;
|
||||
documents[ i ] thread document_think( activate_notify, array_targetname );
|
||||
}
|
||||
|
||||
if ( documents.size != 0 )
|
||||
{
|
||||
remaining_documents = documents.size;
|
||||
//obj_text = (objective_text1 + remaining_documents + objective_text2);
|
||||
|
||||
closest = get_closest_document( documents );
|
||||
if ( isdefined( closest ) )
|
||||
{
|
||||
objective_add( objective_number, "active", objective_text, ( closest.document.origin ) );
|
||||
objective_string( objective_number, objective_text, remaining_documents );
|
||||
}
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
level waittill( array_targetname + " gotten" );
|
||||
|
||||
remaining_documents -- ;
|
||||
objective_string( objective_number, objective_text, remaining_documents );
|
||||
|
||||
closest = get_closest_document( documents );
|
||||
if ( isdefined( closest ) )
|
||||
{
|
||||
objective_position( objective_number, ( closest.document.origin ) );
|
||||
objective_ring( objective_number );
|
||||
}
|
||||
else
|
||||
{
|
||||
objective_state( objective_number, "done" );
|
||||
temp = ( "objective_complete" + objective_number );
|
||||
println( temp );
|
||||
level notify( temp );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get_closest_document( array )
|
||||
{
|
||||
range = 500000000;
|
||||
ent = undefined;
|
||||
for ( i = 0;i < array.size;i++ )
|
||||
{
|
||||
if ( !array[ i ].used )
|
||||
{
|
||||
newrange = distance( level.player getorigin(), array[ i ].document.origin );
|
||||
if ( newrange < range )
|
||||
{
|
||||
range = newrange;
|
||||
ent = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( isdefined( ent ) )
|
||||
return array[ ent ];
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
document_think( activate_notify, array_targetname )
|
||||
{
|
||||
// println ("waittill trigger");
|
||||
|
||||
// Press &&1 to pick up the documents.
|
||||
self setHintString( &"SCRIPT_PLATFORM_HINTSTR_DOCUMENTS" );
|
||||
|
||||
if ( isdefined( activate_notify ) )
|
||||
{
|
||||
self maps\_utility::trigger_off();
|
||||
self.document hide();
|
||||
|
||||
level waittill( activate_notify );
|
||||
|
||||
self.document show();
|
||||
self maps\_utility::trigger_off();
|
||||
}
|
||||
self waittill( "trigger" );
|
||||
println( "triggered" );
|
||||
//self.document playsound ("paper_pickup");
|
||||
level thread play_sound_in_space( "paper_pickup", self.document.origin );
|
||||
|
||||
self.used = 1;
|
||||
self.document hide();
|
||||
level notify( array_targetname + " gotten" );
|
||||
// self playsound ("explo_plant_rand");
|
||||
self maps\_utility::trigger_off();
|
||||
}
|
||||
+920
@@ -0,0 +1,920 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
DRONE_RUN_SPEED = 170;
|
||||
TRACE_HEIGHT = 100;
|
||||
MAX_DRONES_ALLIES = 99999;
|
||||
MAX_DRONES_AXIS = 99999;
|
||||
MAX_DRONES_TEAM3 = 99999;
|
||||
MAX_DRONES_CIVILIAN = 99999;
|
||||
DEATH_DELETE_FOV = 0.5; // cos(60)
|
||||
|
||||
initGlobals()
|
||||
{
|
||||
//############################################################################
|
||||
//############################################################################
|
||||
// NEVER CALL THIS FUNCTION MANUALLY, THIS IS MEANT TO BE CALLED INTERNALLY!!!
|
||||
// NEVER CALL THIS FUNCTION MANUALLY, THIS IS MEANT TO BE CALLED INTERNALLY!!!
|
||||
// NEVER CALL THIS FUNCTION MANUALLY, THIS IS MEANT TO BE CALLED INTERNALLY!!!
|
||||
//############################################################################
|
||||
//############################################################################
|
||||
|
||||
if ( getdvar( "debug_drones" ) == "" )
|
||||
setdvar( "debug_drones", "0" );
|
||||
|
||||
assert( isdefined( level.drone_anims ) );
|
||||
|
||||
// lookahead value - how far the character will lookahead for movement direction
|
||||
// larger number makes smother, more linear travel. small value makes character go almost exactly point to point
|
||||
if ( !isdefined( level.lookAhead_value ) )
|
||||
level.drone_lookAhead_value = 200;
|
||||
|
||||
if ( !isdefined( level.max_drones ) )
|
||||
level.max_drones = [];
|
||||
if ( !isdefined( level.max_drones[ "allies" ] ) )
|
||||
level.max_drones[ "allies" ] = MAX_DRONES_ALLIES;
|
||||
if ( !isdefined( level.max_drones[ "axis" ] ) )
|
||||
level.max_drones[ "axis" ] = MAX_DRONES_AXIS;
|
||||
if ( !isdefined( level.max_drones[ "team3" ] ) )
|
||||
level.max_drones[ "team3" ] = MAX_DRONES_TEAM3;
|
||||
if ( !isdefined( level.max_drones[ "neutral" ] ) )
|
||||
level.max_drones[ "neutral" ] = MAX_DRONES_CIVILIAN;
|
||||
|
||||
if ( !isdefined( level.drones ) )
|
||||
level.drones = [];
|
||||
if ( !isdefined( level.drones[ "allies" ] ) )
|
||||
level.drones[ "allies" ] = struct_arrayspawn();
|
||||
if ( !isdefined( level.drones[ "axis" ] ) )
|
||||
level.drones[ "axis" ] = struct_arrayspawn();
|
||||
if ( !isdefined( level.drones[ "team3" ] ) )
|
||||
level.drones[ "team3" ] = struct_arrayspawn();
|
||||
if ( !isdefined( level.drones[ "neutral" ] ) )
|
||||
level.drones[ "neutral" ] = struct_arrayspawn();
|
||||
|
||||
level.drone_spawn_func = ::drone_init;
|
||||
}
|
||||
|
||||
drone_give_soul()
|
||||
{
|
||||
|
||||
// Tell drone which animtree to use
|
||||
self useAnimTree( #animtree );
|
||||
|
||||
// Tell drone to use hero-only lighting so they look like AI
|
||||
self startUsingHeroOnlyLighting();
|
||||
|
||||
if ( isdefined( self.script_moveplaybackrate ) )
|
||||
self.moveplaybackrate = self.script_moveplaybackrate;
|
||||
else
|
||||
self.moveplaybackrate = 1;
|
||||
|
||||
// Put a friendly name on the drone so they look like AI
|
||||
if ( self.team == "allies" )
|
||||
{
|
||||
// asign name
|
||||
self maps\_names::get_name();
|
||||
// string not found for
|
||||
self setlookattext( self.name, &"" );
|
||||
}
|
||||
|
||||
if ( isdefined( level.droneCallbackThread ) )
|
||||
self thread [[ level.droneCallbackThread ]]();
|
||||
|
||||
// Run the friendly fire thread on this drone so the mission can be failed for killing friendly drones
|
||||
// Runs on all teams since friendly fire script also keeps track of enemies killed, etc.
|
||||
level thread maps\_friendlyfire::friendly_fire_think( self );
|
||||
}
|
||||
|
||||
drone_init()
|
||||
{
|
||||
// Dont keep this drone if we've reached the max population for that team of drones
|
||||
assertEx( isdefined( level.max_drones ), "You need to put maps\_drone::init(); in your level script!" );
|
||||
if ( level.drones[ self.team ].array.size >= level.max_drones[ self.team ] )
|
||||
{
|
||||
self delete();
|
||||
return;
|
||||
}
|
||||
|
||||
thread drone_array_handling( self );
|
||||
|
||||
// Give the drone default health and make it take damage like an AI does
|
||||
self setCanDamage( true );
|
||||
|
||||
drone_give_soul();
|
||||
|
||||
if ( isdefined( self.script_drone_override ) )
|
||||
return;
|
||||
|
||||
// Wait until this drone loses it's health so it can die
|
||||
thread drone_death_thread();
|
||||
|
||||
|
||||
// If the drone targets something then make it move, otherwise just idle in place
|
||||
if ( isdefined( self.target ) )
|
||||
{
|
||||
if( !isdefined( self.script_moveoverride ) )
|
||||
self thread drone_move();
|
||||
else
|
||||
self thread drone_wait_move();
|
||||
}
|
||||
if ( ( isdefined( self.script_looping ) ) && ( self.script_looping == 0 ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
self thread drone_idle();
|
||||
}
|
||||
|
||||
drone_array_handling( drone )
|
||||
{
|
||||
structarray_add( level.drones[ drone.team ], drone );
|
||||
|
||||
team = drone.team;
|
||||
|
||||
drone waittill( "death" );
|
||||
|
||||
if ( isdefined( drone ) && isdefined( drone.struct_array_index ) )
|
||||
structarray_remove_index( level.drones[ team ], drone.struct_array_index );
|
||||
else
|
||||
structarray_remove_undefined( level.drones[ team ] );
|
||||
}
|
||||
|
||||
drone_death_thread()
|
||||
{
|
||||
// Wait until the drone reaches 0 health
|
||||
while ( isdefined( self ) )
|
||||
{
|
||||
self waittill( "damage" );
|
||||
|
||||
if ( isdefined( self.damageShield ) && self.damageShield )
|
||||
{
|
||||
self.health = 100000;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( self.health <= 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
deathanim = level.drone_anims[ self.team ][ "stand" ][ "death" ];
|
||||
if( isdefined( self.deathanim ) )
|
||||
deathanim = self.deathanim;
|
||||
|
||||
// Make drone die
|
||||
self notify( "death" );
|
||||
|
||||
if ( !( isdefined( self.noragdoll ) && isdefined( self.skipDeathAnim ) ) )
|
||||
{
|
||||
if ( isdefined( self.noragdoll ) )
|
||||
{
|
||||
self drone_play_scripted_anim( deathanim, "deathplant" );
|
||||
}
|
||||
else
|
||||
if ( isdefined( self.skipDeathAnim ) )
|
||||
{
|
||||
self startragdoll();
|
||||
self drone_play_scripted_anim( deathanim, "deathplant" );
|
||||
}
|
||||
else
|
||||
{
|
||||
self drone_play_scripted_anim( deathanim, "deathplant" );
|
||||
self startragdoll();
|
||||
}
|
||||
}
|
||||
|
||||
self notsolid();
|
||||
|
||||
if( isdefined( self ) && isdefined( self.nocorpsedelete ) )
|
||||
return;
|
||||
|
||||
wait 10;
|
||||
while( isdefined( self ) )
|
||||
{
|
||||
if ( !within_fov( level.player.origin, level.player.angles, self.origin, DEATH_DELETE_FOV ) )
|
||||
self delete();
|
||||
wait( 5 );
|
||||
}
|
||||
}
|
||||
|
||||
// non-blocking loop animation used for idle/movement
|
||||
drone_play_looping_anim( droneAnim, rate )
|
||||
{
|
||||
self ClearAnim( %body, 0.2 );
|
||||
self StopAnimScripted();
|
||||
|
||||
self SetFlaggedAnimKnobAllRestart( "drone_anim", droneAnim, %body, 1, 0.2, rate );
|
||||
}
|
||||
|
||||
//blocking/scripted animation (when we're not moving)
|
||||
drone_play_scripted_anim( droneAnim, deathplant )
|
||||
{
|
||||
self clearAnim( %body, 0.2 );
|
||||
self stopAnimScripted();
|
||||
|
||||
mode = "normal";
|
||||
if ( isdefined( deathplant ) )
|
||||
mode = "deathplant";
|
||||
|
||||
flag = "drone_anim";
|
||||
self animscripted( flag, self.origin, self.angles, droneAnim, mode );
|
||||
|
||||
//self animRelative( "drone_anim", self.origin, self.angles, droneAnim );
|
||||
self waittillmatch( "drone_anim", "end" );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
///ScriptDocBegin
|
||||
"Name: drone_drop_real_weapon_on_death()"
|
||||
"Summary: Call this on a drone to have him drop a real weapon that can be picked up by the player"
|
||||
"Module: Utility"
|
||||
"CallOn: A spawned drone"
|
||||
"Example: myDrone thread drone_drop_real_weapon_on_death()"
|
||||
"SPMP: singleplayer"
|
||||
///ScriptDocEnd
|
||||
=============
|
||||
*/
|
||||
drone_drop_real_weapon_on_death()
|
||||
{
|
||||
if ( !isdefined( self ) )
|
||||
return;
|
||||
|
||||
self waittill( "death" );
|
||||
if( !isdefined( self ) ) //abort if deleted manually
|
||||
return;
|
||||
|
||||
weapon_model = getWeaponModel( self.weapon );
|
||||
weapon = self.weapon;
|
||||
if ( isdefined( weapon_model ) )
|
||||
{
|
||||
//self waittill_match_or_timeout( "deathanim", "end", 4 );
|
||||
self detach( weapon_model, "tag_weapon_right" );
|
||||
org = self gettagorigin( "tag_weapon_right" );
|
||||
ang = self gettagangles( "tag_weapon_right" );
|
||||
gun = Spawn( "weapon_" + weapon, ( 0, 0, 0 ) );
|
||||
gun.angles = ang;
|
||||
gun.origin = org;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
drone_idle( lastNode, moveToDest )
|
||||
{
|
||||
|
||||
if ( ( isdefined( lastNode ) ) && ( isdefined( lastNode[ "script_noteworthy" ] ) ) && ( isdefined( level.drone_anims[ self.team ][ lastNode[ "script_noteworthy" ] ] ) ) )
|
||||
{
|
||||
//if the last node has a valid fight behavior in its script_noteworthy, fight from that node
|
||||
self thread drone_fight( lastNode[ "script_noteworthy" ], lastNode, moveToDest );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, just loop standard idle animation
|
||||
self drone_play_looping_anim( level.drone_anims[ self.team ][ "stand" ][ "idle" ], 1 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
drone_get_goal_loc_with_arrival( dist, node )
|
||||
{
|
||||
animset = node[ "script_noteworthy" ];
|
||||
if ( !isdefined( level.drone_anims[ self.team ][ animset ][ "arrival" ] ) )
|
||||
return dist;
|
||||
animDelta = GetMoveDelta( level.drone_anims[ self.team ][ animset ][ "arrival" ], 0, 1 );
|
||||
animDelta = length( animDelta );
|
||||
assertex( animDelta < dist, "Drone with export " + self.export + " does not have enough room to play an arrival anim. Space nodes out more and ensure he has a straight path into the last node" );
|
||||
dist = ( dist - animDelta );
|
||||
return dist;
|
||||
}
|
||||
/*
|
||||
ent_cleanup( drone )
|
||||
{
|
||||
//cleanup the script_origin used to make arrivals work on uneven terrain
|
||||
self endon( "death" );
|
||||
drone waittill( "death" );
|
||||
if ( isdefined( self ) )
|
||||
self delete();
|
||||
}
|
||||
*/
|
||||
drone_fight( animset, struct, moveToDest )
|
||||
{
|
||||
|
||||
self endon( "death" );
|
||||
self endon( "stop_drone_fighting" );
|
||||
self.animset = animset;
|
||||
self.weaponsound = undefined;
|
||||
iRand = randomintrange( 1, 4 );
|
||||
|
||||
//assign drone a random weapon for sound variety
|
||||
if( self.team == "axis" )
|
||||
{
|
||||
if( iRand == 1 )
|
||||
self.weaponsound = "drone_ak47_fire_npc";
|
||||
else if( iRand == 2 )
|
||||
self.weaponsound = "drone_g36c_fire_npc";
|
||||
if( iRand == 3 )
|
||||
self.weaponsound = "drone_fnp90_fire_npc";
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iRand == 1 )
|
||||
self.weaponsound = "drone_m4carbine_fire_npc";
|
||||
else if( iRand == 2 )
|
||||
self.weaponsound = "drone_m16_fire_npc";
|
||||
if( iRand == 3 )
|
||||
self.weaponsound = "drone_m249saw_fire_npc";
|
||||
}
|
||||
|
||||
|
||||
//commenting out arrival stuff for now....causes floating and other unpredictible behavior
|
||||
//attach drone to dummy node for arrival so he can arrive on uneven terrain
|
||||
// dummy = spawn( "script_origin", moveToDest );
|
||||
// dummy thread ent_cleanup( self );
|
||||
// dummy thread debug_message( "ORG", undefined, 9999, dummy );
|
||||
// dummy.origin = ( dummy.origin[ 0 ], dummy.origin[ 1 ], self.origin[ 2 ] );
|
||||
// self linkTo( dummy );
|
||||
// dummyTime = getanimlength( level.drone_anims[ self.team ][ animset ][ "arrival" ] );
|
||||
// dummyTime = dummyTime - 1;
|
||||
// dummy moveto( moveToDest + ( 0, 0, 2 ), dummyTime );
|
||||
// self drone_play_scripted_anim( level.drone_anims[ self.team ][ animset ][ "arrival" ] );
|
||||
// self unlink();
|
||||
// dummy delete();
|
||||
|
||||
//make sure drone has no UP angle...should just play anim flat on the ground and not be tilted
|
||||
self.angles = ( 0, self.angles[ 1 ], self.angles[ 2 ] );
|
||||
|
||||
//move up a few units if prone...keeps getting buried in ground
|
||||
if ( animset == "coverprone" )
|
||||
self moveto( self.origin + ( 0, 0, 8 ), .05 );
|
||||
|
||||
//set deathanim to one that will work with cover behavior
|
||||
self.noragdoll = true;
|
||||
self.deathanim = level.drone_anims[ self.team ][ animset ][ "death" ];
|
||||
bPopUpToFire = 1;
|
||||
while( isdefined( self ) )
|
||||
{
|
||||
//play random cover loop/twitch
|
||||
self drone_play_scripted_anim( level.drone_anims[ self.team ][ animset ][ "idle" ][ randomint( level.drone_anims[ self.team ][ animset ][ "idle" ].size ) ] );
|
||||
|
||||
|
||||
//pop up and fire
|
||||
if ( ( cointoss() ) && ( !isdefined( self.ignoreall ) ) )
|
||||
{
|
||||
//dont always pop up if prone
|
||||
if ( animset == "coverprone" )
|
||||
{
|
||||
if( cointoss() )
|
||||
bPopUpToFire = 0;
|
||||
else
|
||||
bPopUpToFire = 1;
|
||||
}
|
||||
//never pop up if coverguard
|
||||
else if ( animset == "coverguard" )
|
||||
bPopUpToFire = 0;
|
||||
|
||||
if ( bPopUpToFire == 1 )
|
||||
{
|
||||
self drone_play_scripted_anim( level.drone_anims[ self.team ][ animset ][ "hide_2_aim" ] );
|
||||
wait( getanimlength( level.drone_anims[ self.team ][ animset ][ "hide_2_aim" ] ) - .5 );
|
||||
}
|
||||
|
||||
//fire some blank bullets
|
||||
if ( isdefined( level.drone_anims[ self.team ][ animset ][ "fire" ] ) )
|
||||
{
|
||||
if ( ( animset == "coverprone" ) && ( bPopUpToFire == 1 ) )
|
||||
self thread drone_play_looping_anim( level.drone_anims[ self.team ][ animset ][ "fire_exposed" ], 1 );
|
||||
else
|
||||
self thread drone_play_looping_anim( level.drone_anims[ self.team ][ animset ][ "fire" ], 1 );
|
||||
|
||||
self drone_fire_randomly();
|
||||
}
|
||||
else
|
||||
{
|
||||
//if no fire idle anim...just put out a quick burst
|
||||
self drone_shoot();
|
||||
wait(.15);
|
||||
self drone_shoot();
|
||||
wait(.15);
|
||||
self drone_shoot();
|
||||
wait(.15);
|
||||
self drone_shoot();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//dont always pop up if prone..never pop up if coverguard
|
||||
if ( bPopUpToFire == 1 )
|
||||
self drone_play_scripted_anim( level.drone_anims[ self.team ][ animset ][ "aim_2_hide" ] );
|
||||
|
||||
//reload weapon
|
||||
self drone_play_scripted_anim( level.drone_anims[ self.team ][ animset ][ "reload" ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
drone_fire_randomly()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
//randomly do bursts or single shots
|
||||
if( cointoss() )
|
||||
{
|
||||
self drone_shoot();
|
||||
wait( .1 );
|
||||
self drone_shoot();
|
||||
wait( .1 );
|
||||
self drone_shoot();
|
||||
|
||||
if( cointoss() )
|
||||
{
|
||||
wait( .1 );
|
||||
self drone_shoot();
|
||||
}
|
||||
|
||||
if( cointoss() )
|
||||
{
|
||||
wait( .1 );
|
||||
self drone_shoot();
|
||||
wait( .1 );
|
||||
self drone_shoot();
|
||||
wait( .1 );
|
||||
}
|
||||
if( cointoss() )
|
||||
wait( randomfloatrange( 1, 2 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
self drone_shoot();
|
||||
wait( randomfloatrange( .25, .75 ) );
|
||||
self drone_shoot();
|
||||
wait( randomfloatrange( .15, .75 ) );
|
||||
self drone_shoot();
|
||||
wait( randomfloatrange( .15, .75 ) );
|
||||
self drone_shoot();
|
||||
wait( randomfloatrange( .15, .75 ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
drone_shoot()
|
||||
{
|
||||
self endon( "death" );
|
||||
self notify( "firing" );
|
||||
self endon( "firing" );
|
||||
drone_shoot_fx();
|
||||
fireAnim = %exposed_crouch_shoot_auto_v2;
|
||||
//SetAnimKnobRestart( <animation>, <weight>, <time>, <rate> )
|
||||
self setAnimKnobRestart( fireAnim, 1, .2, 1.0 );
|
||||
self delaycall( .25, ::clearAnim, fireAnim, 0 );
|
||||
}
|
||||
|
||||
drone_shoot_fx()
|
||||
{
|
||||
shoot_fx = getfx( "ak47_muzzleflash" );
|
||||
if ( self.team == "allies" )
|
||||
{
|
||||
shoot_fx = getfx( "m16_muzzleflash" );
|
||||
}
|
||||
|
||||
self thread drone_play_weapon_sound( self.weaponsound );
|
||||
PlayFXOnTag( shoot_fx, self, "tag_flash" );
|
||||
}
|
||||
|
||||
drone_play_weapon_sound( weaponsound )
|
||||
{
|
||||
self playsound( weaponsound );
|
||||
}
|
||||
|
||||
drone_wait_move()
|
||||
{
|
||||
self endon( "death" );
|
||||
self waittill( "move" );
|
||||
self thread drone_move();
|
||||
}
|
||||
|
||||
drone_init_path()
|
||||
{
|
||||
if ( !isdefined( self.target ) )
|
||||
return;
|
||||
if ( isdefined( level.drone_paths[ self.target ] ) )
|
||||
return;
|
||||
|
||||
// don't process a path more than once
|
||||
level.drone_paths[ self.target ] = true;
|
||||
|
||||
target = self.target;
|
||||
node = getstruct( target, "targetname" );
|
||||
if ( !isdefined( node ) )
|
||||
return;
|
||||
|
||||
vectors = [];
|
||||
|
||||
completed_nodes = [];
|
||||
original_node = node;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
node = original_node;
|
||||
found_new_node = false;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
if ( !isdefined( node.target ) )
|
||||
break;
|
||||
|
||||
nextNodes = getstructarray( node.target, "targetname" );
|
||||
if ( nextNodes.size )
|
||||
break;
|
||||
|
||||
nextNode = undefined;
|
||||
foreach ( newNode in nextNodes )
|
||||
{
|
||||
// origin should be unique per node
|
||||
if ( isdefined( completed_nodes[ newNode.origin + "" ] ) )
|
||||
continue;
|
||||
|
||||
nextNode = newNode;
|
||||
break;
|
||||
}
|
||||
if ( !isdefined( nextNode ) )
|
||||
break;
|
||||
|
||||
completed_nodes[ nextNode.origin + "" ] = true;
|
||||
|
||||
//Line( node.origin, nextNode.origin, (1,1,1), 1, 0, 5000 );
|
||||
vectors[ node.targetname ] = nextNode.origin - node.origin;
|
||||
node.angles = vectortoangles( vectors[ node.targetname ] );
|
||||
|
||||
node = nextNode;
|
||||
found_new_node = true;
|
||||
}
|
||||
|
||||
if ( !found_new_node )
|
||||
break;
|
||||
}
|
||||
|
||||
// now average the angles so they take corners properly
|
||||
target = self.target;
|
||||
node = getstruct( target, "targetname" );
|
||||
prevNode = node;
|
||||
completed_nodes = [];
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
node = original_node;
|
||||
found_new_node = false;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
if ( !isdefined( node.target ) )
|
||||
return;
|
||||
|
||||
if ( !isdefined( vectors[ node.targetname ] ) )
|
||||
return;
|
||||
|
||||
nextNodes = getstructarray( node.target, "targetname" );
|
||||
if ( nextNodes.size )
|
||||
break;
|
||||
|
||||
nextNode = undefined;
|
||||
foreach ( newNode in nextNodes )
|
||||
{
|
||||
// origin should be unique per node
|
||||
if ( isdefined( completed_nodes[ newNode.origin + "" ] ) )
|
||||
continue;
|
||||
|
||||
nextNode = newNode;
|
||||
break;
|
||||
}
|
||||
if ( !isdefined( nextNode ) )
|
||||
break;
|
||||
|
||||
|
||||
if ( isdefined( node.radius ) )
|
||||
{
|
||||
vec1 = vectors[ prevNode.targetname ];
|
||||
vec2 = vectors[ node.targetname ];
|
||||
vec = ( vec1 + vec2 ) * 0.5;
|
||||
node.angles = vectorToAngles( vec );
|
||||
|
||||
/*
|
||||
Line( node.origin, node.origin + vec1, (1,0,0), 1, 1, 1000 );
|
||||
Line( node.origin, node.origin + vec2, (0,0,1), 1, 1, 1000 );
|
||||
Line( node.origin, node.origin + vec, (0,1,0), 1, 1, 1000 );
|
||||
|
||||
/#
|
||||
thread maps\_debug::drawArrowForever( node.origin, node.angles );
|
||||
#/
|
||||
*/
|
||||
}
|
||||
|
||||
found_new_node = true;
|
||||
prevNode = node;
|
||||
node = nextNode;
|
||||
}
|
||||
|
||||
if ( !found_new_node )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
drone_move()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
// Loop run animation
|
||||
wait randomfloat( 0.5 );
|
||||
|
||||
runAnim = level.drone_anims[ self.team ][ "stand" ][ "run" ];
|
||||
if ( isdefined( self.runanim ) )
|
||||
runAnim = self.runanim;
|
||||
|
||||
self drone_play_looping_anim( runAnim, self.moveplaybackrate );
|
||||
|
||||
nodes = self getPathArray( self.target, self.origin );
|
||||
assert( isdefined( nodes ) );
|
||||
assert( isdefined( nodes[ 0 ] ) );
|
||||
|
||||
prof_begin( "drone_math" );
|
||||
|
||||
loopTime = 0.5;
|
||||
currentNode_LookAhead = 0;
|
||||
for ( ;; )
|
||||
{
|
||||
if ( !isdefined( nodes[ currentNode_LookAhead ] ) )
|
||||
break;
|
||||
|
||||
// Calculate how far and what direction the lookahead path point should move
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
// find point on real path where character is
|
||||
vec1 = nodes[ currentNode_LookAhead ][ "vec" ];
|
||||
vec2 = ( self.origin - nodes[ currentNode_LookAhead ][ "origin" ] );
|
||||
distanceFromPoint1 = vectorDot( vectorNormalize( vec1 ), vec2 );
|
||||
|
||||
// check if this is the last node (wont have a distance value)
|
||||
if ( !isdefined( nodes[ currentNode_LookAhead ][ "dist" ] ) )
|
||||
break;
|
||||
|
||||
lookaheadDistanceFromNode = ( distanceFromPoint1 + level.drone_lookAhead_value );
|
||||
assert( isdefined( lookaheadDistanceFromNode ) );
|
||||
|
||||
assert( isdefined( currentNode_LookAhead ) );
|
||||
assert( isdefined( nodes[ currentNode_LookAhead ] ) );
|
||||
assert( isdefined( nodes[ currentNode_LookAhead ][ "dist" ] ) );
|
||||
|
||||
while ( lookaheadDistanceFromNode > nodes[ currentNode_LookAhead ][ "dist" ] )
|
||||
{
|
||||
// moving the lookahead would pass the node, so move it the remaining distance on the vector of the next node
|
||||
lookaheadDistanceFromNode = lookaheadDistanceFromNode - nodes[ currentNode_LookAhead ][ "dist" ];
|
||||
currentNode_LookAhead++ ;
|
||||
|
||||
if ( !isdefined( nodes[ currentNode_LookAhead ][ "dist" ] ) )
|
||||
{
|
||||
//last node on the chain
|
||||
self rotateTo( vectorToAngles( nodes[ nodes.size - 1 ][ "vec" ] ), loopTime );
|
||||
d = distance( self.origin, nodes[ nodes.size - 1 ][ "origin" ] );
|
||||
timeOfMove = ( d / ( DRONE_RUN_SPEED * self.moveplaybackrate ) );
|
||||
|
||||
//compensate for arrivals, if any
|
||||
// timeOfMoveWithArrival = undefined;
|
||||
// if ( isdefined( nodes[ nodes.size - 1 ][ "script_noteworthy" ] ) )
|
||||
// {
|
||||
// d = drone_get_goal_loc_with_arrival( d, nodes[ nodes.size - 1 ] );
|
||||
// timeOfMoveWithArrival = ( d / ( DRONE_RUN_SPEED * self.moveplaybackrate ) );
|
||||
// }
|
||||
|
||||
traceOrg1 = nodes[ nodes.size - 1 ][ "origin" ] + ( 0, 0, TRACE_HEIGHT );
|
||||
traceOrg2 = nodes[ nodes.size - 1 ][ "origin" ] - ( 0, 0, TRACE_HEIGHT );
|
||||
moveToDest = physicstrace( traceOrg1, traceOrg2 );
|
||||
|
||||
if ( getdvar( "debug_drones" ) == "1" )
|
||||
{
|
||||
thread draw_line_for_time( traceOrg1, traceOrg2, 1, 1, 1, loopTime );
|
||||
thread draw_line_for_time( self.origin, moveToDest, 0, 0, 1, loopTime );
|
||||
}
|
||||
self moveTo( moveToDest, timeOfMove );
|
||||
|
||||
// if ( isdefined( timeOfMoveWithArrival ) )
|
||||
// wait timeOfMoveWithArrival;
|
||||
// else
|
||||
// wait timeOfMove;
|
||||
wait timeOfMove;
|
||||
prof_end( "drone_math" );
|
||||
self notify( "goal" );
|
||||
self thread check_delete();
|
||||
self thread drone_idle( nodes[ nodes.size - 1 ], moveToDest );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !isdefined( nodes[ currentNode_LookAhead ] ) )
|
||||
{
|
||||
prof_end( "drone_math" );
|
||||
self notify( "goal" );
|
||||
self thread drone_idle();
|
||||
return;
|
||||
}
|
||||
|
||||
assert( isdefined( nodes[ currentNode_LookAhead ] ) );
|
||||
}
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Move the lookahead point down along it's path
|
||||
//----------------------------------------------
|
||||
assert( isdefined( nodes[ currentNode_LookAhead ][ "vec" ] ) );
|
||||
assert( isdefined( nodes[ currentNode_LookAhead ][ "vec" ][ 0 ] ) );
|
||||
assert( isdefined( nodes[ currentNode_LookAhead ][ "vec" ][ 1 ] ) );
|
||||
assert( isdefined( nodes[ currentNode_LookAhead ][ "vec" ][ 2 ] ) );
|
||||
desiredPosition = vector_multiply( nodes[ currentNode_LookAhead ][ "vec" ], lookaheadDistanceFromNode );
|
||||
desiredPosition = desiredPosition + nodes[ currentNode_LookAhead ][ "origin" ];
|
||||
lookaheadPoint = desiredPosition;
|
||||
// trace the lookahead point to the ground
|
||||
traceOrg1 = lookaheadPoint + ( 0, 0, TRACE_HEIGHT );
|
||||
traceOrg2 = lookaheadPoint - ( 0, 0, TRACE_HEIGHT );
|
||||
lookaheadPoint = physicstrace( traceOrg1, traceOrg2 );
|
||||
|
||||
if ( getdvar( "debug_drones" ) == "1" )
|
||||
{
|
||||
thread draw_line_for_time( traceOrg1, traceOrg2, 1, 1, 1, loopTime );
|
||||
thread draw_point( lookaheadPoint, 1, 0, 0, 16, loopTime );
|
||||
println( lookaheadDistanceFromNode + "/" + nodes[ currentNode_LookAhead ][ "dist" ] + " units forward from node[" + currentNode_LookAhead + "]" );
|
||||
}
|
||||
//---------------------------------------------
|
||||
|
||||
|
||||
//Rotate character to face the lookahead point
|
||||
//--------------------------------------------
|
||||
assert( isdefined( lookaheadPoint ) );
|
||||
characterFaceDirection = VectorToAngles( lookaheadPoint - self.origin );
|
||||
assert( isdefined( characterFaceDirection ) );
|
||||
assert( isdefined( characterFaceDirection[ 0 ] ) );
|
||||
assert( isdefined( characterFaceDirection[ 1 ] ) );
|
||||
assert( isdefined( characterFaceDirection[ 2 ] ) );
|
||||
self rotateTo( ( 0, characterFaceDirection[ 1 ], 0 ), loopTime );
|
||||
//--------------------------------------------
|
||||
|
||||
|
||||
//Move the character in the direction of the lookahead point
|
||||
//----------------------------------------------------------
|
||||
characterDistanceToMove = ( DRONE_RUN_SPEED * loopTime * self.moveplaybackrate );
|
||||
moveVec = vectorNormalize( lookaheadPoint - self.origin );
|
||||
desiredPosition = vector_multiply( moveVec, characterDistanceToMove );
|
||||
desiredPosition = desiredPosition + self.origin;
|
||||
if ( getdvar( "debug_drones" ) == "1" )
|
||||
thread draw_line_for_time( self.origin, desiredPosition, 0, 0, 1, loopTime );
|
||||
self moveTo( desiredPosition, loopTime );
|
||||
//----------------------------------------------------------
|
||||
|
||||
wait loopTime;
|
||||
}
|
||||
|
||||
|
||||
self thread drone_idle();
|
||||
|
||||
prof_end( "drone_math" );
|
||||
}
|
||||
|
||||
getPathArray( firstTargetName, initialPoint )
|
||||
{
|
||||
//#########################################################################################################
|
||||
// make an array of all the points along the spline starting with the characters current position,
|
||||
// then starting with the point with the passed in targetname
|
||||
//
|
||||
// information stored in array:
|
||||
//
|
||||
// origin - origin of the node
|
||||
// dist - distance to the next node ( will be undefined if there is not a next node )
|
||||
// vec - vector to the next node ( if there is not a next node, the vector will be the same as the previous node )
|
||||
// script_noteworthy - script_noteworthy of the node if defined
|
||||
//
|
||||
//#########################################################################################################
|
||||
|
||||
usingNodes = true;
|
||||
assert( isdefined( firstTargetName ) );
|
||||
|
||||
prof_begin( "drone_math" );
|
||||
|
||||
assert( isdefined( initialPoint ) );
|
||||
|
||||
nodes = [];
|
||||
nodes[ 0 ][ "origin" ] = initialPoint;
|
||||
nodes[ 0 ][ "dist" ] = 0;
|
||||
|
||||
|
||||
nextNodeName = undefined;
|
||||
nextNodeName = firstTargetName;
|
||||
|
||||
get_target_func[ "entity" ] = maps\_spawner::get_target_ents;
|
||||
get_target_func[ "node" ] = maps\_spawner::get_target_nodes;
|
||||
get_target_func[ "struct" ] = maps\_spawner::get_target_structs;
|
||||
|
||||
goal_type = undefined;
|
||||
test_ent = [[ get_target_func[ "entity" ] ]]( nextNodeName );
|
||||
test_nod = [[ get_target_func[ "node" ] ]]( nextNodeName );
|
||||
test_str = [[ get_target_func[ "struct" ] ]]( nextNodeName );
|
||||
|
||||
if( test_ent.size )
|
||||
goal_type = "entity";
|
||||
else
|
||||
if( test_nod.size )
|
||||
goal_type = "node";
|
||||
else
|
||||
if( test_str.size )
|
||||
goal_type = "struct";
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
index = nodes.size;
|
||||
|
||||
// get the next node in the chain
|
||||
nextNodes = [[ get_target_func[ goal_type ] ]]( nextNodeName );
|
||||
node = random( nextNodes );
|
||||
/*
|
||||
// no script_struct was found
|
||||
if ( !isdefined( node ) )
|
||||
{
|
||||
if ( index == 0 )
|
||||
assertMsg( "Drone was told to walk to a node with a targetname that doesnt match a script_struct targetname" );
|
||||
break;
|
||||
}
|
||||
*/
|
||||
// add this node information to the chain data array
|
||||
org = node.origin;
|
||||
|
||||
//check for radius on node, since you can make them run to a radius rather than an exact point
|
||||
if ( isdefined( node.radius ) )
|
||||
{
|
||||
assert( node.radius > 0 );
|
||||
|
||||
// offset for this drone (-1 to 1)
|
||||
if ( !isdefined( self.droneRunOffset ) )
|
||||
self.droneRunOffset = ( 0 - 1 + ( randomfloat( 2 ) ) );
|
||||
|
||||
if ( !isdefined( node.angles ) )
|
||||
node.angles = ( 0, 0, 0 );
|
||||
|
||||
prof_begin( "drone_math" );
|
||||
forwardVec = anglestoforward( node.angles );
|
||||
rightVec = anglestoright( node.angles );
|
||||
upVec = anglestoup( node.angles );
|
||||
relativeOffset = ( 0, ( self.droneRunOffset * node.radius ), 0 );
|
||||
org += vector_multiply( forwardVec, relativeOffset[ 0 ] );
|
||||
org += vector_multiply( rightVec, relativeOffset[ 1 ] );
|
||||
org += vector_multiply( upVec, relativeOffset[ 2 ] );
|
||||
prof_end( "drone_math" );
|
||||
}
|
||||
nodes[ index ][ "origin" ] = org;
|
||||
if ( isdefined( node.script_noteworthy ) )
|
||||
nodes[ index ][ "script_noteworthy" ] = node.script_noteworthy;
|
||||
|
||||
// find the distance from the previous node to this node, and the vector of of the previous node to this node
|
||||
// then add the info to the previous nodes data
|
||||
nodes[ index - 1 ][ "dist" ] = distance( nodes[ index ][ "origin" ], nodes[ index - 1 ][ "origin" ] );
|
||||
nodes[ index - 1 ][ "vec" ] = vectorNormalize( nodes[ index ][ "origin" ] - nodes[ index - 1 ][ "origin" ] );
|
||||
|
||||
//if the node doesn't target another node then it's the last of the chain
|
||||
if ( !isdefined( node.target ) )
|
||||
break;
|
||||
//it targets something
|
||||
nextNodeName = node.target;
|
||||
}
|
||||
|
||||
nodes[ index ][ "vec" ] = nodes[ index - 1 ][ "vec" ];
|
||||
|
||||
node = undefined;
|
||||
|
||||
prof_end( "drone_math" );
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
draw_point( org, r, g, b, size, time )
|
||||
{
|
||||
point1 = org + ( size, 0, 0 );
|
||||
point2 = org - ( size, 0, 0 );
|
||||
thread draw_line_for_time( point1, point2, r, g, b, time );
|
||||
|
||||
point1 = org + ( 0, size, 0 );
|
||||
point2 = org - ( 0, size, 0 );
|
||||
thread draw_line_for_time( point1, point2, r, g, b, time );
|
||||
|
||||
point1 = org + ( 0, 0, size );
|
||||
point2 = org - ( 0, 0, size );
|
||||
thread draw_line_for_time( point1, point2, r, g, b, time );
|
||||
}
|
||||
|
||||
check_delete()
|
||||
{
|
||||
if ( !isdefined( self ) )
|
||||
return;
|
||||
|
||||
if ( !isdefined( self.script_noteworthy ) )
|
||||
return;
|
||||
|
||||
if ( self.script_noteworthy != "delete_on_goal" )
|
||||
return;
|
||||
|
||||
self delete();
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
init()
|
||||
{
|
||||
// drone type specific stuff
|
||||
level.drone_anims[ "allies" ][ "stand" ][ "idle" ] = %casual_stand_idle;
|
||||
level.drone_anims[ "allies" ][ "stand" ][ "run" ] = %run_lowready_F_relative;
|
||||
level.drone_anims[ "allies" ][ "stand" ][ "death" ] = %exposed_death;
|
||||
|
||||
//allies
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "idle" ][ 0 ] = %covercrouch_hide_idle;
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "idle" ][ 1 ] = %covercrouch_twitch_1;
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "idle" ][ 2 ] = %covercrouch_twitch_2;
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "idle" ][ 3 ] = %covercrouch_twitch_3;
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "idle" ][ 4 ] = %covercrouch_hide_look;
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "hide_2_aim" ] = %covercrouch_hide_2_aim;
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "aim_2_hide" ] = %covercrouch_aim_2_hide;
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "reload" ] = %covercrouch_reload_hide;
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "fire" ] = %covercrouch_aim5;
|
||||
level.drone_anims[ "allies" ][ "covercrouch" ][ "death" ] = %covercrouch_death_1;
|
||||
//level.drone_anims[ "allies" ][ "covercrouch" ][ "arrival" ] = %covercrouch_run_in_M;
|
||||
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "idle" ][ 0 ] = %coverstand_hide_idle;
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "idle" ][ 1 ] = %coverstand_look_quick;
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "idle" ][ 2 ] = %coverstand_look_quick_v2;
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "idle" ][ 3 ] = %coverstand_hide_idle_twitch04;
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "idle" ][ 4 ] = %coverstand_hide_idle_twitch05;
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "hide_2_aim" ] = %coverstand_hide_2_aim;
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "aim_2_hide" ] = %coverstand_aim_2_hide;
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "reload" ] = %coverstand_reloadA;
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "fire" ] = %exposed_aim_5;
|
||||
level.drone_anims[ "allies" ][ "coverstand" ][ "death" ] = %coverstand_death_left;
|
||||
//level.drone_anims[ "allies" ][ "coverstand" ][ "arrival" ] = %coverstand_trans_IN_M;
|
||||
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "idle" ][ 0 ] = %corner_standL_alert_idle;
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "idle" ][ 1 ] = %corner_standL_alert_twitch01;
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "idle" ][ 2 ] = %corner_standL_alert_twitch02;
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "idle" ][ 3 ] = %corner_standL_alert_twitch03;
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "idle" ][ 4 ] = %corner_standL_alert_twitch04;
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "hide_2_aim" ] = %corner_standL_trans_alert_2_B_v2;
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "aim_2_hide" ] = %corner_standL_trans_B_2_alert_v2;
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "reload" ] = %corner_standL_reload_v1;
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "fire" ] = %exposed_aim_5;
|
||||
level.drone_anims[ "allies" ][ "coverleftstand" ][ "death" ] = %corner_standL_deathB;
|
||||
//level.drone_anims[ "allies" ][ "coverleftstand" ][ "arrival" ] = %corner_standL_trans_IN_2;
|
||||
|
||||
level.drone_anims[ "allies" ][ "coverrightstand" ][ "idle" ][ 0 ] = %corner_standR_alert_idle;
|
||||
level.drone_anims[ "allies" ][ "coverrightstand" ][ "idle" ][ 1 ] = %corner_standR_alert_twitch01;
|
||||
level.drone_anims[ "allies" ][ "coverrightstand" ][ "idle" ][ 2 ] = %corner_standR_alert_twitch02;
|
||||
level.drone_anims[ "allies" ][ "coverrightstand" ][ "idle" ][ 3 ] = %corner_standR_alert_twitch04;
|
||||
level.drone_anims[ "allies" ][ "coverrightstand" ][ "hide_2_aim" ] = %corner_standR_trans_alert_2_B;
|
||||
level.drone_anims[ "allies" ][ "coverrightstand" ][ "aim_2_hide" ] = %corner_standR_trans_B_2_alert;
|
||||
level.drone_anims[ "allies" ][ "coverrightstand" ][ "reload" ] = %corner_standR_reload_v1;
|
||||
level.drone_anims[ "allies" ][ "coverrightstand" ][ "fire" ] = %exposed_aim_5;
|
||||
level.drone_anims[ "allies" ][ "coverrightstand" ][ "death" ] = %corner_standR_deathB;
|
||||
//level.drone_anims[ "allies" ][ "coverrightstand" ][ "arrival" ] = %corner_standR_trans_IN_2;
|
||||
|
||||
level.drone_anims[ "allies" ][ "coverrightcrouch" ][ "idle" ][ 0 ] = %CornerCrR_alert_idle;
|
||||
level.drone_anims[ "allies" ][ "coverrightcrouch" ][ "idle" ][ 1 ] = %CornerCrR_alert_twitch_v1;
|
||||
level.drone_anims[ "allies" ][ "coverrightcrouch" ][ "idle" ][ 2 ] = %CornerCrR_alert_twitch_v2;
|
||||
level.drone_anims[ "allies" ][ "coverrightcrouch" ][ "idle" ][ 3 ] = %CornerCrR_alert_twitch_v3;
|
||||
level.drone_anims[ "allies" ][ "coverrightcrouch" ][ "hide_2_aim" ] = %CornerCrR_alert_2_lean;
|
||||
level.drone_anims[ "allies" ][ "coverrightcrouch" ][ "aim_2_hide" ] = %CornerCrR_lean_2_alert;
|
||||
level.drone_anims[ "allies" ][ "coverrightcrouch" ][ "reload" ] = %CornerCrR_reloadA;
|
||||
level.drone_anims[ "allies" ][ "coverrightcrouch" ][ "death" ] = %exposed_crouch_death_fetal;
|
||||
//level.drone_anims[ "allies" ][ "coverrightcrouch" ][ "arrival" ] = %CornerCrR_trans_IN_M;
|
||||
|
||||
|
||||
level.drone_anims[ "allies" ][ "coverguard" ][ "idle" ][ 0 ] = %exposed_crouch_idle_twitch_v2;
|
||||
level.drone_anims[ "allies" ][ "coverguard" ][ "idle" ][ 1 ] = %exposed_crouch_idle_twitch_v3;
|
||||
level.drone_anims[ "allies" ][ "coverguard" ][ "reload" ] = %exposed_crouch_reload;
|
||||
level.drone_anims[ "allies" ][ "coverguard" ][ "fire" ] = %exposed_crouch_aim_5;
|
||||
level.drone_anims[ "allies" ][ "coverguard" ][ "death" ] = %exposed_crouch_death_fetal;
|
||||
//level.drone_anims[ "allies" ][ "coverguard" ][ "arrival" ] = %run_2_crouch_F;
|
||||
|
||||
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "idle" ][ 0 ] = %prone_reaction_A;
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "idle" ][ 1 ] = %prone_twitch_ammocheck;
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "idle" ][ 2 ] = %prone_twitch_scan;
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "idle" ][ 3 ] = %prone_twitch_look;
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "idle" ][ 4 ] = %prone_twitch_lookup;
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "hide_2_aim" ] = %prone_2_crouch;
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "aim_2_hide" ] = %crouch_2_prone;
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "reload" ] = %prone_reload;
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "fire" ] = %prone_fire_1;
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "fire_exposed" ] = %exposed_crouch_aim_5; //special case for when prone guys occassionally stand up to fire
|
||||
level.drone_anims[ "allies" ][ "coverprone" ][ "death" ] = %saw_gunner_prone_death;
|
||||
//level.drone_anims[ "allies" ][ "coverprone" ][ "arrival" ] = %crouchrun2prone_straight;
|
||||
|
||||
|
||||
//axis
|
||||
level.drone_anims[ "axis" ][ "stand" ][ "idle" ] = %casual_stand_idle;
|
||||
level.drone_anims[ "axis" ][ "stand" ][ "run" ] = %run_lowready_F_relative;
|
||||
level.drone_anims[ "axis" ][ "stand" ][ "death" ] = %exposed_death;
|
||||
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "idle" ][ 0 ] = %covercrouch_hide_idle;
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "idle" ][ 1 ] = %covercrouch_twitch_1;
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "idle" ][ 2 ] = %covercrouch_twitch_2;
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "idle" ][ 3 ] = %covercrouch_twitch_3;
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "idle" ][ 4 ] = %covercrouch_hide_look;
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "hide_2_aim" ] = %covercrouch_hide_2_aim;
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "aim_2_hide" ] = %covercrouch_aim_2_hide;
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "reload" ] = %covercrouch_reload_hide;
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "fire" ] = %covercrouch_aim5;
|
||||
level.drone_anims[ "axis" ][ "covercrouch" ][ "death" ] = %covercrouch_death_1;
|
||||
//level.drone_anims[ "axis" ][ "covercrouch" ][ "arrival" ] = %covercrouch_run_in_M;
|
||||
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "idle" ][ 0 ] = %coverstand_hide_idle;
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "idle" ][ 1 ] = %coverstand_look_quick;
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "idle" ][ 2 ] = %coverstand_look_quick_v2;
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "idle" ][ 3 ] = %coverstand_hide_idle_twitch04;
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "idle" ][ 4 ] = %coverstand_hide_idle_twitch05;
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "hide_2_aim" ] = %coverstand_hide_2_aim;
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "aim_2_hide" ] = %coverstand_aim_2_hide;
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "reload" ] = %coverstand_reloadA;
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "fire" ] = %exposed_aim_5;
|
||||
level.drone_anims[ "axis" ][ "coverstand" ][ "death" ] = %coverstand_death_left;
|
||||
//level.drone_anims[ "axis" ][ "coverstand" ][ "arrival" ] = %coverstand_trans_IN_M;
|
||||
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "idle" ][ 0 ] = %corner_standL_alert_idle;
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "idle" ][ 1 ] = %corner_standL_alert_twitch01;
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "idle" ][ 2 ] = %corner_standL_alert_twitch02;
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "idle" ][ 3 ] = %corner_standL_alert_twitch03;
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "idle" ][ 4 ] = %corner_standL_alert_twitch04;
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "hide_2_aim" ] = %corner_standL_trans_alert_2_B_v2;
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "aim_2_hide" ] = %corner_standL_trans_B_2_alert_v2;
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "reload" ] = %corner_standL_reload_v1;
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "fire" ] = %exposed_aim_5;
|
||||
level.drone_anims[ "axis" ][ "coverleftstand" ][ "death" ] = %corner_standL_deathB;
|
||||
//level.drone_anims[ "axis" ][ "coverleftstand" ][ "arrival" ] = %corner_standL_trans_IN_2;
|
||||
|
||||
level.drone_anims[ "axis" ][ "coverrightstand" ][ "idle" ][ 0 ] = %corner_standR_alert_idle;
|
||||
level.drone_anims[ "axis" ][ "coverrightstand" ][ "idle" ][ 1 ] = %corner_standR_alert_twitch01;
|
||||
level.drone_anims[ "axis" ][ "coverrightstand" ][ "idle" ][ 2 ] = %corner_standR_alert_twitch02;
|
||||
level.drone_anims[ "axis" ][ "coverrightstand" ][ "idle" ][ 3 ] = %corner_standR_alert_twitch04;
|
||||
level.drone_anims[ "axis" ][ "coverrightstand" ][ "hide_2_aim" ] = %corner_standR_trans_alert_2_B;
|
||||
level.drone_anims[ "axis" ][ "coverrightstand" ][ "aim_2_hide" ] = %corner_standR_trans_B_2_alert;
|
||||
level.drone_anims[ "axis" ][ "coverrightstand" ][ "reload" ] = %corner_standR_reload_v1;
|
||||
level.drone_anims[ "axis" ][ "coverrightstand" ][ "fire" ] = %exposed_aim_5;
|
||||
level.drone_anims[ "axis" ][ "coverrightstand" ][ "death" ] = %corner_standR_deathB;
|
||||
//level.drone_anims[ "axis" ][ "coverrightstand" ][ "arrival" ] = %corner_standR_trans_IN_2;
|
||||
|
||||
level.drone_anims[ "axis" ][ "coverrightcrouch" ][ "idle" ][ 0 ] = %CornerCrR_alert_idle;
|
||||
level.drone_anims[ "axis" ][ "coverrightcrouch" ][ "idle" ][ 1 ] = %CornerCrR_alert_twitch_v1;
|
||||
level.drone_anims[ "axis" ][ "coverrightcrouch" ][ "idle" ][ 2 ] = %CornerCrR_alert_twitch_v2;
|
||||
level.drone_anims[ "axis" ][ "coverrightcrouch" ][ "idle" ][ 3 ] = %CornerCrR_alert_twitch_v3;
|
||||
level.drone_anims[ "axis" ][ "coverrightcrouch" ][ "hide_2_aim" ] = %CornerCrR_alert_2_lean;
|
||||
level.drone_anims[ "axis" ][ "coverrightcrouch" ][ "aim_2_hide" ] = %CornerCrR_lean_2_alert;
|
||||
level.drone_anims[ "axis" ][ "coverrightcrouch" ][ "reload" ] = %CornerCrR_reloadA;
|
||||
level.drone_anims[ "axis" ][ "coverrightcrouch" ][ "death" ] = %exposed_crouch_death_fetal;
|
||||
//level.drone_anims[ "axis" ][ "coverrightcrouch" ][ "arrival" ] = %CornerCrR_trans_IN_M;
|
||||
|
||||
|
||||
level.drone_anims[ "axis" ][ "coverguard" ][ "idle" ][ 0 ] = %exposed_crouch_idle_twitch_v2;
|
||||
level.drone_anims[ "axis" ][ "coverguard" ][ "idle" ][ 1 ] = %exposed_crouch_idle_twitch_v3;
|
||||
level.drone_anims[ "axis" ][ "coverguard" ][ "reload" ] = %exposed_crouch_reload;
|
||||
level.drone_anims[ "axis" ][ "coverguard" ][ "fire" ] = %exposed_crouch_aim_5;
|
||||
level.drone_anims[ "axis" ][ "coverguard" ][ "death" ] = %exposed_crouch_death_fetal;
|
||||
//level.drone_anims[ "axis" ][ "coverguard" ][ "arrival" ] = %run_2_crouch_F;
|
||||
|
||||
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "idle" ][ 0 ] = %prone_reaction_A;
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "idle" ][ 1 ] = %prone_twitch_ammocheck;
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "idle" ][ 2 ] = %prone_twitch_scan;
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "idle" ][ 3 ] = %prone_twitch_look;
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "idle" ][ 4 ] = %prone_twitch_lookup;
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "hide_2_aim" ] = %prone_2_crouch;
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "aim_2_hide" ] = %crouch_2_prone;
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "reload" ] = %prone_reload;
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "fire" ] = %prone_fire_1;
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "fire_exposed" ] = %exposed_crouch_aim_5; //special case for when prone guys occassionally stand up to fire
|
||||
level.drone_anims[ "axis" ][ "coverprone" ][ "death" ] = %saw_gunner_prone_death;
|
||||
//level.drone_anims[ "axis" ][ "coverprone" ][ "arrival" ] = %crouchrun2prone_straight;
|
||||
|
||||
//team3 (?)
|
||||
level.drone_anims[ "team3" ][ "stand" ][ "idle" ] = %casual_stand_idle;
|
||||
level.drone_anims[ "team3" ][ "stand" ][ "run" ] = %run_lowready_F_relative;
|
||||
level.drone_anims[ "team3" ][ "stand" ][ "death" ] = %exposed_death;
|
||||
|
||||
|
||||
//muzzleflashes, etc
|
||||
level._effect[ "ak47_muzzleflash" ] = loadfx( "muzzleflashes/ak47_flash_wv" );
|
||||
level._effect[ "m16_muzzleflash" ] = loadfx( "muzzleflashes/m16_flash_wv" );
|
||||
|
||||
|
||||
// init the generic drone script
|
||||
maps\_drone::initGlobals();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
init()
|
||||
{
|
||||
// drone type specific stuff
|
||||
level.drone_anims[ "neutral" ][ "stand" ][ "idle" ] = %casual_stand_idle;
|
||||
level.drone_anims[ "neutral" ][ "stand" ][ "run" ] = %unarmed_scared_run;
|
||||
level.drone_anims[ "neutral" ][ "stand" ][ "death" ] = %exposed_death;
|
||||
|
||||
level.attachPropsFunction = animscripts\civilian\civilian_init::attachProps;
|
||||
|
||||
// init the generic drone script
|
||||
maps\_drone::initGlobals();
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#include maps\_utility;
|
||||
#include maps\_anim;
|
||||
#include common_scripts\utility;
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
main( dialogue_array )
|
||||
{
|
||||
if ( isdefined( dialogue_array ) )
|
||||
{
|
||||
level.dynamic_run_speed_dialogue = dialogue_array;
|
||||
foreach ( value in dialogue_array )
|
||||
{
|
||||
level.scr_radio[ value ] = value;
|
||||
}
|
||||
}
|
||||
level.scr_anim[ "generic" ][ "DRS_sprint" ] = %sprint1_loop;
|
||||
level.scr_anim[ "generic" ][ "DRS_combat_jog" ] = %combat_jog;// patrol_jog;
|
||||
level.scr_anim[ "generic" ][ "DRS_run_2_stop" ] = %run_2_crouch_F; // run_2_stand_F_6;
|
||||
level.scr_anim[ "generic" ][ "DRS_stop_idle" ][ 0 ] = %exposed_crouch_aim_5; // stand_aim_straight; // casual_stand_idle
|
||||
|
||||
// level.scr_anim[ "generic" ][ "DRS_moveup" ] = % stand_exposed_wave_move_up;
|
||||
level.scr_anim[ "generic" ][ "signal_go" ] = %CQB_stand_wave_go_v1;
|
||||
|
||||
level.drs_ahead_test = maps\_utility_code::dynamic_run_ahead_test;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
}
|
||||
|
||||
// Empty vehicle type is special cased in vehicles to not add a bunch of variables and stuff.
|
||||
|
||||
/*QUAKED script_vehicle_empty (1 0 0) (-16 -16 -24) (16 16 32) x SPAWNER
|
||||
defaultmdl="tag_origin"
|
||||
default:"vehicletype" "empty"
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+1279
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,102 @@
|
||||
#include common_scripts\utility;
|
||||
|
||||
/*******************
|
||||
|
||||
- prefabs/bookstore/escalator_up.map
|
||||
- prefabs/bookstore/escalator_down.map
|
||||
|
||||
These two prefabs are set up to work with the script.
|
||||
|
||||
TODO: Make them trigger or radius based so that they don't run all the time.
|
||||
|
||||
*******************/
|
||||
|
||||
init()
|
||||
{
|
||||
flag_init( "_escalator_on" );
|
||||
flag_set( "_escalator_on" );
|
||||
|
||||
level.escalator_movespeed = .5;
|
||||
array = getentarray( "escalator", "targetname" );
|
||||
array_thread( array, ::escalator_startup );
|
||||
}
|
||||
|
||||
escalator_startup()
|
||||
{
|
||||
step = self;
|
||||
|
||||
while ( isdefined( step.target ) )
|
||||
{
|
||||
step StartUsingLessFrequentLighting();
|
||||
step.true_origin = step.origin;
|
||||
step.next_step = getent( step.target, "targetname" );
|
||||
step = step.next_step;
|
||||
}
|
||||
|
||||
step.true_origin = step.origin;
|
||||
step.last = 1;
|
||||
step.next_step = self;
|
||||
|
||||
thread escalator_move( self );
|
||||
}
|
||||
|
||||
escalator_move( first_step )
|
||||
{
|
||||
step = first_step;
|
||||
first_origin = step.origin;
|
||||
|
||||
while ( flag( "_escalator_on" ) )
|
||||
{
|
||||
movespeed = level.escalator_movespeed;
|
||||
next_step = step.next_step;
|
||||
|
||||
step show();
|
||||
|
||||
if ( next_step != first_step )
|
||||
step moveto( next_step.true_origin, movespeed );
|
||||
else
|
||||
step.origin = first_origin;
|
||||
|
||||
if ( next_step == first_step )
|
||||
{
|
||||
step hide();
|
||||
step.true_origin = first_origin;
|
||||
first_step = step;
|
||||
wait movespeed;
|
||||
continue;
|
||||
}
|
||||
|
||||
step.true_origin = next_step.true_origin;
|
||||
step = next_step;
|
||||
}
|
||||
|
||||
step = first_step;
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
movespeed = 2;
|
||||
next_step = step.next_step;
|
||||
|
||||
step show();
|
||||
|
||||
step thread final_move( movespeed, next_step );
|
||||
|
||||
if ( next_step == first_step )
|
||||
{
|
||||
step hide();
|
||||
step.true_origin = first_origin;
|
||||
}
|
||||
|
||||
step.true_origin = next_step.true_origin;
|
||||
step = next_step;
|
||||
if( step == first_step )
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final_move( movespeed, next_step )
|
||||
{
|
||||
self moveto( next_step.true_origin, movespeed, 0, movespeed );
|
||||
wait movespeed;
|
||||
self moveto( self.origin, .05 );
|
||||
}
|
||||
+330
@@ -0,0 +1,330 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "f15", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_f15" );
|
||||
|
||||
//special for f15/////
|
||||
level._effect[ "engineeffect" ] = loadfx( "fire/jet_afterburner" );
|
||||
level._effect[ "afterburner" ] = loadfx( "fire/jet_afterburner_ignite" );
|
||||
level._effect[ "contrail" ] = loadfx( "smoke/jet_contrail" );
|
||||
////////////////////////
|
||||
|
||||
build_deathfx( "explosions/large_vehicle_explosion", undefined, "explo_metal_rand", undefined, undefined, undefined, undefined, undefined, undefined, 0 );
|
||||
build_life( 999, 500, 1500 );
|
||||
build_rumble( "mig_rumble", 0.1, 0.2, 11300, 0.05, 0.05 );
|
||||
build_team( "allies" );
|
||||
build_compassicon( "mig29", false );
|
||||
|
||||
randomStartDelay = randomfloatrange( 0, 1 );
|
||||
build_light( model, "wingtip_green", "TAG_LEFT_WINGTIP", "misc/aircraft_light_wingtip_green", "running", randomStartDelay );
|
||||
build_light( model, "tail_green", "TAG_LEFT_TAIL", "misc/aircraft_light_wingtip_green", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_red", "TAG_RIGHT_WINGTIP", "misc/aircraft_light_wingtip_red", "running", randomStartDelay );
|
||||
build_light( model, "tail_red", "TAG_RIGHT_TAIL", "misc/aircraft_light_wingtip_red", "running", randomStartDelay );
|
||||
build_light( model, "white_blink", "TAG_LIGHT_BELLY", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "landing_light01", "TAG_LIGHT_LANDING01", "misc/light_mig29_landing", "landing", 0.0 );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
thread playEngineEffects();
|
||||
thread playConTrail();
|
||||
thread landing_gear_up();
|
||||
maps\_vehicle::lights_on( "running" );
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
ropemodel = "rope_test";
|
||||
precachemodel( ropemodel );
|
||||
return positions;
|
||||
}
|
||||
|
||||
landing_gear_up()
|
||||
{
|
||||
self UseAnimTree( #animtree );
|
||||
self setanim( %mig_landing_gear_up );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 1;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
playEngineEffects()
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "stop_engineeffects" );
|
||||
|
||||
self ent_flag_init( "engineeffects" );
|
||||
self ent_flag_set( "engineeffects" );
|
||||
engineeffects = getfx( "engineeffect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self ent_flag_wait( "engineeffects" );
|
||||
playfxontag( engineeffects, self, "tag_engine_right" );
|
||||
playfxontag( engineeffects, self, "tag_engine_left" );
|
||||
self ent_flag_waitopen( "engineeffects" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_left" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_right" );
|
||||
}
|
||||
}
|
||||
|
||||
playAfterBurner()
|
||||
{
|
||||
//After Burners are pretty much like turbo boost. They don't use them all the time except when
|
||||
//bursts of speed are needed. Needs a cool sound when they're triggered. Currently, they are set
|
||||
//to be on all the time, but it would be cool to see them engauge as they fly away.
|
||||
self endon( "death" );
|
||||
self endon( "stop_afterburners" );
|
||||
|
||||
self ent_flag_init( "afterburners" );
|
||||
self ent_flag_set( "afterburners" );
|
||||
afterburners = getfx( "afterburner" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self ent_flag_wait( "afterburners" );
|
||||
playfxontag( afterburners, self, "tag_engine_right" );
|
||||
playfxontag( afterburners, self, "tag_engine_left" );
|
||||
self ent_flag_waitopen( "afterburners" );
|
||||
StopFXOnTag( afterburners, self, "tag_engine_left" );
|
||||
StopFXOnTag( afterburners, self, "tag_engine_right" );
|
||||
}
|
||||
}
|
||||
|
||||
playConTrail()
|
||||
{
|
||||
|
||||
|
||||
//This is a geoTrail effect that loops forever. It has to be enabled and disabled while playing as
|
||||
//one effect. It can't be played in a wait loop like other effects because a geo trail is one
|
||||
//continuous effect. ConTrails should only be played during high "G" or high speed maneuvers.
|
||||
tag1 = add_contrail( "tag_engine_right", 1 );
|
||||
tag2 = add_contrail( "tag_engine_left", -1 );
|
||||
contrail = getfx( "contrail" );
|
||||
|
||||
self endon( "death" );
|
||||
|
||||
|
||||
ent_flag_init( "contrails" );
|
||||
ent_flag_set( "contrails" );
|
||||
for ( ;; )
|
||||
{
|
||||
ent_flag_wait( "contrails" );
|
||||
playfxontag( contrail, tag1, "tag_origin" );
|
||||
playfxontag( contrail, tag2, "tag_origin" );
|
||||
ent_flag_waitopen( "contrails" );
|
||||
stopfxontag( contrail, tag1, "tag_origin" );
|
||||
stopfxontag( contrail, tag2, "tag_origin" );
|
||||
}
|
||||
|
||||
|
||||
// playfxontag( level._effect[ "contrail" ], self, "tag_engine_right" );
|
||||
// playfxontag( level._effect[ "contrail" ], self, "tag_engine_left" );
|
||||
}
|
||||
|
||||
add_contrail( fx_tag_name, offset )
|
||||
{
|
||||
// translate the posts into the proper positions for the effect
|
||||
fx_tag = spawn_tag_origin();
|
||||
fx_tag.origin = self getTagOrigin( fx_tag_name );
|
||||
fx_tag.angles = self getTagAngles( fx_tag_name );
|
||||
ent = spawnstruct();
|
||||
ent.entity = fx_tag;
|
||||
ent.forward = -156;
|
||||
ent.up = 0;
|
||||
ent.right = 224 * offset;
|
||||
ent.yaw = 0;
|
||||
ent.pitch = 0;
|
||||
ent translate_local();
|
||||
fx_tag LinkTo( self, fx_tag_name );
|
||||
return fx_tag;
|
||||
}
|
||||
|
||||
playerisclose( other )
|
||||
{
|
||||
infront = playerisinfront( other );
|
||||
if ( infront )
|
||||
dir = 1;
|
||||
else
|
||||
dir = -1;
|
||||
a = flat_origin( other.origin );
|
||||
b = a + vector_multiply( anglestoforward( flat_angle( other.angles ) ), ( dir * 100000 ) );
|
||||
point = pointOnSegmentNearestToPoint( a, b, level.player.origin );
|
||||
dist = distance( a, point );
|
||||
if ( dist < 3000 )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
playerisinfront( other )
|
||||
{
|
||||
forwardvec = anglestoforward( flat_angle( other.angles ) );
|
||||
normalvec = vectorNormalize( flat_origin( level.player.origin ) - other.origin );
|
||||
dot = vectordot( forwardvec, normalvec );
|
||||
if ( dot > 0 )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
plane_sound_node()
|
||||
{
|
||||
self waittill( "trigger", other );
|
||||
other endon( "death" );
|
||||
self thread plane_sound_node();// spawn new thread for next plane that passes through this pathnode
|
||||
other thread play_loop_sound_on_entity( "veh_f15_dist_loop" );
|
||||
while ( playerisinfront( other ) )
|
||||
wait .05;
|
||||
wait .5;// little delay for the boom
|
||||
other thread play_sound_in_space( "veh_f15_sonic_boom" );
|
||||
other waittill( "reached_end_node" );
|
||||
other stop_sound( "veh_f15_dist_loop" );
|
||||
other delete();
|
||||
}
|
||||
|
||||
plane_bomb_node()
|
||||
{
|
||||
level._effect[ "plane_bomb_explosion1" ] = loadfx( "explosions/airlift_explosion_large" );
|
||||
level._effect[ "plane_bomb_explosion2" ] = loadfx( "explosions/tanker_explosion" );
|
||||
self waittill( "trigger", other );
|
||||
other endon( "death" );
|
||||
self thread plane_bomb_node();// spawn new thread for next plane that passes through this pathnode
|
||||
|
||||
// get array of targets
|
||||
aBomb_targets = getentarray( self.script_linkTo, "script_linkname" );
|
||||
assertEx( isdefined( aBomb_targets ), "Plane bomb node at " + self.origin + " needs to script_linkTo at least one script_origin to use as a bomb target" );
|
||||
assertEx( aBomb_targets.size > 1, "Plane bomb node at " + self.origin + " needs to script_linkTo at least one script_origin to use as a bomb target" );
|
||||
|
||||
//sort array of targets from nearest to furthest to determine order of bombing
|
||||
aBomb_targets = get_array_of_closest( self.origin, aBomb_targets, undefined, aBomb_targets.size );
|
||||
iExplosionNumber = 0;
|
||||
|
||||
wait randomfloatrange( .3, .8 );
|
||||
for ( i = 0;i < aBomb_targets.size;i++ )
|
||||
{
|
||||
iExplosionNumber++ ;
|
||||
if ( iExplosionNumber == 3 )
|
||||
iExplosionNumber = 1;
|
||||
aBomb_targets[ i ] thread play_sound_on_entity( "airstrike_explosion" );
|
||||
//aBomb_targets[i] thread play_sound_on_entity( "rocket_explode_sand" );
|
||||
playfx( level._effect[ "plane_bomb_explosion" + iExplosionNumber ], aBomb_targets[ i ].origin );
|
||||
wait randomfloatrange( .3, 1.2 );
|
||||
}
|
||||
}
|
||||
|
||||
plane_bomb_cluster()
|
||||
{
|
||||
/*-----------------------
|
||||
WAIT FOR PLANE TO HIT NODE
|
||||
-------------------------*/
|
||||
self waittill( "trigger", other );
|
||||
other endon( "death" );
|
||||
plane = other;
|
||||
plane thread plane_bomb_cluster();// spawn new thread for next plane that passes through this pathnode
|
||||
|
||||
/*-----------------------
|
||||
SPAWN A BOMB MODEL
|
||||
-------------------------*/
|
||||
bomb = spawn( "script_model", plane.origin - ( 0, 0, 100 ) );
|
||||
bomb.angles = plane.angles;
|
||||
bomb setModel( "projectile_cbu97_clusterbomb" );
|
||||
|
||||
/*-----------------------
|
||||
LAUNCH FROM PLANE UNTIL CLOSE TO GROUND
|
||||
-------------------------*/
|
||||
vecForward = vector_multiply( anglestoforward( plane.angles ), 2 );
|
||||
vecUp = vector_multiply( anglestoup( plane.angles ), -0.2 ); // invert the up angles
|
||||
vec = [];
|
||||
for ( i = 0; i < 3; i++ )
|
||||
vec[ i ] = ( vecForward[ i ] + vecUp[ i ] ) / 2;
|
||||
vec = ( vec[ 0 ], vec[ 1 ], vec[ 2 ] );
|
||||
vec = vector_multiply( vec, 7000 );
|
||||
bomb moveGravity( vec, 2.0 );
|
||||
wait( 1.2 );
|
||||
|
||||
newBomb = spawn( "script_model", bomb.origin );
|
||||
newBomb setModel( "tag_origin" );
|
||||
newBomb.origin = bomb.origin;
|
||||
newBomb.angles = bomb.angles;
|
||||
wait( 0.05 );
|
||||
|
||||
bomb delete();
|
||||
bomb = newBomb;
|
||||
|
||||
/*-----------------------
|
||||
PLAY FX ON INVISIBLE BOMB
|
||||
-------------------------*/
|
||||
bombOrigin = bomb.origin;
|
||||
bombAngles = bomb.angles;
|
||||
playfxontag( level.airstrikefx, bomb, "tag_origin" );
|
||||
|
||||
wait 1.6;
|
||||
repeat = 12;
|
||||
minAngles = 5;
|
||||
maxAngles = 55;
|
||||
angleDiff = ( maxAngles - minAngles ) / repeat;
|
||||
|
||||
for ( i = 0; i < repeat; i++ )
|
||||
{
|
||||
traceDir = anglesToForward( bombAngles + ( maxAngles - ( angleDiff * i ), randomInt( 10 ) - 5, 0 ) );
|
||||
traceEnd = bombOrigin + vector_multiply( traceDir, 10000 );
|
||||
trace = bulletTrace( bombOrigin, traceEnd, false, undefined );
|
||||
|
||||
traceHit = trace[ "position" ];
|
||||
|
||||
radiusDamage( traceHit + ( 0, 0, 16 ), 512, 400, 30 );// targetpos, radius, maxdamage, mindamage
|
||||
|
||||
if ( i%3 == 0 )
|
||||
{
|
||||
thread play_sound_in_space( "airstrike_explosion", traceHit );
|
||||
playRumbleOnPosition( "artillery_rumble", traceHit );
|
||||
earthquake( 0.7, 0.75, traceHit, 1000 );
|
||||
}
|
||||
|
||||
wait( 0.75 / repeat );
|
||||
}
|
||||
wait( 1.0 );
|
||||
bomb delete();
|
||||
|
||||
}
|
||||
|
||||
stop_sound( alias )
|
||||
{
|
||||
self notify( "stop sound" + alias );
|
||||
}
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_f15 (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_f15::main( "vehicle_f15" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_f15
|
||||
sound,vehicle_f15,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_f15"
|
||||
default:"vehicletype" "f15"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,64 @@
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type, no_death )
|
||||
{
|
||||
build_template( "firetruck", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_deathmodel( "vehicle_ambulance_swat" );
|
||||
build_radiusdamage( ( 0, 0, 32 ), 300, 200, 100, false );
|
||||
build_drive( %uaz_driving_idle_forward, %uaz_driving_idle_backward, 10 );
|
||||
build_deathquake( 1, 1.6, 500 );
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "axis" );
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 2;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "TAG_DRIVER";
|
||||
positions[ 1 ].sittag = "TAG_PASSENGER";
|
||||
|
||||
positions[ 0 ].idle = %uaz_driver_idle_drive;
|
||||
positions[ 1 ].idle = %uaz_passenger_idle_drive;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
/*QUAKED script_vehicle_firetruck (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_firetruck::main( "vehicle_firetruck" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_firetruck
|
||||
sound,vehicle_firetruck,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_firetruck"
|
||||
default:"vehicletype" "firetruck"
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_utility;
|
||||
#include maps\_vehicle;
|
||||
#include common_scripts\utility;
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
if ( !isdefined( level._effect ) )
|
||||
level._effect = [];
|
||||
level._effect[ "flare_runner_intro" ] = loadfx( "misc/flare_start" );
|
||||
level._effect[ "flare_runner" ] = loadfx( "misc/flare" );
|
||||
level._effect[ "flare_runner_fizzout" ] = loadfx( "misc/flare_end" );
|
||||
|
||||
build_template( "flare", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
//health, optional_min, optional_max
|
||||
build_life( 9999 );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
}
|
||||
// below is the script for the in game flare effect
|
||||
|
||||
merge_suncolor( delay, timer, rgb1, rgb2 )
|
||||
{
|
||||
wait( delay );
|
||||
timer = timer * 20;
|
||||
suncolor = [];
|
||||
|
||||
for ( i = 0; i < timer; i++ )
|
||||
{
|
||||
dif = i / timer;
|
||||
level.thedif = dif;
|
||||
c = [];
|
||||
for ( p = 0; p < 3; p++ )
|
||||
{
|
||||
c[ p ] = rgb2[ p ] * dif + rgb1[ p ] * ( 1 - dif );
|
||||
}
|
||||
|
||||
level.sun_color = ( c[ 0 ], c[ 1 ], c[ 2 ] );
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
|
||||
merge_sunsingledvar( dvar, delay, timer, l1, l2 )
|
||||
{
|
||||
// level notify( dvar + "new_lightmerge" );
|
||||
// level endon( dvar + "new_lightmerge" );
|
||||
|
||||
setsaveddvar( dvar, l1 );
|
||||
wait( delay );
|
||||
timer = timer * 20;
|
||||
suncolor = [];
|
||||
|
||||
/*
|
||||
0 i
|
||||
1 timer*20
|
||||
*/
|
||||
for ( i = 0; i < timer; i++ )
|
||||
{
|
||||
dif = i / timer;
|
||||
level.thedif = dif;
|
||||
ld = l2 * dif + l1 * ( 1 - dif );
|
||||
|
||||
setsaveddvar( dvar, ld );
|
||||
wait( 0.05 );
|
||||
}
|
||||
|
||||
setsaveddvar( dvar, l2 );
|
||||
|
||||
}
|
||||
|
||||
merge_sunbrightness( delay, timer, l1, l2 )
|
||||
{
|
||||
wait( delay );
|
||||
timer = timer * 20;
|
||||
suncolor = [];
|
||||
for ( i = 0; i < timer; i++ )
|
||||
{
|
||||
dif = i / timer;
|
||||
level.thedif = dif;
|
||||
ld = l2 * dif + l1 * ( 1 - dif );
|
||||
|
||||
level.sun_brightness = ld;
|
||||
wait( 0.05 );
|
||||
}
|
||||
level.sun_brightness = l2;
|
||||
}
|
||||
|
||||
|
||||
combine_sunlight_and_brightness()
|
||||
{
|
||||
level endon( "stop_combining_sunlight_and_brightness" );
|
||||
wait( 0.05 );// wait for the direction to start lerping
|
||||
for ( ;; )
|
||||
{
|
||||
brightness = level.sun_brightness;
|
||||
// add some flicker
|
||||
if ( brightness > 1 )
|
||||
brightness += randomfloat( 0.2 );
|
||||
|
||||
rgb = vector_Multiply( level.sun_color, brightness );
|
||||
setSunLight( rgb[ 0 ], rgb[ 1 ], rgb[ 2 ] );
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
|
||||
flare_path()
|
||||
{
|
||||
thread goPath( self );
|
||||
flag_wait( "flare_stop_setting_sundir" );
|
||||
self delete();
|
||||
}
|
||||
|
||||
flare_initial_fx()
|
||||
{
|
||||
// initial effect
|
||||
model = spawn( "script_model", ( 0, 0, 0 ) );
|
||||
model setModel( "tag_origin" );
|
||||
model linkto( self, "tag_origin", ( 0, 0, 0 ), ( 0, 0, 0 ) );
|
||||
playfxontag( level._effect[ "flare_runner_intro" ], model, "tag_origin" );
|
||||
self waittillmatch( "noteworthy", "flare_intro_node" );
|
||||
model delete();
|
||||
}
|
||||
|
||||
flare_explodes()
|
||||
{
|
||||
flag_set( "flare_start_setting_sundir" );
|
||||
// flare explodes
|
||||
// the amount of time for the ent to traverse the arc
|
||||
level.sun_brightness = 1;
|
||||
// merge our various sun values over time
|
||||
// first merge in the sun color/light settings
|
||||
level.red_suncolor = ( 0.8, 0.4, 0.4 );
|
||||
level.original_suncolor = getMapSunLight();
|
||||
level.sun_color = level.original_suncolor;
|
||||
thread merge_sunsingledvar( "sm_sunSampleSizeNear", 0, 0.25, 0.25, 1 );
|
||||
|
||||
thread combine_sunlight_and_brightness();
|
||||
thread merge_suncolor( 0, 0.25, level.original_sunColor, level.red_suncolor );
|
||||
thread merge_sunbrightness( 0, 0.25, 1, 3 );
|
||||
|
||||
model2 = spawn( "script_model", ( 0, 0, 0 ) );
|
||||
model2 setModel( "tag_origin" );
|
||||
model2 linkto( self, "tag_origin", ( 0, 0, 0 ), ( 0, 0, 0 ) );
|
||||
playfxontag( level._effect[ "flare_runner" ], model2, "tag_origin" );
|
||||
self waittillmatch( "noteworthy", "flare_fade_node" );
|
||||
|
||||
// wait( 1 );
|
||||
model2 delete();
|
||||
}
|
||||
|
||||
flare_burns_out()
|
||||
{
|
||||
// flare begins to phyzl out
|
||||
model3 = spawn( "script_model", ( 0, 0, 0 ) );
|
||||
model3 setModel( "tag_origin" );
|
||||
model3 linkto( self, "tag_origin", ( 0, 0, 0 ), ( 0, 0, 0 ) );
|
||||
playfxontag( level._effect[ "flare_runner_fizzout" ], model3, "tag_origin" );
|
||||
//wait( 0.3 );
|
||||
|
||||
|
||||
// brightness goes down then up
|
||||
thread merge_sunsingledvar( "sm_sunSampleSizeNear", 0, 1, 1, 0.25 );
|
||||
thread merge_sunbrightness( 0, 1, 3, 0 );
|
||||
thread merge_suncolor( 0, 1, level.red_suncolor, level.original_suncolor );
|
||||
thread merge_sunbrightness( 1, 1, 0, 1 );
|
||||
|
||||
model3 delete();
|
||||
wait( 1 );
|
||||
flag_set( "flare_stop_setting_sundir" );
|
||||
resetSunDirection();
|
||||
wait( 1 );
|
||||
level notify( "stop_combining_sunlight_and_brightness" );
|
||||
waittillframeend;
|
||||
|
||||
// make sure it gets set to the price final direction settings, or the lightmaps will be broken
|
||||
resetSunLight();
|
||||
|
||||
flag_set( "flare_complete" );
|
||||
}
|
||||
|
||||
flare_fx()
|
||||
{
|
||||
flare_initial_fx();
|
||||
flare_explodes();
|
||||
flare_burns_out();
|
||||
}
|
||||
|
||||
flag_flare( msg )
|
||||
{
|
||||
if ( !isdefined( level.flag[ msg ] ) )
|
||||
{
|
||||
flag_init( msg );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
flare_from_targetname( targetname )
|
||||
{
|
||||
|
||||
flare = spawn_vehicle_from_targetname( targetname );
|
||||
|
||||
flag_flare( "flare_in_use" );
|
||||
flag_flare( "flare_complete" );
|
||||
flag_flare( "flare_stop_setting_sundir" );
|
||||
flag_flare( "flare_start_setting_sundir" );
|
||||
|
||||
flag_waitopen( "flare_in_use" );
|
||||
flag_set( "flare_in_use" );
|
||||
|
||||
resetSunLight();
|
||||
resetSunDirection();
|
||||
flare thread flare_path();
|
||||
flare thread flare_fx();
|
||||
|
||||
// get the final point that our relative sun needs to point towards to make it equal the maps sun dir
|
||||
sundir = getMapSunDirection();
|
||||
angles = sundir;
|
||||
vec = vector_multiply( angles, -100 );
|
||||
|
||||
flag_wait( "flare_start_setting_sundir" );
|
||||
|
||||
sunPointsTo = getent( flare.script_linkto, "script_linkname" ).origin;
|
||||
|
||||
angles = vectortoangles( flare.origin - sunPointsTo );
|
||||
oldForward = anglestoforward( angles );
|
||||
for ( ;; )
|
||||
{
|
||||
wait( 0.05 );
|
||||
if ( flag( "flare_stop_setting_sundir" ) )
|
||||
break;
|
||||
angles = vectortoangles( flare.origin - sunPointsTo );
|
||||
forward = anglestoforward( angles );
|
||||
lerpSunDirection( oldForward, forward, 0.05 );
|
||||
oldForward = forward;
|
||||
}
|
||||
|
||||
flag_wait( "flare_complete" );
|
||||
waittillframeend;// otherwise other things waiting on flare complete wont continue
|
||||
flag_clear( "flare_complete" );
|
||||
flag_clear( "flare_stop_setting_sundir" );
|
||||
flag_clear( "flare_start_setting_sundir" );
|
||||
resetSunLight();
|
||||
resetSunDirection();
|
||||
flag_clear( "flare_in_use" );
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include maps\_anim;
|
||||
#include maps\_utility;
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
assertmsg( "_flashbang::main is deprecated, please remove your references!" );
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
//causes objects to bob like in water...simulates a ripple from a point in space and causes a uniform sin wave effect on the objects.
|
||||
|
||||
//range = the height range to bob up and down
|
||||
//freq = how often the objects bob up and down per time freq of 1 would mean it would bomb up in 1 sec and down the next. freq of .5 would mean it would bob up once every 2 sec and down the next 2
|
||||
//wavelength = the size of the waves caused by the "ripple"
|
||||
//rotation = the amount the object rotates off its center as it bobs
|
||||
//origin = the origin of the ripple...if you want it to look like waves - should be kept far away from the objects.
|
||||
#include common_scripts\utility;
|
||||
main( range, freq, wavelength, rotation, origin )
|
||||
{
|
||||
floaters = getentarray( "script_floater", "targetname" );
|
||||
|
||||
if ( !floaters.size )
|
||||
return;
|
||||
|
||||
//defaults
|
||||
_range = 10;
|
||||
_freq = .5;
|
||||
_wavelength = 50;
|
||||
_origin = ( 0, 0, 0 );
|
||||
_rotation = 10;
|
||||
|
||||
//intended variables
|
||||
if ( isdefined( range ) )
|
||||
_range = range;
|
||||
if ( isdefined( freq ) )
|
||||
_freq = freq;
|
||||
if ( isdefined( wavelength ) )
|
||||
_wavelength = wavelength;
|
||||
if ( isdefined( origin ) )
|
||||
_origin = origin;
|
||||
if ( isdefined( rotation ) )
|
||||
_rotation = rotation;
|
||||
|
||||
for ( i = 0;i < floaters.size;i++ )
|
||||
floaters[ i ] thread floater_think( _range, _freq, _wavelength, _rotation, _origin );
|
||||
}
|
||||
|
||||
floater_think( range, freq, wavelength, rotation, origin )
|
||||
{
|
||||
self.range = range;
|
||||
self.time = 1 / freq;
|
||||
self.acc = self.time * .25;
|
||||
center = self getorigin();
|
||||
|
||||
//convert our wavelength into a range of degrees
|
||||
//find out distance (degrees) away from a reference
|
||||
//where are we on the sign wave? (what height)
|
||||
conv_fac = 360 / wavelength;
|
||||
dist = distance( center, origin );
|
||||
degrees = dist * conv_fac;
|
||||
frac = sin( degrees );
|
||||
|
||||
//are we going up or down
|
||||
if ( cos( degrees ) < 0 )
|
||||
self.range = -1 * self.range;
|
||||
|
||||
org = spawn( "script_origin", center );
|
||||
self linkto( org );
|
||||
|
||||
angles = vectortoangles( center - origin );
|
||||
self.nangles = org.angles;
|
||||
org.angles = org.angles + ( rotation, rotation * .25, angles[ 2 ] );
|
||||
self.rangles = org.angles;
|
||||
|
||||
self thread floater_move( frac, org );
|
||||
self thread floater_bob( frac, org );
|
||||
}
|
||||
|
||||
floater_bob( frac, org )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "stop_float_script" );
|
||||
wait( abval( self.time * frac ) );
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
self.rangles = vector_multiply( self.rangles, -1 );
|
||||
org rotateto( self.rangles, self.time, self.acc, self.acc );
|
||||
org waittill( "rotatedone" );
|
||||
}
|
||||
}
|
||||
|
||||
floater_move( frac, org )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "stop_float_script" );
|
||||
wait( abval( self.time * frac ) );
|
||||
org moveZ( self.range * .5, self.time * .5, self.acc, self.acc );
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
org waittill( "movedone" );
|
||||
self.range = -1 * self.range;
|
||||
org moveZ( self.range, self.time, self.acc, self.acc );
|
||||
}
|
||||
}
|
||||
|
||||
abval( num )
|
||||
{
|
||||
if ( num < 0 )
|
||||
return( -1 * num );
|
||||
else
|
||||
return num;
|
||||
}
|
||||
@@ -0,0 +1,358 @@
|
||||
// 200 participation points are given to the player for killing an enemy
|
||||
// 800 participation points are taken from the player for killing a friendly
|
||||
// friendly damage removes points based on amount of damage done and distance
|
||||
// a max of 1000 points is allowed
|
||||
// the player will fail the mission when level.friendlyfire["min_participation"] is reached
|
||||
#include maps\_utility;
|
||||
main()
|
||||
{
|
||||
level.friendlyfire[ "min_participation" ] = -200; // when the player hit this number of participation points the mission is failed
|
||||
level.friendlyfire[ "max_participation" ] = 1000; // the player will stop gaining participation points once this amount is earned
|
||||
level.friendlyfire[ "enemy_kill_points" ] = 250; // this many participation points are earned for killing an enemy
|
||||
level.friendlyfire[ "friend_kill_points" ] = -650; // participation point penalty for killing a friendly
|
||||
level.friendlyfire[ "point_loss_interval" ] = 1.25; // amount of time a point lasts
|
||||
|
||||
level.player.participation = 0;
|
||||
|
||||
level.friendlyFireDisabled = 0;
|
||||
level.friendlyFireDisabledForDestructible = 0;// don't ever set this, it's used internally only and shouldn't be set by your script
|
||||
SetDvarIfUninitialized( "friendlyfire_dev_disabled", "0" );
|
||||
|
||||
common_scripts\utility::flag_init( "friendly_fire_warning" );
|
||||
|
||||
thread debug_friendlyfire();
|
||||
thread participation_point_flattenOverTime();
|
||||
}
|
||||
|
||||
debug_friendlyfire()
|
||||
{
|
||||
/#
|
||||
SetDvarIfUninitialized( "debug_friendlyfire", "0" );
|
||||
|
||||
friendly_fire = NewHudElem();
|
||||
friendly_fire.alignX = "right";
|
||||
friendly_fire.alignY = "middle";
|
||||
friendly_fire.x = 620;
|
||||
friendly_fire.y = 100;
|
||||
friendly_fire.fontScale = 2;
|
||||
friendly_fire.alpha = 0;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
if ( GetDebugDvar( "debug_friendlyfire" ) == "1" )
|
||||
friendly_fire.alpha = 1;
|
||||
else
|
||||
friendly_fire.alpha = 0;
|
||||
|
||||
friendly_fire SetValue( level.player.participation );
|
||||
wait 0.25;
|
||||
}
|
||||
#/
|
||||
}
|
||||
|
||||
// every entity that influences friedly fire should run this thread (ai of both teams, vehicles of both teams)
|
||||
friendly_fire_think( entity )
|
||||
{
|
||||
if ( !isdefined( entity ) )
|
||||
return;
|
||||
if ( !isdefined( entity.team ) )
|
||||
entity.team = "allies";
|
||||
|
||||
if ( IsDefined( level.no_friendly_fire_penalty ) )
|
||||
return;
|
||||
|
||||
// if the mission is failed from another entity running this function then end this one
|
||||
level endon( "mission failed" );
|
||||
|
||||
// wait until this entity dies
|
||||
level thread notifyDamage( entity );
|
||||
level thread notifyDamageNotDone( entity );
|
||||
level thread notifyDeath( entity );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
if ( !isdefined( entity ) )
|
||||
return;
|
||||
|
||||
if ( entity.health <= 0 )
|
||||
return;
|
||||
|
||||
entity waittill( "friendlyfire_notify", damage, attacker, direction, point, method, weaponName );
|
||||
|
||||
if ( !isdefined( entity ) )
|
||||
return;
|
||||
|
||||
// if we dont know who the attacker is we can't do much, so ignore it. This is seldom to happen, but not impossible
|
||||
if ( !isdefined( attacker ) )
|
||||
continue;
|
||||
|
||||
// check to see if the death was caused by the player or the players turret
|
||||
bPlayersDamage = false;
|
||||
|
||||
if ( !isdefined( weaponName ) )
|
||||
weaponName = entity.damageweapon;
|
||||
|
||||
if ( IsPlayer( attacker ) )
|
||||
{
|
||||
bPlayersDamage = true;
|
||||
|
||||
// player shot a red barrel or something similar and it blew up and damaged/killed this guy so just ignore it
|
||||
if ( isdefined( weaponName ) && ( weaponName == "none" ) )
|
||||
bPlayersDamage = false;
|
||||
|
||||
// code doesn't give the correct weaponname on damage and death notifies when on a turret, so we have to workaround it here
|
||||
if ( attacker isUsingTurret() )
|
||||
bPlayersDamage = true;
|
||||
}
|
||||
else
|
||||
if ( ( IsDefined( attacker.code_classname ) ) && ( attacker.code_classname == "script_vehicle" ) )
|
||||
{
|
||||
owner = attacker GetVehicleOwner();
|
||||
if ( ( IsDefined( owner ) ) && ( IsPlayer( owner ) ) )
|
||||
bPlayersDamage = true;
|
||||
}
|
||||
|
||||
// if the player didn't cause the damage then disregard
|
||||
if ( !bPlayersDamage )
|
||||
continue;
|
||||
|
||||
if ( !isdefined( entity.team ) )
|
||||
continue;
|
||||
|
||||
same_team = entity.team == level.player.team;
|
||||
|
||||
civilianKilled = undefined;
|
||||
if( level.script != "airport" )
|
||||
civilianKilled = IsSubStr( entity.classname, "civilian" );
|
||||
else
|
||||
civilianKilled = false;
|
||||
|
||||
killed = damage == -1;
|
||||
|
||||
// if an enemy was killed then incriment the players participation score
|
||||
if ( !same_team && !civilianKilled )
|
||||
{
|
||||
if ( killed )
|
||||
{
|
||||
level.player.participation += level.friendlyfire[ "enemy_kill_points" ];
|
||||
participation_point_cap();
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
//player killed/damaged a friendly
|
||||
if ( IsDefined( entity.no_friendly_fire_penalty ) )
|
||||
continue;
|
||||
|
||||
if ( ( method == "MOD_PROJECTILE_SPLASH" ) && ( IsDefined( level.no_friendly_fire_splash_damage ) ) )
|
||||
continue;
|
||||
|
||||
// don't cause friendly fire from claymores because it's probably the AI's fault not the players
|
||||
if ( IsDefined( weaponName ) && ( weaponName == "claymore" ) )
|
||||
continue;
|
||||
|
||||
if ( killed )
|
||||
{
|
||||
level.player.participation += level.friendlyfire[ "friend_kill_points" ];
|
||||
}
|
||||
else
|
||||
{
|
||||
// friendly was damaged - figure out how many participation points to remove
|
||||
level.player.participation -= damage;
|
||||
}
|
||||
|
||||
participation_point_cap();
|
||||
|
||||
// dont fail the mission if death was caused by a grenade that was cooking durring an autosave
|
||||
if ( check_grenade( entity, method ) && savecommit_afterGrenade() )
|
||||
{
|
||||
if ( killed )
|
||||
return;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
// fail the mission if the players participation has reached the minimum
|
||||
friendly_fire_checkPoints( civilianKilled );
|
||||
}
|
||||
}
|
||||
|
||||
friendly_fire_checkPoints( civilianKilled )
|
||||
{
|
||||
if ( ( IsDefined( level.failOnFriendlyFire ) ) && ( level.failOnFriendlyFire ) )
|
||||
{
|
||||
level thread missionfail( civilianKilled );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( level.friendlyFireDisabledForDestructible == 1 )
|
||||
return;
|
||||
|
||||
if ( level.friendlyFireDisabled == 1 )
|
||||
return;
|
||||
|
||||
if ( level.player.participation <= ( level.friendlyfire[ "min_participation" ] ) )
|
||||
level thread missionfail( civilianKilled );
|
||||
}
|
||||
|
||||
check_grenade( entity, method )
|
||||
{
|
||||
if ( !isdefined( entity ) )
|
||||
return false;
|
||||
|
||||
// check if the entity was killed by a grenade
|
||||
wasGrenade = false;
|
||||
if ( ( IsDefined( entity.damageweapon ) ) && ( entity.damageweapon == "none" ) )
|
||||
wasGrenade = true;
|
||||
if ( ( IsDefined( method ) ) && ( method == "MOD_GRENADE_SPLASH" ) )
|
||||
wasGrenade = true;
|
||||
|
||||
// if the entity was not killed by a grenade then exit
|
||||
return wasGrenade;
|
||||
}
|
||||
|
||||
savecommit_afterGrenade()
|
||||
{
|
||||
currentTime = GetTime();
|
||||
if ( currentTime < 4500 )
|
||||
{
|
||||
PrintLn( "^3aborting friendly fire because the level just loaded and saved and could cause a autosave grenade loop" );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
if ( ( currentTime - level.lastAutoSaveTime ) < 4500 )
|
||||
{
|
||||
PrintLn( "^3aborting friendly fire because it could be caused by an autosave grenade loop" );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
participation_point_cap()
|
||||
{
|
||||
if ( level.player.participation > level.friendlyfire[ "max_participation" ] )
|
||||
level.player.participation = level.friendlyfire[ "max_participation" ];
|
||||
if ( level.player.participation < level.friendlyfire[ "min_participation" ] )
|
||||
level.player.participation = level.friendlyfire[ "min_participation" ];
|
||||
}
|
||||
|
||||
participation_point_flattenOverTime()
|
||||
{
|
||||
level endon( "mission failed" );
|
||||
for ( ;; )
|
||||
{
|
||||
if ( level.player.participation > 0 )
|
||||
{
|
||||
level.player.participation--;
|
||||
}
|
||||
else if ( level.player.participation < 0 )
|
||||
{
|
||||
level.player.participation++;
|
||||
}
|
||||
wait level.friendlyfire[ "point_loss_interval" ];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TurnBackOn()
|
||||
{
|
||||
level.friendlyFireDisabled = 0;
|
||||
}
|
||||
|
||||
|
||||
TurnOff()
|
||||
{
|
||||
level.friendlyFireDisabled = 1;
|
||||
}
|
||||
|
||||
|
||||
missionfail( civilianKilled )
|
||||
{
|
||||
if ( !isdefined( civilianKilled ) )
|
||||
civilianKilled = false;
|
||||
|
||||
if ( level.script == "airport" )
|
||||
{
|
||||
if ( civilianKilled )
|
||||
return;
|
||||
|
||||
common_scripts\utility::flag_set( "friendly_fire_warning" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( GetDvar( "friendlyfire_dev_disabled" ) == "1" )
|
||||
return;
|
||||
|
||||
level.player endon( "death" );
|
||||
level endon( "mine death" );
|
||||
level notify( "mission failed" );
|
||||
level notify( "friendlyfire_mission_fail" );
|
||||
|
||||
waittillframeend;
|
||||
|
||||
SetSavedDvar( "hud_missionFailed", 1 );
|
||||
|
||||
if ( IsDefined( level.player.failingMission ) )
|
||||
return;
|
||||
|
||||
if ( civilianKilled )
|
||||
// You shot a civilian. Watch your fire!
|
||||
SetDvar( "ui_deadquote", &"SCRIPT_MISSIONFAIL_CIVILIAN_KILLED" ); // You shot a civilian. Watch your fire!
|
||||
else if ( IsDefined( level.custom_friendly_fire_message ) )
|
||||
SetDvar( "ui_deadquote", level.custom_friendly_fire_message ); // friendly fire will not be tolerated
|
||||
else if ( level.campaign == "british" )
|
||||
// Friendly fire will not be tolerated!
|
||||
SetDvar( "ui_deadquote", &"SCRIPT_MISSIONFAIL_KILLTEAM_BRITISH" ); // Friendly fire will not be tolerated!
|
||||
else if ( level.campaign == "russian" )
|
||||
// You are a traitor to the motherland!
|
||||
SetDvar( "ui_deadquote", &"SCRIPT_MISSIONFAIL_KILLTEAM_RUSSIAN" ); // You are a traitor to the motherland!
|
||||
else
|
||||
// Friendly fire will not be tolerated!
|
||||
SetDvar( "ui_deadquote", &"SCRIPT_MISSIONFAIL_KILLTEAM_AMERICAN" ); // Friendly fire will not be tolerated!
|
||||
|
||||
// shader if specified
|
||||
if ( IsDefined( level.custom_friendly_fire_shader ) )
|
||||
thread maps\_load::special_death_indicator_hudelement( level.custom_friendly_fire_shader, 64, 64, 0 );
|
||||
|
||||
//logString( "failed mission: Friendly fire" );
|
||||
|
||||
maps\_utility::missionFailedWrapper();
|
||||
}
|
||||
|
||||
notifyDamage( entity )
|
||||
{
|
||||
level endon( "mission failed" );
|
||||
entity endon( "death" );
|
||||
for ( ;; )
|
||||
{
|
||||
entity waittill( "damage", damage, attacker, direction, point, method, modelName, tagName, partName, dFlags, weaponName );
|
||||
entity notify( "friendlyfire_notify", damage, attacker, direction, point, method, weaponName );
|
||||
}
|
||||
}
|
||||
|
||||
notifyDamageNotDone( entity )
|
||||
{
|
||||
level endon( "mission failed" );
|
||||
entity waittill( "damage_notdone", damage, attacker, direction, point, method );
|
||||
entity notify( "friendlyfire_notify", -1, attacker, undefined, undefined, method );
|
||||
}
|
||||
|
||||
notifyDeath( entity )
|
||||
{
|
||||
level endon( "mission failed" );
|
||||
entity waittill( "death", attacker, method, weaponName );
|
||||
entity notify( "friendlyfire_notify", -1, attacker, undefined, undefined, method, weaponName );
|
||||
}
|
||||
|
||||
detectFriendlyFireOnEntity( entity )
|
||||
{
|
||||
/*
|
||||
if ( !isdefined( entity ) )
|
||||
return;
|
||||
AssertEx( IsDefined( entity.team ), "You must set .team to allies or axis for an entity calling detectFriendlyFire()" );
|
||||
|
||||
entity SetCanDamage( true );
|
||||
level thread friendly_fire_think( entity );
|
||||
*/
|
||||
}
|
||||
+259
@@ -0,0 +1,259 @@
|
||||
#include common_scripts\utility;
|
||||
#include common_scripts\_fx;
|
||||
#include common_scripts\_createfx;
|
||||
#include maps\_utility;
|
||||
#include maps\_createfx;
|
||||
|
||||
/*
|
||||
****************************************************************************************************************
|
||||
OneShotfx: Fires an effect once.
|
||||
maps\_fx::OneShotfx( effectname, (x y z), predelay);
|
||||
|
||||
Example:
|
||||
maps\_fx::OneShotfx(level.medFire, // Medium fire effect
|
||||
(-701, -18361, 148), // Origin
|
||||
5); // Wait 5 seconds before doing effect
|
||||
****************************************************************************************************************
|
||||
|
||||
|
||||
****************************************************************************************************************
|
||||
Loopfx: Loops an effect with a waittime.
|
||||
maps\_fx::loopfx( effectname, (x y z), delay_between_shots);
|
||||
|
||||
Example:
|
||||
maps\_fx::loopfx(level.medFire, // Medium fire effect
|
||||
(-701, -18361, 148), // Origin
|
||||
0.3); // Wait 0.3 seconds between shots
|
||||
****************************************************************************************************************
|
||||
|
||||
|
||||
****************************************************************************************************************
|
||||
GunFireLoopfx: Simulates bursts of fire.
|
||||
maps\_fx::gunfireloopfx(fxId, fxPos, shotsMin, shotsMax, shotdelayMin, shotdelayMax, betweenSetsMin, betweenSetsMax)
|
||||
|
||||
Example:
|
||||
maps\_fx::gunfireloopfx (level.medFire, // Medium fire effect
|
||||
(-701, -18361, 148), // Origin
|
||||
10, 15, // 10 to 15 shots
|
||||
0.1, 0.3, // 0.1 to 0.3 seconds between shots
|
||||
2.5, 9); // 2.5 to 9 seconds between sets of shots.
|
||||
****************************************************************************************************************
|
||||
|
||||
****************************************************************************************************************
|
||||
GrenadeExplosionfx: Creates a grenade explosion with view jitter.
|
||||
maps\_fx::GrenadeExplosionfx((x y z));
|
||||
|
||||
Example:
|
||||
maps\_fx::GrenadeExplosionfx( (-701, -18361, 148) ); // origin
|
||||
****************************************************************************************************************
|
||||
*/
|
||||
|
||||
script_print_fx()
|
||||
{
|
||||
if ( ( !isdefined( self.script_fxid ) ) || ( !isdefined( self.script_fxcommand ) ) || ( !isdefined( self.script_delay ) ) )
|
||||
{
|
||||
println( "Effect at origin ", self.origin, " doesn't have script_fxid/script_fxcommand/script_delay" );
|
||||
self delete();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isdefined( self.target ) )
|
||||
org = getent( self.target ).origin;
|
||||
else
|
||||
org = "undefined";
|
||||
|
||||
// println ("^a Command:", self.script_fxcommand, " Effect:", self.script_fxID, " Delay:", self.script_delay, " ", self.origin);
|
||||
if ( self.script_fxcommand == "OneShotfx" )
|
||||
println( "maps\_fx::OneShotfx(\"" + self.script_fxid + "\", " + self.origin + ", " + self.script_delay + ", " + org + ");" );
|
||||
|
||||
if ( self.script_fxcommand == "loopfx" )
|
||||
println( "maps\_fx::LoopFx(\"" + self.script_fxid + "\", " + self.origin + ", " + self.script_delay + ", " + org + ");" );
|
||||
|
||||
if ( self.script_fxcommand == "loopsound" )
|
||||
println( "maps\_fx::LoopSound(\"" + self.script_fxid + "\", " + self.origin + ", " + self.script_delay + ", " + org + ");" );
|
||||
}
|
||||
|
||||
script_playfx( id, pos, pos2 )
|
||||
{
|
||||
if ( !id )
|
||||
return;
|
||||
|
||||
if ( isdefined( pos2 ) )
|
||||
playfx( id, pos, pos2 );
|
||||
else
|
||||
playfx( id, pos );
|
||||
}
|
||||
|
||||
script_playfxontag( id, ent, tag )
|
||||
{
|
||||
if ( !id )
|
||||
return;
|
||||
|
||||
playfxontag( id, ent, tag );
|
||||
}
|
||||
|
||||
GrenadeExplosionfx( pos )
|
||||
{
|
||||
playfx( level._effect[ "mechanical explosion" ], pos );
|
||||
earthquake( 0.15, 0.5, pos, 250 );
|
||||
// TODO: Add explosion effect and view jitter
|
||||
// println("The script command grenadeExplosionEffect has been removed. maps\\_fx::GrenadeExplosionfx must be set up to make an effect and jitter the view.");
|
||||
}
|
||||
|
||||
|
||||
soundfx( fxId, fxPos, endonNotify )
|
||||
{
|
||||
org = spawn( "script_origin", ( 0, 0, 0 ) );
|
||||
org.origin = fxPos;
|
||||
org playloopsound( fxId );
|
||||
if ( isdefined( endonNotify ) )
|
||||
org thread soundfxDelete( endonNotify );
|
||||
|
||||
/*
|
||||
ent = level thread createfx_showOrigin ( fxId, fxPos, undefined, undefined, "soundfx" );
|
||||
ent.delay = 0;
|
||||
ent endon ("effect deleted");
|
||||
ent.soundfx = org;
|
||||
*/
|
||||
}
|
||||
|
||||
soundfxDelete( endonNotify )
|
||||
{
|
||||
level waittill( endonNotify );
|
||||
self delete();
|
||||
}
|
||||
|
||||
|
||||
rainfx( fxId, fxId2, fxPos )
|
||||
{
|
||||
org = spawn( "script_origin", ( 0, 0, 0 ) );
|
||||
org.origin = fxPos;
|
||||
org thread rainLoop( fxId, fxId2 );
|
||||
|
||||
//ent = level thread createfx_showOrigin( fxId, fxPos, undefined, undefined, "rainfx", undefined, fxId2 );
|
||||
//ent.delay = 0;
|
||||
//ent endon ("effect deleted");
|
||||
//ent.soundfx = org;
|
||||
}
|
||||
|
||||
rainLoop( hardRain, lightRain )
|
||||
{
|
||||
// org playloopsound (fxId);
|
||||
self endon( "death" );
|
||||
blend = spawn( "sound_blend", ( 0.0, 0.0, 0.0 ) );
|
||||
blend.origin = self.origin;
|
||||
self thread blendDelete( blend );
|
||||
|
||||
blend2 = spawn( "sound_blend", ( 0.0, 0.0, 0.0 ) );
|
||||
blend2.origin = self.origin;
|
||||
self thread blendDelete( blend2 );
|
||||
|
||||
|
||||
// lerp of 0 will play _null only
|
||||
blend setSoundBlend( lightRain + "_null", lightRain, 0 );
|
||||
blend2 setSoundBlend( hardRain + "_null", hardRain, 1 );
|
||||
rain = "hard";
|
||||
blendTime = undefined;
|
||||
for ( ;; )
|
||||
{
|
||||
level waittill( "rain_change", change, blendTime );
|
||||
blendTime *= 20;// internal framerate
|
||||
assert( change == "hard" || change == "light" || change == "none" );
|
||||
assert( blendtime > 0 );
|
||||
|
||||
if ( change == "hard" )
|
||||
{
|
||||
if ( rain == "none" )
|
||||
{
|
||||
blendTime *= 0.5;// gotta do 2 blends to go from none to hard
|
||||
for ( i = 0;i < blendtime;i++ )
|
||||
{
|
||||
blend setSoundBlend( lightRain + "_null", lightRain, i / blendtime );
|
||||
wait( 0.05 );
|
||||
}
|
||||
rain = "light";
|
||||
}
|
||||
if ( rain == "light" )
|
||||
{
|
||||
for ( i = 0;i < blendtime;i++ )
|
||||
{
|
||||
blend setSoundBlend( lightRain + "_null", lightRain, 1 - ( i / blendtime ) );
|
||||
blend2 setSoundBlend( hardRain + "_null", hardRain, i / blendtime );
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( change == "none" )
|
||||
{
|
||||
if ( rain == "hard" )
|
||||
{
|
||||
blendTime *= 0.5;// gotta do 2 blends to go from hard to none
|
||||
for ( i = 0;i < blendtime;i++ )
|
||||
{
|
||||
blend setSoundBlend( lightRain + "_null", lightRain, ( i / blendtime ) );
|
||||
blend2 setSoundBlend( hardRain + "_null", hardRain, 1 - ( i / blendtime ) );
|
||||
wait( 0.05 );
|
||||
}
|
||||
rain = "light";
|
||||
}
|
||||
if ( rain == "light" )
|
||||
{
|
||||
for ( i = 0;i < blendtime;i++ )
|
||||
{
|
||||
blend setSoundBlend( lightRain + "_null", lightRain, 1 - ( i / blendtime ) );
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( change == "light" )
|
||||
{
|
||||
if ( rain == "none" )
|
||||
{
|
||||
for ( i = 0;i < blendtime;i++ )
|
||||
{
|
||||
blend setSoundBlend( lightRain + "_null", lightRain, i / blendtime );
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
if ( rain == "hard" )
|
||||
{
|
||||
for ( i = 0;i < blendtime;i++ )
|
||||
{
|
||||
blend setSoundBlend( lightRain + "_null", lightRain, i / blendtime );
|
||||
blend2 setSoundBlend( hardRain + "_null", hardRain, 1 - ( i / blendtime ) );
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rain = change;
|
||||
}
|
||||
}
|
||||
|
||||
blendDelete( blend )
|
||||
{
|
||||
self waittill( "death" );
|
||||
blend delete();
|
||||
}
|
||||
|
||||
/*QUAKED trigger_multiple_fx_watersheeting (0.12 0.23 1.0) ? AI_AXIS AI_ALLIES AI_NEUTRAL NOTPLAYER VEHICLE TRIGGER_SPAWN TOUCH_ONCE
|
||||
defaulttexture="trigger_fx"
|
||||
Activates the water sheeting effect covering the screen.
|
||||
Set script_duration to specify the duration. defaults to 3 seconds.*/
|
||||
|
||||
watersheeting( trigger )
|
||||
{
|
||||
duration = 3;
|
||||
if ( isdefined( trigger.script_duration ) )
|
||||
duration = trigger.script_duration;
|
||||
|
||||
while( true )
|
||||
{
|
||||
trigger waittill( "trigger", other );
|
||||
if ( IsPlayer( other ) )
|
||||
{
|
||||
other SetWaterSheeting( 1, duration );
|
||||
wait duration * 0.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2979
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,65 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "gauntlet", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_deathmodel( "vehicle_sa15_gauntlet", "vehicle_sa15_gauntlet_destroy" );
|
||||
build_deathfx( "explosions/large_vehicle_explosion", undefined, "exp_armor_vehicle" );
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "axis" );
|
||||
build_idle( %sa15_turret_scanloop );
|
||||
build_idle( %sa15_radar_spinloop );
|
||||
//build_mainturret();
|
||||
//build_compassicon( "tank" );
|
||||
//build_frontarmor( .33 );// regens this much of the damage from attacks to the front
|
||||
|
||||
//like BTR80 it is destroyed by rockets & semtex but not frags or bullets
|
||||
build_bulletshield( true );
|
||||
build_grenadeshield( true );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
/*
|
||||
positions[ 0 ].vehicle_getinanim = %tigertank_hatch_open;
|
||||
positions[ 1 ].vehicle_getoutanim = %tigertank_hatch_open;
|
||||
*/
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 11;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].getout_delete = true;
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_gauntlet (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_gauntlet::main( "vehicle_sa15_gauntlet" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_gauntlet_gauntlet
|
||||
sound,vehicle_gauntlet,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_sa15_gauntlet"
|
||||
default:"vehicletype" "gauntlet"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
@@ -0,0 +1,185 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
|
||||
// This script automaticly plays a users specified oneshot effect on all prefabs that have the
|
||||
// specified "script_struct" and "targetname" It also excepts angles from the "script_struct"
|
||||
// but will set a default angle of ( 0, 0, 0 ) if none is defined.
|
||||
//
|
||||
// example of the syntax:
|
||||
// global_FX( "targetname", "fxIDname", "fxFile", "delay"
|
||||
|
||||
main()
|
||||
{
|
||||
if ( !isdefined( level.global_fx ) )
|
||||
level.global_fx = [];
|
||||
|
||||
level._global_fx_ents = [];
|
||||
randomStartDelay = randomfloatrange( -20, -15 );
|
||||
|
||||
|
||||
// prefabs/misc_models/com_barrel_fire.map
|
||||
global_FX( "barrel_fireFX_origin", "global_barrel_fire", "fire/firelp_barrel_pm", randomStartDelay, "fire_barrel_small" );
|
||||
|
||||
// prefabs/misc_models/ch_street_light_02_on.map
|
||||
// prefabs/misc_models/ch_street_wall_light_01_on.map
|
||||
global_FX( "ch_streetlight_02_FX_origin", "ch_streetlight_02_FX", "misc/lighthaze", randomStartDelay );
|
||||
|
||||
// prefabs/misc_models/me_streetlight_on.map
|
||||
// prefabs/misc_models/me_streetlight_on_scaleddown80.map
|
||||
global_FX( "me_streetlight_01_FX_origin", "me_streetlight_01_FX", "misc/lighthaze_bog_a", randomStartDelay );
|
||||
|
||||
// prefabs\village_assault\misc\lamp_post.map
|
||||
// prefabs\misc_models\ch_street_light_01_on.map
|
||||
global_FX( "ch_street_light_01_on", "lamp_glow_FX", "misc/light_glow_white", randomStartDelay );
|
||||
|
||||
// prefabs\dcburning\lamp_post_globe_on.map
|
||||
global_FX( "lamp_post_globe_on", "lamp_glow_FX", "misc/light_glow_white", randomStartDelay );
|
||||
|
||||
// prefabs\village_assault\misc\highway_lamp_post.map
|
||||
global_FX( "highway_lamp_post", "ch_streetlight_02_FX", "misc/lighthaze_villassault", randomStartDelay );
|
||||
|
||||
// prefabs/misc_models/cs_cargoship_spotlight_on.map
|
||||
global_FX( "cs_cargoship_spotlight_on_FX_origin", "cs_cargoship_spotlight_on_FX", "misc/lighthaze", randomStartDelay );
|
||||
|
||||
// prefabs/misc_models/me_dumpster_fire.map
|
||||
global_FX( "me_dumpster_fire_FX_origin", "me_dumpster_fire_FX", "fire/firelp_med_pm", randomStartDelay, "fire_dumpster_medium" );
|
||||
|
||||
// prefabs/misc_models/com_tires01_burning.map
|
||||
global_FX( "com_tires_burning01_FX_origin", "com_tires_burning01_FX", "fire/tire_fire_med", randomStartDelay );
|
||||
|
||||
// prefabs/icbm/icbm_powerlinetower02.map
|
||||
global_FX( "icbm_powerlinetower_FX_origin", "icbm_powerlinetower_FX", "misc/power_tower_light_red_blink", randomStartDelay );
|
||||
|
||||
// prefabs/icbm/icbm_powerlinetower02.map
|
||||
global_FX( "icbm_mainframe_FX_origin", "icbm_mainframe_FX", "props/icbm_mainframe_lightblink", randomStartDelay );
|
||||
|
||||
// prefabs/misc_model/cs_cargoship_wall_light_red_pulse.map
|
||||
global_FX( "light_pulse_red_FX_origin", "light_pulse_red_FX", "misc/light_glow_red_generic_pulse", -2 );
|
||||
|
||||
// prefabs/misc_model/cs_cargoship_wall_light_red_pulse.map
|
||||
global_FX( "light_pulse_red_FX_origin", "light_pulse_red_FX", "misc/light_glow_red_generic_pulse", -2 );
|
||||
|
||||
// prefabs/misc_model/cs_cargoship_wall_light_orange_pulse.map
|
||||
global_FX( "light_pulse_orange_FX_origin", "light_pulse_orange_FX", "misc/light_glow_orange_generic_pulse", -2 );
|
||||
|
||||
// prefabs/oilrig/lights/light_corner_01.map
|
||||
// prefabs/oilrig/helipad/helipad_light.map
|
||||
global_FX( "light_red_blink_FX_origin", "light_red_blink", "misc/power_tower_light_red_blink", -2 );
|
||||
|
||||
// prefabs/misc_models/ch_industrial_light_01_on.map
|
||||
global_FX( "lighthaze_oilrig_FX_origin", "lighthaze_oilrig", "misc/lighthaze_oilrig", randomStartDelay );
|
||||
|
||||
// prefabs/misc_models/ch_industrial_light_01_on_white.map
|
||||
global_FX( "lighthaze_white_FX_origin", "lighthaze_white", "misc/lighthaze_white", randomStartDelay );
|
||||
|
||||
// prefabs/misc_models/cs_cargoship_wall_light_on.map
|
||||
global_FX( "light_glow_walllight_white_FX_origin", "light_glow_walllight_white", "misc/light_glow_walllight_white", randomStartDelay );
|
||||
|
||||
// prefabs/misc_models/me_lightfluohang_on.map
|
||||
global_FX( "fluorescent_glow_FX_origin", "fluorescent_glow", "misc/fluorescent_glow", randomStartDelay );
|
||||
|
||||
// prefabs/misc_models/ch_industrial_light_02_on.map
|
||||
global_FX( "light_glow_industrial_FX_origin", "light_glow_industrial", "misc/light_glow_industrial", randomStartDelay );
|
||||
|
||||
// prefabs/cliffhanger/red_light1.map
|
||||
// prefabs/misc_model/com_emergencylightcase_on.map
|
||||
global_FX( "light_red_steady_FX_origin", "light_red_steady", "misc/tower_light_red_steady", -2 );
|
||||
|
||||
// prefabs/cliffhanger/blue_light1.map
|
||||
// prefabs/oilrig/helipad/helipad_light.map
|
||||
// prefabs/misc_model/com_emergencylightcase_blue_on.map
|
||||
global_FX( "light_blue_steady_FX_origin", "light_blue_steady", "misc/tower_light_blue_steady", -2 );
|
||||
|
||||
// prefabs/misc_models/com_emergencylightcase_orange.map
|
||||
global_FX( "light_orange_steady_FX_origin", "light_orange_steady", "misc/tower_light_orange_steady", -2 );
|
||||
|
||||
// prefabs/misc_models/mil_lightstick_pile_on.map
|
||||
global_FX( "glow_stick_pile_FX_origin", "glow_stick_pile", "misc/glow_stick_glow_pile", -2 );
|
||||
|
||||
// prefabs/plaza/blinky_tower.map
|
||||
global_FX( "highrise_blinky_tower", "highrise_blinky_tower_FX", "misc/power_tower_light_red_blink_large", randomStartDelay, undefined, 1.5 );
|
||||
|
||||
// prefabs/mil_emergency_flare.map
|
||||
global_FX( "flare_ambient_FX_origin", "flare_ambient_FX", "misc/flare_ambient", randomStartDelay, "emt_road_flare_burn", 1.5 );
|
||||
|
||||
// prefabs/misc_models/dt_light_on.map
|
||||
// prefabs/misc_models/com_utility_light_on.map
|
||||
// prefabs/misc_models/utility_lightbulb_bare_on.map
|
||||
global_FX( "light_glow_white_bulb_FX_origin", "light_glow_white_bulb_FX", "misc/light_glow_white_bulb", randomStartDelay);
|
||||
|
||||
// prefabs/misc_models/com_restaurantceilinglamp_on.map
|
||||
global_FX( "light_glow_white_lamp_FX_origin", "light_glow_white_lamp_FX", "misc/light_glow_white_lamp", randomStartDelay);
|
||||
|
||||
}
|
||||
|
||||
// I've wired this into "Repackage Zone" checkbox in the compile tab on IW_Launcher. If you want to change this you'll have to get the repackager updated too. - Nate
|
||||
global_FX( targetname, fxName, fxFile, delay, soundalias, randomrange )
|
||||
{
|
||||
level.global_fx[ targetname ] = fxName;
|
||||
|
||||
// script_structs
|
||||
ents = getstructarray( targetname, "targetname" );
|
||||
if ( !isdefined( ents ) )
|
||||
return;
|
||||
if ( ents.size <= 0 )
|
||||
return;
|
||||
|
||||
for ( i = 0 ; i < ents.size ; i++ )
|
||||
{
|
||||
ent = ents[ i ] global_FX_create( fxName, fxFile, delay, soundalias, randomrange );
|
||||
|
||||
if ( !isdefined( ents[ i ].script_noteworthy ) )
|
||||
continue;
|
||||
|
||||
note = ents[ i ].script_noteworthy;
|
||||
if ( !isdefined( level._global_fx_ents[ note ] ) )
|
||||
{
|
||||
level._global_fx_ents[ note ] = [];
|
||||
}
|
||||
|
||||
level._global_fx_ents[ note ][ level._global_fx_ents[ note ].size ] = ent;
|
||||
}
|
||||
}
|
||||
|
||||
global_FX_create( fxName, fxFile, delay, soundalias, randomrange )
|
||||
{
|
||||
if ( !isdefined( level._effect ) )
|
||||
level._effect = [];
|
||||
if ( !isdefined( level._effect[ fxName ] ) )
|
||||
level._effect[ fxName ] = loadfx( fxFile );
|
||||
|
||||
if( isdefined( randomrange ) )
|
||||
{
|
||||
delay += RandomFloat( randomrange);
|
||||
}
|
||||
|
||||
// default effect angles if they dont exist
|
||||
if ( !isdefined( self.angles ) )
|
||||
self.angles = ( 0, 0, 0 );
|
||||
|
||||
ent = createOneshotEffect( fxName );
|
||||
ent.v[ "origin" ] = ( self.origin );
|
||||
ent.v[ "angles" ] = ( self.angles );
|
||||
ent.v[ "fxid" ] = fxName;
|
||||
ent.v[ "delay" ] = delay;
|
||||
if ( isdefined( soundalias ) )
|
||||
{
|
||||
ent.v[ "soundalias" ] = soundalias;
|
||||
}
|
||||
|
||||
//resetting un-needed members to undefined to save child variables
|
||||
array = level.struct_class_names[ "targetname" ][ self.targetname ];
|
||||
foreach ( index, struct in array )
|
||||
{
|
||||
if ( struct == self )
|
||||
level.struct_class_names[ "targetname" ][ self.targetname ][ index ] = undefined;
|
||||
}
|
||||
|
||||
foreach ( index, struct in level.struct )
|
||||
{
|
||||
if ( struct == self )
|
||||
level.struct[ index ] = undefined;
|
||||
}
|
||||
|
||||
return ent;
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
#include maps\_utility;
|
||||
|
||||
main()
|
||||
{
|
||||
thread lastshottime();
|
||||
array_thread( getentarray( "showpath", "script_noteworthy" ), ::showpath );
|
||||
array_thread( getentarray( "brush_guide", "targetname" ), ::brush_guide );
|
||||
}
|
||||
|
||||
showpath_trigger( path )
|
||||
{
|
||||
while ( 1 )
|
||||
{
|
||||
self waittill( "trigger" );
|
||||
path notify( "showpath" );
|
||||
}
|
||||
}
|
||||
|
||||
showpath()
|
||||
{
|
||||
array_thread( getentarray( self.targetname, "target" ), ::showpath_trigger, self );
|
||||
while ( 1 )
|
||||
{
|
||||
self waittill( "showpath" );
|
||||
level notify( "newtrigger" );
|
||||
self thread leadshowstuff();
|
||||
level waittill( "newtrigger" );
|
||||
}
|
||||
}
|
||||
|
||||
leadshowstuff()
|
||||
{
|
||||
level endon( "newtrigger" );
|
||||
while ( 1 )
|
||||
{
|
||||
waitforrecentfire();
|
||||
wait .5;
|
||||
thread leadshowstuff_path( self, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
leadshowstuff_path( position, arrowtime )
|
||||
{
|
||||
level endon( "newtrigger" );
|
||||
if ( isdefined( position.target ) )
|
||||
targ = getent( position.target, "targetname" );
|
||||
else
|
||||
targ = undefined;
|
||||
lasttarg = position;
|
||||
while ( isdefined( targ ) )
|
||||
{
|
||||
waitforrecentfire();
|
||||
if ( isdefined( targ.target ) )
|
||||
targ = getent( targ.target, "targetname" );
|
||||
else
|
||||
return;
|
||||
if ( !isdefined( targ ) )
|
||||
return;
|
||||
realarrowtime = distance( lasttarg.origin, targ.origin ) / 1000;
|
||||
// if(distance(level.player.origin,targ.origin) < 5000)
|
||||
draw_arrow_time( lasttarg.origin, targ.origin, ( 0, 0, 1 ), realarrowtime );
|
||||
wait realarrowtime;
|
||||
lasttarg = targ;
|
||||
}
|
||||
}
|
||||
|
||||
waitforrecentfire()
|
||||
{
|
||||
while ( !level.hasfiredrecently )
|
||||
wait .05;
|
||||
}
|
||||
|
||||
lastshottime()
|
||||
{
|
||||
level.hasfiredrecently = true;
|
||||
lastshottime = 0;
|
||||
while ( 1 )
|
||||
{
|
||||
if ( level.player usebuttonpressed() )
|
||||
lastshottime = 0;
|
||||
else
|
||||
lastshottime += .05;
|
||||
|
||||
if ( lastshottime > 4 )
|
||||
level.hasfiredrecently = false;
|
||||
else
|
||||
level.hasfiredrecently = true;
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
|
||||
brush_guide()
|
||||
{
|
||||
while ( 1 )
|
||||
{
|
||||
self hide();
|
||||
while ( !level.hasfiredrecently )
|
||||
wait .05;
|
||||
self show();
|
||||
while ( level.hasfiredrecently )
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
//dont forget to add:
|
||||
//include,common_hand_signals
|
||||
//to your csv
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
initHandSignals()
|
||||
{
|
||||
level.scr_anim[ "generic" ][ "signal_moveout_cqb" ] = %CQB_stand_signal_move_out;
|
||||
level.scr_anim[ "generic" ][ "signal_moveup_cqb" ] = %CQB_stand_signal_move_up;
|
||||
level.scr_anim[ "generic" ][ "signal_stop_cqb" ] = %CQB_stand_signal_stop;
|
||||
level.scr_anim[ "generic" ][ "signal_onme_cqb" ] = %CQB_stand_wave_on_me;
|
||||
level.scr_anim[ "generic" ][ "signal_enemy_cqb" ] = %CQB_stand_signal_stop; // TEMP
|
||||
level.scr_anim[ "generic" ][ "signal_go_cqb" ] = %CQB_stand_wave_go_v1;
|
||||
|
||||
level.scr_anim[ "generic" ][ "signal_moveout" ] = %stand_exposed_wave_move_out;
|
||||
level.scr_anim[ "generic" ][ "signal_moveup" ] = %stand_exposed_wave_move_up;
|
||||
level.scr_anim[ "generic" ][ "signal_stop" ] = %stand_exposed_wave_halt;
|
||||
level.scr_anim[ "generic" ][ "signal_onme" ] = %stand_exposed_wave_on_me;
|
||||
level.scr_anim[ "generic" ][ "signal_enemy" ] = %stand_exposed_wave_target_spotted;
|
||||
level.scr_anim[ "generic" ][ "signal_go" ] = %stand_exposed_wave_go;
|
||||
//level.scr_anim[ "generic" ][ "signal_down" ] = %stand_exposed_wave_down;
|
||||
|
||||
// TEMP execpt additive go animation
|
||||
level.scr_anim[ "generic" ][ "signal_moveout_crouch" ] = %CQB_stand_wave_go_v1;
|
||||
level.scr_anim[ "generic" ][ "signal_moveup_crouch" ] = %CQB_stand_wave_go_v1;
|
||||
level.scr_anim[ "generic" ][ "signal_stop_crouch" ] = %CQB_stand_wave_go_v1;
|
||||
level.scr_anim[ "generic" ][ "signal_onme_crouch" ] = %CQB_stand_wave_go_v1;
|
||||
level.scr_anim[ "generic" ][ "signal_enemy_crouch" ] = %CQB_stand_wave_go_v1;
|
||||
level.scr_anim[ "generic" ][ "signal_go_crouch" ] = %CQB_stand_wave_go_v1;
|
||||
|
||||
level.scr_anim[ "generic" ][ "signal_moveout_coverR" ] = %CornerStndR_alert_signal_move_out;
|
||||
level.scr_anim[ "generic" ][ "signal_moveup_coverR" ] = %CornerStndR_alert_signal_move_out; // TEMP
|
||||
level.scr_anim[ "generic" ][ "signal_stop_coverR" ] = %CornerStndR_alert_signal_stopStay_down;
|
||||
level.scr_anim[ "generic" ][ "signal_onme_coverR" ] = %CornerStndR_alert_signal_on_me;
|
||||
level.scr_anim[ "generic" ][ "signal_enemy_coverR" ] = %CornerStndR_alert_signal_enemy_spotted;
|
||||
level.scr_anim[ "generic" ][ "signal_go_coverR" ] = %CornerStndR_alert_signal_move_out; // TEMP
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "harrier", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_av8b_harrier_jet" );
|
||||
|
||||
//special for harrier/////
|
||||
level._effect[ "engineeffect" ] = loadfx( "fire/jet_afterburner_harrier" );
|
||||
level._effect[ "afterburner" ] = loadfx( "fire/jet_afterburner_ignite" );
|
||||
level._effect[ "contrail" ] = loadfx( "smoke/jet_contrail" );
|
||||
////////////////////////
|
||||
|
||||
build_deathfx( "explosions/aerial_explosion_harrier", "tag_deathfx", "explo_metal_rand", undefined, undefined, undefined, undefined, undefined, undefined, 0 );
|
||||
build_life( 999, 500, 1500 );
|
||||
build_rumble( "mig_rumble", 0.05, 0.2, 7500, 0.05, 0.05 );
|
||||
build_team( "allies" );
|
||||
build_compassicon( "harrier", false );
|
||||
build_treadfx();
|
||||
|
||||
build_light( model, "wingtip_green", "tag_light_L_wing", "misc/aircraft_light_wingtip_green", "running", 0.00 );
|
||||
build_light( model, "wingtip_red", "tag_light_R_wing", "misc/aircraft_light_wingtip_red", "running", 0.05 );
|
||||
build_light( model, "white_blink_tail", "TAG_LIGHT_TAIL", "misc/aircraft_light_white_blink", "running", 0.10 );
|
||||
build_light( model, "white_blink_tail", "TAG_LIGHT_BELLY", "misc/aircraft_light_red_blink", "running", 0.15 );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
thread playEngineEffects();
|
||||
maps\_vehicle::lights_on( "running" );
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 1;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
playEngineEffects()
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "stop_engineeffects" );
|
||||
|
||||
self ent_flag_init( "engineeffects" );
|
||||
self ent_flag_set( "engineeffects" );
|
||||
engineeffects = getfx( "engineeffect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self ent_flag_wait( "engineeffects" );
|
||||
playfxontag( engineeffects, self, "tag_engine_right" );
|
||||
playfxontag( engineeffects, self, "tag_engine_left" );
|
||||
wait .05;
|
||||
playfxontag( engineeffects, self, "tag_engine_right2" );
|
||||
playfxontag( engineeffects, self, "tag_engine_left2" );
|
||||
self ent_flag_waitopen( "engineeffects" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_left" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_right" );
|
||||
wait .05;
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_left2" );
|
||||
StopFXOnTag( engineeffects, self, "tag_engine_right2" );
|
||||
}
|
||||
}
|
||||
|
||||
playerisinfront( other )
|
||||
{
|
||||
forwardvec = anglestoforward( flat_angle( other.angles ) );
|
||||
normalvec = vectorNormalize( flat_origin( level.player.origin ) - other.origin );
|
||||
dot = vectordot( forwardvec, normalvec );
|
||||
if ( dot > 0 )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
plane_sound_node()
|
||||
{
|
||||
self waittill( "trigger", other );
|
||||
other endon( "death" );
|
||||
self thread plane_sound_node();// spawn new thread for next plane that passes through this pathnode
|
||||
other thread play_loop_sound_on_entity( "veh_mig29_dist_loop" );
|
||||
while ( playerisinfront( other ) )
|
||||
wait .05;
|
||||
wait .5;// little delay for the boom
|
||||
other thread play_sound_in_space( "veh_mig29_sonic_boom" );
|
||||
other waittill( "reached_end_node" );
|
||||
other stop_sound( "veh_mig29_dist_loop" );
|
||||
other delete();
|
||||
}
|
||||
|
||||
stop_sound( alias )
|
||||
{
|
||||
self notify( "stop sound" + alias );
|
||||
}
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_harrier (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_harrier::main( "vehicle_av8b_harrier_jet" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_harrier
|
||||
sound,vehicle_harrier,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_av8b_harrier_jet"
|
||||
default:"vehicletype" "harrier"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,240 @@
|
||||
#include maps\_utility;
|
||||
#include maps\_hud_util;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_anim;
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
#include maps\_loadout;
|
||||
|
||||
|
||||
//infolines here adds the info to the keys on the entity. This is because the info box doesn't persists with the classname change.
|
||||
|
||||
/*DISABLED gags_heli-ride-in_blackhawk_uk (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
STEPS TO GET GAGS_HELI_RIDE_IN_BLACKHAWK IN GAME:
|
||||
1) put this in your GSC before _load::main():
|
||||
maps\_blackhawk::main( "vehicle_blackhawk" );
|
||||
2) create a helicopter path with a targetname "heli_ride_in"
|
||||
3) On the node that you wish to have the helicopter unload, add the keypair "script_unload" "1"
|
||||
4) call this function when you are ready to ride. dig into that function for all the available knobs.
|
||||
heli = maps\_heli_ride::ride_start();"
|
||||
|
||||
default:"wikilink" "http://iwdocs.infinityward.net/ow.asp?GagsHeliRideInBlackhawk"
|
||||
default:"classname" "misc_prefab"
|
||||
default:"model" "prefabs\script_gags\heli_ride_in_blackhawk.map"
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*DISABLED gags_heli-ride-in_blackhawk_us (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
STEPS TO GET GAGS_HELI_RIDE_IN_BLACKHAWK IN GAME:
|
||||
1) put this in your GSC before _load::main():
|
||||
maps\_blackhawk::main( "vehicle_blackhawk" );
|
||||
2) create a helicopter path with a targetname "heli_ride_in"
|
||||
3) On the node that you wish to have the helicopter unload, add the keypair "script_unload" "1"
|
||||
4) call this function when you are ready to ride. dig into that function for all the available knobs.
|
||||
heli = maps\_heli_ride::ride_start();"
|
||||
|
||||
default:"wikilink" "http://iwdocs.infinityward.net/ow.asp?GagsHeliRideInBlackhawk"
|
||||
default:"classname" "misc_prefab"
|
||||
default:"model" "prefabs\script_gags\heli_ride_in_blackhawk_us.map"
|
||||
|
||||
*/
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//== FRIENDLY CHOPPER RIDE-IN ==
|
||||
//===========================================================================
|
||||
|
||||
ride_setup( startnode, players_array )
|
||||
{
|
||||
// can't think of any reason not to have godmode on the riding vehicle.
|
||||
godon();
|
||||
|
||||
//spawn the rope
|
||||
getout_rigspawn( getanimatemodel(), 3 );
|
||||
|
||||
if ( !isdefined( players_array ) )
|
||||
players_array = level.players;
|
||||
|
||||
foreach ( player in players_array )
|
||||
thread attach_player( player, 3 );
|
||||
|
||||
speed = 95;
|
||||
if ( isdefined( startnode.speed ) )
|
||||
{
|
||||
speed = startnode.speed;
|
||||
}
|
||||
// ADD THIS to overgrown thread heli_behavior();
|
||||
self setairresistance( 30 );
|
||||
self Vehicle_SetSpeed( speed, 40, level.heli_default_decel );//this is overriden instantly by the _vehicle system
|
||||
|
||||
// makes the helicopter go to a node.
|
||||
vehicle_paths( startnode );
|
||||
}
|
||||
|
||||
|
||||
// attach player(s) to helicopter ride in
|
||||
attach_player( player, position, animfudgetime )
|
||||
{
|
||||
player thread player_in_heli( self );
|
||||
|
||||
if ( getdvar( "fastrope_arms" ) == "" )
|
||||
setdvar( "fastrope_arms", "0" );
|
||||
if ( !isdefined( animfudgetime ) )
|
||||
animfudgetime = 0;
|
||||
|
||||
assert( isdefined( self.riders ) );
|
||||
|
||||
assert( self.riders.size );
|
||||
|
||||
|
||||
guy = undefined;
|
||||
for ( i = 0; i < self.riders.size; i++ )
|
||||
{
|
||||
if ( self.riders[ i ].vehicle_position == position )
|
||||
{
|
||||
guy = self.riders[ i ];
|
||||
guy.drone_delete_on_unload = true;
|
||||
guy.playerpiggyback = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//level.piggyback_guy = guy;//temp debug thing -z
|
||||
assertex( !isai( guy ), "guy in position of player needs to have script_drone set, use script_startingposition ans script drone in your map" );
|
||||
assert( isdefined( guy ) );
|
||||
|
||||
animpos = maps\_vehicle_aianim::anim_pos( self, position );
|
||||
|
||||
// guy stopanimscripted();
|
||||
// guy stopuseanimtree();
|
||||
guy notify( "newanim" );
|
||||
guy detachall();
|
||||
// guy setmodel( "" );
|
||||
guy setmodel( "fastrope_arms" );
|
||||
guy useanimtree( animpos.player_animtree );
|
||||
thread maps\_vehicle_aianim::guy_idle( guy, position );
|
||||
wait .1;
|
||||
|
||||
//player playerlinktoabsolute( guy, "tag_player" );
|
||||
|
||||
if( isdefined( level.little_bird ) )
|
||||
player playerlinkto( guy, "tag_player", 0.35, 120, 28, 30, 30, false );
|
||||
else
|
||||
player playerlinkto( guy, "tag_player", 0.35, 60, 28, 30, 30, false );
|
||||
|
||||
//player playerlinktodelta( guy, "tag_player", 0.35, 60, 28, 30, 30, false );
|
||||
//guy thread maps\_debug::drawtagforever( "tag_player", (1,0,0) );
|
||||
player freezecontrols( false );
|
||||
|
||||
guy hide();
|
||||
|
||||
animtime = getanimlength( animpos.getout );
|
||||
animtime -= animfudgetime;
|
||||
self waittill( "unloading" );
|
||||
|
||||
if ( getdvar( "fastrope_arms" ) != "0" )
|
||||
guy show();
|
||||
player disableweapons();
|
||||
// guy waittill( "jumpedout" );
|
||||
|
||||
//guy notsolid();
|
||||
|
||||
wait animtime;
|
||||
|
||||
player unlink();
|
||||
player enableweapons();
|
||||
setSavedDvar( "hud_drawhud", "1" );
|
||||
level notify( "stop_draw_hud_on_death" );
|
||||
|
||||
}
|
||||
|
||||
// player control during helicopter ride in
|
||||
player_in_heli( heli )
|
||||
{
|
||||
|
||||
// This could get ugly with two players doing the same thing.
|
||||
setsavedDvar( "g_friendlyNameDist", 0 );
|
||||
setsavedDvar( "g_friendlyfireDist", 0 );
|
||||
|
||||
self hide_player_model();
|
||||
|
||||
self allowsprint( false );
|
||||
self allowprone( false );
|
||||
self allowstand( false );
|
||||
|
||||
self EnableInvulnerability();
|
||||
self.ignoreme = true;
|
||||
wait .05;
|
||||
self setplayerangles( ( 0, 35, 0 ) );
|
||||
|
||||
heli waittill( "unloading" );
|
||||
self notify( "stop_quake" );
|
||||
|
||||
wait 6;
|
||||
|
||||
autosave_by_name( "on_the_ground" );
|
||||
self allowprone( false );
|
||||
self allowstand( true );
|
||||
self allowcrouch( false );// bounce the player out of crouch
|
||||
wait .05;
|
||||
self allowprone( true );
|
||||
self allowcrouch( true );
|
||||
self DisableInvulnerability();
|
||||
self.ignoreme = false;
|
||||
self allowsprint( true );
|
||||
|
||||
wait 4;// wait 5;// < -- allows player to move for a few frames before moved
|
||||
|
||||
// set player models and move them apart when landed
|
||||
// TODO REMOVE THIS When we get anims for each player.
|
||||
self show_player_model();
|
||||
if ( self == level.player )
|
||||
{
|
||||
for ( i = 0;i < 24;i++ )
|
||||
{
|
||||
self setOrigin( self.origin + ( 2, 0, 0 ) );
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
setsavedDvar( "g_friendlyNameDist", 15000 );
|
||||
setsavedDvar( "g_friendlyfireDist", 128 );
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
|
||||
player_heli_ropeanimoverride_idle( guy, tag, animation )
|
||||
{
|
||||
self endon( "unloading" );
|
||||
while ( 1 )
|
||||
maps\_vehicle_aianim::animontag( guy, tag, animation );
|
||||
}
|
||||
|
||||
ride_start( optional_players_array, optional_max_riders )
|
||||
{
|
||||
targetname = "heli_ride_in";
|
||||
pathstart = getentarray( targetname, "targetname" );
|
||||
assertEx( pathstart.size <= 1, "too many script_origins with targetname \"" + targetname + "\" " );
|
||||
if ( !pathstart.size )
|
||||
{
|
||||
pathstart = getstructarray( "heli_ride_in", "targetname" );
|
||||
assertEx( pathstart.size <= 1, "too many script_structs with targetname \"heli_ride_in\" " );
|
||||
if ( !pathstart.size )
|
||||
assertMSG( "no helicopter paths with \"heli_ride_in\", can't start ride" );
|
||||
}
|
||||
|
||||
pathstart = pathstart[ 0 ];
|
||||
assertex( isdefined( level.gag_heliride_spawner ), "can't find heliride spawner. sure you placed the prefab?" );
|
||||
|
||||
//strip away those non riders.
|
||||
if ( isdefined( optional_max_riders ) )
|
||||
vehicle_spawn_group_limit_riders( level.gag_heliride_spawner.script_vehicleride, optional_max_riders );
|
||||
|
||||
vehicle = vehicle_spawn( level.gag_heliride_spawner );
|
||||
vehicle thread ride_setup( pathstart, optional_players_array );
|
||||
return vehicle;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_utility;
|
||||
#include maps\_helicopter_globals;
|
||||
#include common_scripts\utility;
|
||||
|
||||
evasive_think( vehicle )
|
||||
{
|
||||
vehicle endon( "death" );
|
||||
while ( vehicle.health > 0 )
|
||||
{
|
||||
vehicle waittill( "missile_lock", enemyVehicle );
|
||||
|
||||
points = evasive_createManeuvers( vehicle, "random" );
|
||||
evasive_startManeuvers( vehicle, points );
|
||||
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
evasive_createManeuvers( vehicle, maneuverName )
|
||||
{
|
||||
assert( isdefined( maneuverName ) );
|
||||
|
||||
/* evasive_addPoint params:
|
||||
forward - units forward/back
|
||||
side - units left/right
|
||||
up - units up/down
|
||||
goalYawMethod - can be "average", "forward", or "none"
|
||||
none (default): always points towards the next point
|
||||
average: finds an angle between the forward direction and the goal direction
|
||||
forward: chopper will always face the direction it was originally moving
|
||||
*/
|
||||
|
||||
switch( maneuverName )
|
||||
{
|
||||
case"strafe_left_right":
|
||||
// swerve & strafe ( right then left )
|
||||
vehicle evasive_addPoint( 3000, -1500, 500, "average" );
|
||||
vehicle evasive_addPoint( 6000, 3000, -700, "average" );
|
||||
vehicle evasive_addPoint( 3000, -1500, 200, "average" );
|
||||
break;
|
||||
|
||||
case "strafe_right_left":
|
||||
// swerve & strafe ( right then left )
|
||||
vehicle evasive_addPoint( 3000, 1500, 500, "average" );
|
||||
vehicle evasive_addPoint( 6000, -3000, -700, "average" );
|
||||
vehicle evasive_addPoint( 3000, 1500, 200, "average" );
|
||||
break;
|
||||
|
||||
case "360_clockwise":
|
||||
// 360 circle back around ( clockwise )
|
||||
vehicle evasive_addPoint( 1500, 1500, 200, "none" );
|
||||
vehicle evasive_addPoint( 0, 1500, 200, "none" );
|
||||
vehicle evasive_addPoint( -1500, 1500, 200, "none" );
|
||||
vehicle evasive_addPoint( -1500, 0, 0, "none" );
|
||||
vehicle evasive_addPoint( -1000, -1000, -200, "none" );
|
||||
vehicle evasive_addPoint( 0, -1000, -200, "none" );
|
||||
vehicle evasive_addPoint( 1000, -1000, -200, "none" );
|
||||
break;
|
||||
|
||||
case "360_counter_clockwise":
|
||||
vehicle evasive_addPoint( 1500, -1500, 200, "none" );
|
||||
vehicle evasive_addPoint( 0, -1500, 200, "none" );
|
||||
vehicle evasive_addPoint( -1500, -1500, 200, "none" );
|
||||
vehicle evasive_addPoint( -1500, 0, 0, "none" );
|
||||
vehicle evasive_addPoint( -1000, 1000, -200, "none" );
|
||||
vehicle evasive_addPoint( 0, 1000, -200, "none" );
|
||||
vehicle evasive_addPoint( 1000, 1000, -200, "none" );
|
||||
break;
|
||||
|
||||
case "random":
|
||||
maneuverNameList = [];
|
||||
maneuverNameList[ 0 ] = "strafe_left_right";
|
||||
maneuverNameList[ 1 ] = "strafe_right_left";
|
||||
maneuverNameList[ 2 ] = "360_clockwise";
|
||||
maneuverNameList[ 3 ] = "360_counter_clockwise";
|
||||
return evasive_createManeuvers( vehicle, maneuverNameList[ randomint( maneuverNameList.size ) ] );
|
||||
}
|
||||
|
||||
points = evasive_getAllPoints( vehicle );
|
||||
return points;
|
||||
}
|
||||
|
||||
evasive_startManeuvers( vehicle, points )
|
||||
{
|
||||
vehicle notify( "taking_evasive_actions" );
|
||||
vehicle endon( "taking_evasive_actions" );
|
||||
vehicle endon( "death" );
|
||||
|
||||
vehicle notify( "evasive_action_done" );
|
||||
|
||||
thread evasive_endManeuvers( vehicle );
|
||||
|
||||
if ( getdvar( "cobrapilot_debug" ) == "1" )
|
||||
vehicle evasive_drawPoints( points );
|
||||
|
||||
vehicle setNearGoalNotifyDist( 1500 );
|
||||
vehicle Vehicle_SetSpeed( 100, 30, 30 );
|
||||
|
||||
forwardYaw = vehicle.angles[ 1 ];
|
||||
|
||||
for ( i = 1 ; i < points.size ; i++ )
|
||||
{
|
||||
//prof_begin( "cobrapilot_ai" );
|
||||
|
||||
if ( isdefined( points[ i + 1 ] ) )
|
||||
evadeDirectionYaw = vectorToAngles( points[ i + 1 ][ "pos" ] - points[ i ][ "pos" ] );
|
||||
else
|
||||
evadeDirectionYaw = ( 0, forwardYaw, 0 );
|
||||
|
||||
// determine goal yaw angle
|
||||
goalYawAngle = evadeDirectionYaw[ 1 ];
|
||||
if ( points[ i ][ "goalYawMethod" ] == "average" )
|
||||
goalYawAngle = ( ( evadeDirectionYaw[ 1 ] + forwardYaw ) / 2 );
|
||||
else if ( points[ i ][ "goalYawMethod" ] == "forward" )
|
||||
goalYawAngle = vehicle.angles[ 1 ];
|
||||
|
||||
//prof_end( "cobrapilot_ai" );
|
||||
|
||||
//draw line to represent target yaw
|
||||
if ( getdvar( "cobrapilot_debug" ) == "1" )
|
||||
thread draw_line_until_notify( points[ i ][ "pos" ], points[ i ][ "pos" ] + ( vector_multiply( anglesToForward( ( 0, goalYawAngle, 0 ) ), 250 ) ), 1.0, 1.0, 0.2, vehicle, "evasive_action_done" );
|
||||
|
||||
vehicle setTargetYaw( goalYawAngle );
|
||||
|
||||
vehicle thread setvehgoalpos_wrap( points[ i ][ "pos" ], false );
|
||||
vehicle waittill( "near_goal" );
|
||||
}
|
||||
|
||||
vehicle notify( "evasive_action_done" );
|
||||
|
||||
vehicle thread vehicle_resumepath();
|
||||
}
|
||||
|
||||
evasive_endManeuvers( vehicle )
|
||||
{
|
||||
vehicle notify( "end_maneuvers" );
|
||||
vehicle endon( "end_maneuvers" );
|
||||
vehicle endon( "evasive_action_done" );
|
||||
vehicle endon( "death" );
|
||||
|
||||
vehicle waittill( "missile_lock_ended" );
|
||||
vehicle thread vehicle_resumepath();
|
||||
}
|
||||
|
||||
evasive_addPoint( forward, side, up, goalYawMethod )
|
||||
{
|
||||
if ( !isdefined( self.evasive_points ) )
|
||||
{
|
||||
self.evasive_points = [];
|
||||
self.evasive_points[ 0 ][ "pos" ] = self.origin;
|
||||
self.evasive_points[ 0 ][ "ang" ] = ( 0, self.angles[ 1 ], 0 );
|
||||
}
|
||||
|
||||
index = self.evasive_points.size;
|
||||
|
||||
if ( !isdefined( goalYawMethod ) )
|
||||
goalYawMethod = "none";
|
||||
|
||||
if ( !isdefined( up ) )
|
||||
up = 0;
|
||||
|
||||
self.evasive_points[ index ][ "forward" ] = forward;
|
||||
self.evasive_points[ index ][ "side" ] = side;
|
||||
self.evasive_points[ index ][ "up" ] = up;
|
||||
|
||||
//prof_begin( "cobrapilot_ai" );
|
||||
|
||||
vec_forward = anglesToForward( self.evasive_points[ 0 ][ "ang" ] );
|
||||
vec_right = anglesToRight( self.evasive_points[ 0 ][ "ang" ] );
|
||||
|
||||
self.evasive_points[ index ][ "pos" ] = self.evasive_points[ index - 1 ][ "pos" ] + ( vector_multiply( vec_forward, self.evasive_points[ index ][ "forward" ] ) ) + ( vector_multiply( vec_right, self.evasive_points[ index ][ "side" ] ) ) + ( 0, 0, up );
|
||||
self.evasive_points[ index ][ "goalYawMethod" ] = goalYawMethod;
|
||||
|
||||
//prof_end( "cobrapilot_ai" );
|
||||
}
|
||||
|
||||
evasive_getAllPoints( vehicle )
|
||||
{
|
||||
points = vehicle.evasive_points;
|
||||
vehicle.evasive_points = undefined;
|
||||
return points;
|
||||
}
|
||||
|
||||
evasive_drawPoints( points )
|
||||
{
|
||||
for ( i = 1 ; i < points.size ; i++ )
|
||||
thread draw_line_until_notify( points[ i - 1 ][ "pos" ], points[ i ][ "pos" ], 1.0, 0.2, 0.2, self, "evasive_action_done" );
|
||||
}
|
||||
|
||||
wingman_think( vehicle )
|
||||
{
|
||||
vehicle endon( "death" );
|
||||
level.playervehicle endon( "death" );
|
||||
|
||||
dist_forward = 2200;
|
||||
dist_side = 1500;
|
||||
dist_up = 0;
|
||||
|
||||
goalPosUpdateTime = 1.0;
|
||||
|
||||
wingmanSpeedScale = 1.2;
|
||||
wingmanBaseAcceleration = 50;
|
||||
wingmanBaseDeceleration = 60;
|
||||
|
||||
vehHelicopter_GetSpeedTime = 2000;
|
||||
vehHelicopter_CurrentSpeed = getPlayerHeliSpeed();
|
||||
vehHelicopter_OldSpeed = 0.0;
|
||||
vehHelicopter_OldSpeedTime = getTime();
|
||||
|
||||
// put the wingman at it's goal at the start of the level
|
||||
goalPos = wingman_getGoalPos( dist_forward, dist_side, dist_up );
|
||||
vehicle Vehicle_SetSpeed( 30, 20, 20 );
|
||||
vehicle setTargetYaw( level.playervehicle.angles[ 1 ] );
|
||||
vehicle setVehGoalPos( goalPos, true );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
//prof_begin( "cobrapilot_ai" );
|
||||
|
||||
/*******************************************************/
|
||||
/*** get the point where the wingman should hang out ***/
|
||||
/*******************************************************/
|
||||
|
||||
goalPos = wingman_getGoalPos( dist_forward, dist_side, dist_up );
|
||||
|
||||
if ( getdvar( "cobrapilot_debug" ) == "1" )
|
||||
{
|
||||
thread draw_line_for_time( level.playervehicle.origin, goalPos, 0, 1, 0, goalPosUpdateTime );
|
||||
thread draw_line_for_time( level.playervehicle.origin, vehicle.origin, 0, 0, 1, goalPosUpdateTime );
|
||||
thread draw_line_for_time( vehicle.origin, goalPos, 1, 1, 0, goalPosUpdateTime );
|
||||
}
|
||||
|
||||
/************************************************************************************************/
|
||||
/*** save records of what the players speed was 3 seconds ago to that the wingman can keep up ***/
|
||||
/************************************************************************************************/
|
||||
time = getTime();
|
||||
if ( time >= vehHelicopter_OldSpeedTime + vehHelicopter_GetSpeedTime )
|
||||
{
|
||||
vehHelicopter_OldSpeedTime = time;
|
||||
vehHelicopter_OldSpeed = vehHelicopter_CurrentSpeed;
|
||||
vehHelicopter_CurrentSpeed = getPlayerHeliSpeed();
|
||||
}
|
||||
|
||||
/***********************************************************************************************/
|
||||
/*** set wingmans goal position and target yaw here based on the players speed from the past ***/
|
||||
/***********************************************************************************************/
|
||||
bGoToGoal = false;
|
||||
wingmanSpeed = 0;
|
||||
|
||||
if ( vehHelicopter_OldSpeed > 20 )
|
||||
{
|
||||
wingmanSpeed = vehHelicopter_OldSpeed;
|
||||
bGoToGoal = true;
|
||||
}
|
||||
else if ( ( vehHelicopter_OldSpeed <= 20 ) && ( getPlayerHeliSpeed() > 20 ) )
|
||||
{
|
||||
wingmanSpeed = getPlayerHeliSpeed();
|
||||
bGoToGoal = true;
|
||||
}
|
||||
|
||||
if ( bGoToGoal && ( wingmanSpeed > 0 ) )
|
||||
{
|
||||
wingmanSpeed *= wingmanSpeedScale;
|
||||
accel = wingmanBaseAcceleration;
|
||||
decel = wingmanBaseDeceleration;
|
||||
if ( accel >= wingmanSpeed / 2 )
|
||||
accel = ( wingmanSpeed / 2 );
|
||||
if ( decel >= wingmanSpeed / 2 )
|
||||
decel = ( wingmanSpeed / 2 );
|
||||
|
||||
vehicle Vehicle_SetSpeed( wingmanSpeed, accel, decel );
|
||||
|
||||
vehicle setTargetYaw( level.playervehicle.angles[ 1 ] );
|
||||
|
||||
bStop = false;
|
||||
if ( getPlayerHeliSpeed() <= 30 )
|
||||
bStop = true;
|
||||
|
||||
if ( getdvar( "cobrapilot_debug" ) == "1" )
|
||||
iprintln( "wingman speed: " + wingmanSpeed + " : " + bStop );
|
||||
|
||||
vehicle setVehGoalPos( goalPos, bStop );
|
||||
}
|
||||
|
||||
/***********************************************************************************************/
|
||||
/***********************************************************************************************/
|
||||
/***********************************************************************************************/
|
||||
|
||||
//prof_end( "cobrapilot_ai" );
|
||||
|
||||
wait goalPosUpdateTime;
|
||||
}
|
||||
}
|
||||
|
||||
wingman_getGoalPos( dist_forward, dist_side, dist_up )
|
||||
{
|
||||
vec_forward = anglesToForward( flat_angle( level.playervehicle.angles ) );
|
||||
vec_right = anglesToRight( flat_angle( level.playervehicle.angles ) );
|
||||
goalPos = level.playervehicle.origin + ( vector_multiply( vec_forward, dist_forward ) ) + ( vector_multiply( vec_right, dist_side ) ) + ( 0, 0, dist_up );
|
||||
return goalPos;
|
||||
}
|
||||
|
||||
getPlayerHeliSpeed()
|
||||
{
|
||||
return level.playervehicle vehicle_getspeed();
|
||||
}
|
||||
@@ -0,0 +1,557 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
globalThink()
|
||||
{
|
||||
if ( !isdefined( self.vehicletype ) )
|
||||
return;
|
||||
|
||||
isHelicopter = false;
|
||||
if ( self.vehicletype == "hind" )
|
||||
{
|
||||
isHelicopter = true;
|
||||
}
|
||||
if ( ( self.vehicletype == "cobra" ) || ( self.vehicletype == "cobra_player" ) )
|
||||
{
|
||||
self thread attachMissiles( "cobra_Hellfire", "cobra_Sidewinder" );
|
||||
isHelicopter = true;
|
||||
}
|
||||
|
||||
if ( !isHelicopter )
|
||||
return;
|
||||
|
||||
level thread flares_think( self );
|
||||
level thread maps\_helicopter_ai::evasive_think( self );
|
||||
|
||||
if ( getdvar( "cobrapilot_wingman_enabled" ) == "1" )
|
||||
{
|
||||
if ( isdefined( self.script_wingman ) )
|
||||
{
|
||||
level.wingman = self;
|
||||
level thread maps\_helicopter_ai::wingman_think( self );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flares_think( vehicle )
|
||||
{
|
||||
vehicle endon( "death" );
|
||||
while ( vehicle.health > 0 )
|
||||
{
|
||||
if ( isdefined( vehicle.playercontrolled ) )
|
||||
{
|
||||
if ( ( !vehicle.pilot buttonPressed( level.flareButton1 ) ) && ( !vehicle.pilot buttonPressed( level.flareButton2 ) ) )
|
||||
{
|
||||
wait 0.05;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vehicle waittill( "incomming_missile", eMissile );
|
||||
if ( !isdefined( eMissile ) )
|
||||
continue;
|
||||
|
||||
//sometimes dont drop flares
|
||||
if ( randomint( 3 ) == 0 )
|
||||
continue;
|
||||
|
||||
wait randomfloatrange( 0.5, 1.0 );
|
||||
}
|
||||
|
||||
flares_fire( vehicle );
|
||||
|
||||
wait 0.05;
|
||||
if ( !isdefined( vehicle.playercontrolled ) )
|
||||
wait 3.0;
|
||||
}
|
||||
}
|
||||
|
||||
flares_fire_burst( vehicle, fxCount, flareCount, flareTime )
|
||||
{
|
||||
assert( isdefined( level.flare_fx[ vehicle.vehicletype ] ) );
|
||||
|
||||
assert( fxCount >= flareCount );
|
||||
|
||||
for ( i = 0 ; i < fxCount ; i++ )
|
||||
{
|
||||
playfx( level.flare_fx[ vehicle.vehicletype ], vehicle getTagOrigin( "tag_flare" ) );
|
||||
|
||||
if ( isdefined( vehicle.playercontrolled ) )
|
||||
{
|
||||
level.stats[ "flares_used" ]++ ;
|
||||
if ( getdvar( "cobrapilot_sounds_enabled" ) == "1" )
|
||||
vehicle.pilot playLocalSound( "weap_flares_fire" );
|
||||
}
|
||||
|
||||
if ( i <= flareCount - 1 )
|
||||
thread flares_redirect_missiles( vehicle, flareTime );
|
||||
|
||||
wait 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
flares_fire( vehicle )
|
||||
{
|
||||
vehicle endon( "death" );
|
||||
|
||||
if ( isdefined( vehicle.playercontrolled ) )
|
||||
{
|
||||
flareTime = 1.0;
|
||||
while ( ( vehicle.pilot buttonPressed( level.flareButton1 ) ) || ( vehicle.pilot buttonPressed( level.flareButton2 ) ) )
|
||||
{
|
||||
flares_fire_burst( vehicle, 1, 1, flareTime );
|
||||
flareTime = flareTime + 1.0;
|
||||
if ( flareTime > 5.0 )
|
||||
flareTime = 5.0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flares_fire_burst( vehicle, 8, 1, 5.0 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
flares_redirect_missiles( vehicle, flareTime )
|
||||
{
|
||||
vehicle notify( "flares_out" );
|
||||
vehicle endon( "death" );
|
||||
vehicle endon( "flares_out" );
|
||||
|
||||
if ( !isdefined( flareTime ) )
|
||||
flareTime = 5.0;
|
||||
|
||||
// create a script_origin at the flares location and move it down with gravity
|
||||
vec = flares_get_vehicle_velocity( vehicle );
|
||||
flare = spawn( "script_origin", vehicle getTagOrigin( "tag_flare" ) );
|
||||
flare movegravity( vec, flareTime );
|
||||
|
||||
if ( !isdefined( vehicle.incomming_Missiles ) )
|
||||
return;
|
||||
|
||||
// redirect all incomming missiles to the new flares
|
||||
for ( i = 0 ; i < vehicle.incomming_Missiles.size ; i++ )
|
||||
vehicle.incomming_Missiles[ i ] Missile_SetTargetEnt( flare );
|
||||
|
||||
// wait for flares to burn out
|
||||
wait flareTime;
|
||||
|
||||
if ( !isdefined( vehicle.script_targetoffset_z ) )
|
||||
vehicle.script_targetoffset_z = 0;
|
||||
offset = ( 0, 0, vehicle.script_targetoffset_z );
|
||||
|
||||
// when the flares burn out redirect missiles to the main target again ( if missile is still alive )
|
||||
if ( !isdefined( vehicle.incomming_Missiles ) )
|
||||
return;
|
||||
for ( i = 0 ; i < vehicle.incomming_Missiles.size ; i++ )
|
||||
vehicle.incomming_Missiles[ i ] Missile_SetTargetEnt( vehicle, offset );
|
||||
}
|
||||
|
||||
flares_get_vehicle_velocity( vehicle )
|
||||
{
|
||||
org1 = vehicle.origin;
|
||||
wait 0.05;
|
||||
vec = ( vehicle.origin - org1 );
|
||||
return vector_multiply( vec, 20 );
|
||||
}
|
||||
|
||||
missile_deathWait( eMissile, eMissile_Target )
|
||||
{
|
||||
eMissile_Target endon( "death" );
|
||||
|
||||
eMissile waittill( "death" );
|
||||
|
||||
if ( !isdefined( eMissile_Target.incomming_Missiles ) )
|
||||
return;
|
||||
|
||||
eMissile_Target.incomming_Missiles = array_remove( eMissile_Target.incomming_Missiles, eMissile );
|
||||
}
|
||||
|
||||
getEnemyTarget( fRadius, iFOVcos, getAITargets, doSightTrace, getVehicleTargets, randomizeTargetArray, aExcluders )
|
||||
{
|
||||
if ( !isdefined( getAITargets ) )
|
||||
getAITargets = false;
|
||||
|
||||
if ( !isdefined( doSightTrace ) )
|
||||
doSightTrace = false;
|
||||
|
||||
if ( !isdefined( getVehicleTargets ) )
|
||||
getVehicleTargets = true;
|
||||
|
||||
if ( !isdefined( randomizeTargetArray ) )
|
||||
randomizeTargetArray = false;
|
||||
|
||||
// look for a vehicle target
|
||||
eTargets = [];
|
||||
eClosestValidTarget = undefined;
|
||||
|
||||
enemyTeam = common_scripts\utility::get_enemy_team( self.script_team );
|
||||
possibleTargets = [];
|
||||
//prof_begin( "cobrapilot_ai" );
|
||||
|
||||
if ( getVehicleTargets )
|
||||
{
|
||||
assert( isdefined( level.vehicles[ enemyTeam ] ) );
|
||||
for ( i = 0 ; i < level.vehicles[ enemyTeam ].size ; i++ )
|
||||
possibleTargets[ possibleTargets.size ] = level.vehicles[ enemyTeam ][ i ];
|
||||
}
|
||||
|
||||
if ( getAITargets )
|
||||
{
|
||||
enemyAI = getaiarray( enemyTeam );
|
||||
for ( i = 0 ; i < enemyAI.size ; i++ )
|
||||
{
|
||||
if( isdefined( enemyAI[ i ].ignored_by_attack_heli ) )
|
||||
continue;
|
||||
possibleTargets[ possibleTargets.size ] = enemyAI[ i ];
|
||||
}
|
||||
if ( enemyTeam == "allies" )
|
||||
{
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
possibleTargets[ possibleTargets.size ] = level.players[ i ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isdefined( aExcluders ) )
|
||||
possibleTargets = array_exclude( possibleTargets, aExcluders );
|
||||
|
||||
if ( randomizeTargetArray )
|
||||
possibleTargets = array_randomize( possibleTargets );
|
||||
|
||||
forwardvec = anglestoforward( self.angles );
|
||||
for ( i = 0 ; i < possibleTargets.size ; i++ )
|
||||
{
|
||||
// threatbias - if this is an ignored group then dont consider this target
|
||||
if ( ( isSentient( possibleTargets[ i ] ) ) && ( isSentient( self ) ) && ( self getThreatBiasGroup() != "" ) )
|
||||
{
|
||||
bias = getThreatBias( possibleTargets[ i ] getThreatBiasGroup(), self getThreatBiasGroup() );
|
||||
if ( bias <= -1000000 )
|
||||
continue;
|
||||
}
|
||||
|
||||
// check if the target is within range
|
||||
if ( isdefined( fRadius ) && ( fRadius > 0 ) )
|
||||
{
|
||||
if ( distance( self.origin, possibleTargets[ i ].origin ) > fRadius )
|
||||
continue;
|
||||
}
|
||||
|
||||
// check if the target is within fov
|
||||
if ( isdefined( iFOVcos ) )
|
||||
{
|
||||
normalvec = vectorNormalize( possibleTargets[ i ].origin - ( self.origin ) );
|
||||
vecdot = vectordot( forwardvec, normalvec );
|
||||
if ( vecdot <= iFOVcos )
|
||||
continue;
|
||||
}
|
||||
|
||||
// check if a sight trace passes
|
||||
if ( doSightTrace )
|
||||
{
|
||||
sightTracePassed = false;
|
||||
if ( isAi( possibleTargets[ i ] ) )
|
||||
TraceZoffset = 48;
|
||||
else
|
||||
TraceZoffset = 150;
|
||||
sightTracePassed = sighttracepassed( self.origin, possibleTargets[ i ].origin + ( 0, 0, TraceZoffset ), false, self );
|
||||
if ( !sightTracePassed )
|
||||
continue;
|
||||
}
|
||||
|
||||
eTargets[ eTargets.size ] = possibleTargets[ i ];
|
||||
}
|
||||
|
||||
//prof_end( "cobrapilot_ai" );
|
||||
|
||||
self notify( "gunner_new_target" );
|
||||
|
||||
// return if no targets were found
|
||||
if ( eTargets.size == 0 )
|
||||
return eClosestValidTarget;
|
||||
|
||||
// if only one target was found return it
|
||||
if ( eTargets.size == 1 )
|
||||
return eTargets[ 0 ];
|
||||
|
||||
// return the closest of the targets
|
||||
//prof_begin( "cobrapilot_ai" );
|
||||
theTarget = getClosest( self.origin, eTargets );
|
||||
//prof_end( "cobrapilot_ai" );
|
||||
|
||||
return theTarget;
|
||||
}
|
||||
|
||||
shootEnemyTarget_Bullets( eTarget )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "mg_off" );
|
||||
eTarget endon( "death" );
|
||||
self endon( "gunner_new_target" );
|
||||
if ( isdefined( self.playercontrolled ) )
|
||||
self endon( "gunner_stop_firing" );
|
||||
|
||||
eTargetOffset = ( 0, 0, 0 );
|
||||
if ( isdefined( eTarget.script_targetoffset_z ) )
|
||||
eTargetOffset += ( 0, 0, eTarget.script_targetoffset_z );
|
||||
else if ( isSentient( eTarget ) )
|
||||
eTargetOffset = ( 0, 0, 32 );
|
||||
|
||||
self setTurretTargetEnt( eTarget, eTargetOffset );
|
||||
|
||||
while ( self.health > 0 )
|
||||
{
|
||||
randomShots = randomintrange( 1, 25 );
|
||||
if ( getdvar( "cobrapilot_debug" ) == "1" )
|
||||
iprintln( "randomShots = " + randomShots );
|
||||
|
||||
for ( i = 0 ; i < randomShots ; i++ )
|
||||
{
|
||||
// if the vehicle firing the bullets is the players vehicle we have to switch to the 20mm gun
|
||||
if ( isdefined( self.playercontrolled ) )
|
||||
{
|
||||
if ( ( isdefined( level.cobraWeapon ) ) && ( level.cobraWeapon.size > 0 ) )
|
||||
self setVehWeapon( level.GunnerWeapon );
|
||||
}
|
||||
|
||||
self thread shootEnemyTarget_Bullets_DebugLine( self, "tag_turret", eTarget, eTargetOffset, ( 1, 1, 0 ), 0.05 );
|
||||
self fireWeapon( "tag_flash" );
|
||||
|
||||
// then switch it back to the players selection after the shots are fired
|
||||
if ( isdefined( self.playercontrolled ) )
|
||||
self setVehWeapon( level.cobraWeapon[ self.pilot.currentWeapon ].v[ "weapon" ] );
|
||||
|
||||
wait 0.05;
|
||||
}
|
||||
|
||||
wait randomFloatRange( 0.25, 2.5 );
|
||||
}
|
||||
}
|
||||
|
||||
shootEnemyTarget_Bullets_DebugLine( eStartEnt, eStartEntTag, eTarget, eTargetOffset, color, timer )
|
||||
{
|
||||
if ( getdvar( "cobrapilot_debug" ) != "1" )
|
||||
return;
|
||||
|
||||
if ( !isdefined( color ) )
|
||||
color = ( 0, 0, 0 );
|
||||
|
||||
eTarget endon( "death" );
|
||||
self endon( "gunner_new_target" );
|
||||
|
||||
assert( isdefined( eStartEntTag ) );
|
||||
|
||||
if ( !isdefined( eTargetOffset ) )
|
||||
eTargetOffset = ( 0, 0, 0 );
|
||||
|
||||
if ( isdefined( timer ) )
|
||||
{
|
||||
timer = gettime() + ( timer * 1000 );
|
||||
while ( gettime() < timer )
|
||||
{
|
||||
line( eStartEnt getTagOrigin( eStartEntTag ), eTarget.origin + eTargetOffset, color );
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
line( eStartEnt getTagOrigin( eStartEntTag ), eTarget.origin + eTargetOffset, color );
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
attachMissiles( weapon1, weapon2, weapon3, weapon4 )
|
||||
{
|
||||
self.hasAttachedWeapons = true;
|
||||
assert( isdefined( weapon1 ) );
|
||||
weapon = [];
|
||||
weapon[ 0 ] = weapon1;
|
||||
if ( isdefined( weapon2 ) )
|
||||
weapon[ 1 ] = weapon2;
|
||||
if ( isdefined( weapon3 ) )
|
||||
weapon[ 2 ] = weapon3;
|
||||
if ( isdefined( weapon4 ) )
|
||||
weapon[ 3 ] = weapon4;
|
||||
|
||||
/*
|
||||
for( i = 0 ; i < weapon.size ; i++ )
|
||||
{
|
||||
for( k = 0 ; k < level.cobra_weapon_tags[weapon[i]].size ; k++ )
|
||||
{
|
||||
self attach( level.cobra_missile_models[weapon[i]], level.cobra_weapon_tags[weapon[i]][k] );
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
for ( i = 0 ; i < weapon.size ; i++ )
|
||||
{
|
||||
for ( k = 0 ; k < level.cobra_weapon_tags[ weapon[ i ] ].size ; k++ )
|
||||
{
|
||||
self attach( level.cobra_missile_models[ weapon[ i ] ], level.cobra_weapon_tags[ weapon[ i ] ][ k ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fire_missile( sMissileType, iShots, eTarget, fDelay )
|
||||
{
|
||||
if ( !isdefined( iShots ) )
|
||||
iShots = 1;
|
||||
assert( self.health > 0 );
|
||||
|
||||
weaponName = undefined;
|
||||
weaponShootTime = undefined;
|
||||
defaultWeapon = "cobra_20mm";
|
||||
tags = [];
|
||||
switch( sMissileType )
|
||||
{
|
||||
case "f15_missile":
|
||||
weaponName = "cobra_Sidewinder";
|
||||
tags[ 0 ] = "le_side_wing_jnt";
|
||||
tags[ 1 ] = "ri_side_wing_jnt";
|
||||
break;
|
||||
case "mi28_seeker":
|
||||
weaponName = "cobra_seeker";
|
||||
tags[ 0 ] = "tag_store_L_1_a";
|
||||
tags[ 1 ] = "tag_store_R_1_a";
|
||||
tags[ 2 ] = "tag_store_L_2_a";
|
||||
tags[ 3 ] = "tag_store_R_2_a";
|
||||
break;
|
||||
case "ffar":
|
||||
weaponName = "cobra_FFAR";
|
||||
tags[ 0 ] = "tag_store_r_2";
|
||||
break;
|
||||
case "seeker":
|
||||
weaponName = "cobra_seeker";
|
||||
tags[ 0 ] = "tag_store_r_2";
|
||||
break;
|
||||
case "ffar_bog_a_lite":
|
||||
weaponName = "cobra_FFAR_bog_a_lite";
|
||||
tags[ 0 ] = "tag_store_r_2";
|
||||
break;
|
||||
case "ffar_airlift":
|
||||
weaponName = "cobra_FFAR_airlift";
|
||||
tags[ 0 ] = "tag_store_L_wing";
|
||||
tags[ 1 ] = "tag_store_R_wing";
|
||||
break;
|
||||
case "ffar_airlift_nofx":
|
||||
weaponName = "cobra_FFAR_airlift_nofx";
|
||||
tags[ 0 ] = "tag_store_L_wing";
|
||||
tags[ 1 ] = "tag_store_R_wing";
|
||||
break;
|
||||
case "cobra_zippy":
|
||||
weaponName = "zippy_rockets";
|
||||
tags[ 0 ] = "tag_store_L_wing";
|
||||
tags[ 1 ] = "tag_store_R_wing";
|
||||
break;
|
||||
case "cobra_turret":
|
||||
weaponName = "hind_turret_penetration";
|
||||
tags[ 0 ] = "tag_store_L_wing";
|
||||
tags[ 1 ] = "tag_store_R_wing";
|
||||
break;
|
||||
case "ffar_hind":
|
||||
defaultWeapon = "hind_turret";
|
||||
weaponName = "hind_FFAR";
|
||||
tags[ 0 ] = "tag_missile_left";
|
||||
tags[ 1 ] = "tag_missile_right";
|
||||
break;
|
||||
case "hind_zippy":
|
||||
defaultWeapon = "hind_turret";
|
||||
weaponName = "zippy_rockets";
|
||||
tags[ 0 ] = "tag_missile_left";
|
||||
tags[ 1 ] = "tag_missile_right";
|
||||
break;
|
||||
case "ffar_hind_nodamage":
|
||||
defaultWeapon = "hind_turret";
|
||||
weaponName = "hind_FFAR_nodamage";
|
||||
tags[ 0 ] = "tag_missile_left";
|
||||
tags[ 1 ] = "tag_missile_right";
|
||||
break;
|
||||
case "ffar_mi28_village_assault":
|
||||
defaultWeapon = "hind_turret";
|
||||
weaponName = "mi28_ffar_village_assault";
|
||||
tags[ 0 ] = "tag_store_L_2_a";
|
||||
tags[ 1 ] = "tag_store_R_2_a";
|
||||
tags[ 2 ] = "tag_store_L_2_b";
|
||||
tags[ 3 ] = "tag_store_R_2_b";
|
||||
tags[ 4 ] = "tag_store_L_2_c";
|
||||
tags[ 5 ] = "tag_store_R_2_c";
|
||||
tags[ 6 ] = "tag_store_L_2_d";
|
||||
tags[ 7 ] = "tag_store_R_2_d";
|
||||
break;
|
||||
case "ffar_co_rescue":
|
||||
weaponName = "cobra_FFAR_bog_a_lite";
|
||||
tags[ 0 ] = "tag_store_R_2_a";
|
||||
tags[ 1 ] = "tag_store_L_2_a";
|
||||
break;
|
||||
default:
|
||||
assertMsg( "Invalid missile type specified." );
|
||||
break;
|
||||
}
|
||||
assert( isdefined( weaponName ) );
|
||||
assert( tags.size > 0 );
|
||||
|
||||
weaponShootTime = weaponfiretime( weaponName );
|
||||
assert( isdefined( weaponShootTime ) );
|
||||
|
||||
nextMissileTag = -1;
|
||||
for ( i = 0 ; i < iShots ; i++ )
|
||||
{
|
||||
nextMissileTag++ ;
|
||||
if ( nextMissileTag >= tags.size )
|
||||
nextMissileTag = 0;
|
||||
|
||||
if ( sMissileType == "ffar_mi28_village_assault" )
|
||||
{
|
||||
if ( isdefined( eTarget ) && isdefined( eTarget.origin ) )
|
||||
{
|
||||
magicBullet( weaponName, self getTagOrigin( tags[ nextMissileTag ] ), eTarget.origin );
|
||||
if ( isdefined( level._effect[ "ffar_mi28_muzzleflash" ] ) )
|
||||
playfxontag( getfx( "ffar_mi28_muzzleflash" ), self, tags[ nextMissileTag ] );
|
||||
thread delayed_earthquake( 0.1, 0.5, 0.2, eTarget.origin, 1600 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self setVehWeapon( weaponName );
|
||||
if ( isdefined( eTarget ) )
|
||||
{
|
||||
eMissile = self fireWeapon( tags[ nextMissileTag ], eTarget );
|
||||
if ( sMissileType == "ffar" )
|
||||
eMissile thread missileLoseTarget( 0.1 );
|
||||
if ( sMissileType == "ffar_bog_a_lite" )
|
||||
eMissile thread missileLoseTarget( 0.1 );
|
||||
if ( sMissileType == "ffar_airlift" )
|
||||
eMissile thread missileLoseTarget( 0.1 );
|
||||
}
|
||||
else
|
||||
eMissile = self fireWeapon( tags[ nextMissileTag ] );
|
||||
}
|
||||
|
||||
if ( i < iShots - 1 )
|
||||
wait weaponShootTime;
|
||||
|
||||
if ( isdefined( fDelay ) )
|
||||
wait( fDelay );
|
||||
}
|
||||
|
||||
self setVehWeapon( defaultWeapon );
|
||||
}
|
||||
|
||||
delayed_earthquake( fDelay, scale, duration, source, fRadius )
|
||||
{
|
||||
wait fDelay;
|
||||
earthquake( scale, duration, source, fRadius );
|
||||
}
|
||||
|
||||
missileLoseTarget( fDelay )
|
||||
{
|
||||
self endon( "death" );
|
||||
wait fDelay;
|
||||
if ( isdefined( self ) )
|
||||
self Missile_ClearTarget();
|
||||
}
|
||||
@@ -0,0 +1,467 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\_anim;
|
||||
|
||||
hiding_door_spawner()
|
||||
{
|
||||
// place a hiding_door_guy prefab and then place a spawner next to it with script_noteworthy "hiding_door_spawner".
|
||||
// Spawn the guy however you like (trigger or script)
|
||||
// Target the spawner to a trigger, this trigger will make the guy open the door.
|
||||
// Alternatively put a script_flag_wait on the spawner. The guy will wait for the flag to be set before opening the door.
|
||||
// If you put neither, a trigger_radius will be spawned, using the radius of the spawner if a radius is set
|
||||
|
||||
door_orgs = getentarray( "hiding_door_guy_org", "targetname" );
|
||||
assertex( door_orgs.size, "Hiding door guy with export " + self.export + " couldn't find a hiding_door_org!" );
|
||||
|
||||
door_org = getclosest( self.origin, door_orgs );
|
||||
assertex( distance( door_org.origin, self.origin ) < 256, "Hiding door guy with export " + self.export + " was not placed within 256 units of a hiding_door_org" );
|
||||
|
||||
door_org.targetname = undefined;// so future searches won't grab this one
|
||||
|
||||
//get door models (and script_brushmodel doors, if applicable)
|
||||
door_models = getentarray( door_org.target, "targetname" );
|
||||
door_model = undefined;
|
||||
brushmodel_door = undefined;
|
||||
|
||||
badplaceBrush = undefined;
|
||||
if( IsDefined( door_org.script_linkto ) )
|
||||
{
|
||||
badplaceBrush = door_org get_linked_ent();
|
||||
}
|
||||
|
||||
//if there is only one ent, it must be the script_model door
|
||||
if ( door_models.size == 1 )
|
||||
{
|
||||
door_model = door_models[ 0 ];
|
||||
}
|
||||
|
||||
//if targeting more than one ent, the LD wants to substitute a custom script_brushmodel door
|
||||
else
|
||||
{
|
||||
foreach( ent in door_models )
|
||||
{
|
||||
if ( ent.code_classname == "script_brushmodel" )
|
||||
{
|
||||
brushmodel_door = ent;
|
||||
}
|
||||
else if ( ent.code_classname == "script_model" )
|
||||
{
|
||||
door_model = ent;
|
||||
}
|
||||
}
|
||||
assertex( isdefined( brushmodel_door ), "Hiding door org at " + door_org.origin + " targets multiple entities, but not a script_brushmodel door" );
|
||||
assertex( isdefined( door_model ), "Hiding door org at " + door_org.origin + " targets multiple entities, but not a script_model door" );
|
||||
}
|
||||
|
||||
door_clip = getent( door_model.target, "targetname" );
|
||||
assert( isdefined( door_model.target ) );
|
||||
|
||||
pushPlayerClip = undefined;
|
||||
if ( isdefined( door_clip.target ) )
|
||||
pushPlayerClip = getent( door_clip.target, "targetname" );
|
||||
if ( isdefined( pushPlayerClip ) )
|
||||
{
|
||||
door_org thread hiding_door_guy_pushplayer( pushPlayerClip );
|
||||
|
||||
if( !IsDefined( level._hiding_door_pushplayer_clips ) )
|
||||
{
|
||||
level._hiding_door_pushplayer_clips = [];
|
||||
}
|
||||
level._hiding_door_pushplayer_clips[ level._hiding_door_pushplayer_clips.size ] = pushPlayerClip;
|
||||
}
|
||||
|
||||
door_model delete();// we spawn our own door, the one in the prefab is just to aid placement
|
||||
|
||||
door = spawn_anim_model( "hiding_door" );
|
||||
door_org thread anim_first_frame_solo( door, "fire_3" );
|
||||
if ( isdefined( brushmodel_door ) )
|
||||
{
|
||||
brushmodel_door linkTo( door, "door_hinge_jnt" );
|
||||
door hide();
|
||||
}
|
||||
|
||||
if ( isdefined( door_clip ) )
|
||||
{
|
||||
door_clip linkto( door, "door_hinge_jnt" );
|
||||
door_clip disconnectPaths();
|
||||
}
|
||||
|
||||
trigger = undefined;
|
||||
if ( isdefined( self.target ) )
|
||||
{
|
||||
trigger = getent( self.target, "targetname" );
|
||||
if ( !issubstr( trigger.classname, "trigger" ) )
|
||||
trigger = undefined;
|
||||
}
|
||||
|
||||
if ( !isdefined( self.script_flag_wait ) && !isdefined( trigger ) )
|
||||
{
|
||||
radius = 200;
|
||||
if ( isdefined( self.radius ) )
|
||||
radius = self.radius;
|
||||
|
||||
// no trigger mechanism specified, so add a radius trigger
|
||||
trigger = spawn( "trigger_radius", door_org.origin, 0, radius, 48 );
|
||||
}
|
||||
|
||||
if ( isdefined( badplaceBrush ) )
|
||||
badPlace_Brush( badplaceBrush getentitynumber(), 0, badplaceBrush, "allies" );
|
||||
|
||||
self add_spawn_function( ::hiding_door_guy, door_org, trigger, door, door_clip, badplaceBrush );
|
||||
}
|
||||
|
||||
hiding_door_guy( door_org, trigger, door, door_clip, badplaceBrush )
|
||||
{
|
||||
starts_open = hiding_door_starts_open( door_org );
|
||||
|
||||
self.animname = "hiding_door_guy";
|
||||
self endon( "death" );
|
||||
self endon( "damage" );
|
||||
|
||||
self.grenadeammo = 2;
|
||||
|
||||
self set_deathanim( "death_2" );
|
||||
self.allowdeath = true;
|
||||
self.health = 50000;// buffer health, he "dies" in one hit
|
||||
|
||||
guy_and_door = [];
|
||||
guy_and_door[ guy_and_door.size ] = door;
|
||||
guy_and_door[ guy_and_door.size ] = self;
|
||||
|
||||
thread hiding_door_guy_cleanup( door_org, self, door, door_clip, badplaceBrush );
|
||||
thread hiding_door_death( door, door_org, self, door_clip, badplaceBrush );
|
||||
|
||||
if ( starts_open )
|
||||
{
|
||||
// wait for trigger before closing the door
|
||||
door_org thread anim_loop( guy_and_door, "idle" );
|
||||
}
|
||||
else
|
||||
{
|
||||
door_org thread anim_first_frame( guy_and_door, "fire_3" );
|
||||
}
|
||||
|
||||
if ( isdefined( trigger ) )
|
||||
{
|
||||
wait 0.05;
|
||||
trigger waittill( "trigger" );
|
||||
}
|
||||
else
|
||||
{
|
||||
flag_wait( self.script_flag_wait );
|
||||
}
|
||||
|
||||
if ( starts_open )
|
||||
{
|
||||
door_org notify( "stop_loop" );
|
||||
door_org anim_single( guy_and_door, "close" );
|
||||
}
|
||||
|
||||
counter = 0;
|
||||
timesFired = 0;
|
||||
for ( ;; )
|
||||
{
|
||||
//-----------------
|
||||
// GET ENEMY AND ENEMY DIRECTION
|
||||
//-----------------
|
||||
|
||||
enemy = level.player;
|
||||
if ( isdefined( self.enemy ) )
|
||||
enemy = self.enemy;
|
||||
assert( isdefined( enemy ) );
|
||||
direction = hiding_door_get_enemy_direction( door.angles, self.origin, enemy.origin );
|
||||
|
||||
//-----------------
|
||||
// ABORT CONDITIONS
|
||||
//-----------------
|
||||
|
||||
// Abort door behavior if the player comes up behind the AI
|
||||
if ( self player_entered_backdoor( direction ) )
|
||||
{
|
||||
if ( self quit_door_behavior() )
|
||||
return;
|
||||
}
|
||||
|
||||
// Abort door behavior after peeking a couple times if the player can see him from behind
|
||||
if ( counter >= 2 )
|
||||
{
|
||||
if ( self quit_door_behavior( true ) )
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------
|
||||
// DETERMINE SCENE BASED ON ENEMY DIRECTION
|
||||
//-----------------
|
||||
|
||||
scene = undefined;
|
||||
if ( direction == "left" || direction == "front" )
|
||||
{
|
||||
scene = "fire_3";
|
||||
}
|
||||
else if ( direction == "right" )
|
||||
{
|
||||
scene = "fire_1";
|
||||
if ( cointoss() )
|
||||
scene = "fire_2";
|
||||
}
|
||||
else
|
||||
{
|
||||
// player or enemy is behind him so just open and close the door and peek
|
||||
door_org anim_single( guy_and_door, "open" );
|
||||
door_org anim_single( guy_and_door, "close" );
|
||||
counter++;
|
||||
continue;
|
||||
}
|
||||
assert( isdefined( scene ) );
|
||||
|
||||
//-----------------
|
||||
// CHARGE CONDITION + CHANCE
|
||||
//-----------------
|
||||
|
||||
if ( self hiding_door_guy_should_charge( direction, enemy, timesFired ) )
|
||||
{
|
||||
scene = "jump";
|
||||
if ( coinToss() )
|
||||
{
|
||||
if ( self mayMoveToPoint( animscripts\utility::getAnimEndPos( level.scr_anim[ self.animname ][ "kick" ] ) ) )
|
||||
scene = "kick";
|
||||
}
|
||||
|
||||
// connect paths on the door and handle player clip
|
||||
thread hiding_door_death_door_connections( door_clip, badplaceBrush );
|
||||
door_org notify( "push_player" );
|
||||
|
||||
// stop the thread that waits for him to break out of door behavior to open the door since this anim opens it for us
|
||||
self notify( "charge" );
|
||||
|
||||
// guy charges out
|
||||
self.allowdeath = true;
|
||||
self.health = 100;
|
||||
self clear_deathanim();
|
||||
door_org anim_single( guy_and_door, scene );
|
||||
|
||||
// now he goes to exposed combat
|
||||
self quit_door_behavior();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
//-----------------
|
||||
// THROW A GRENADE?
|
||||
//-----------------
|
||||
|
||||
// randomly do grenade throw if the AI has grenade ammo. More likely if hte AI has more grenades
|
||||
if ( self hiding_door_guy_should_throw_grenade( direction, timesFired ) )
|
||||
{
|
||||
self.grenadeammo--;
|
||||
scene = "grenade";
|
||||
}
|
||||
|
||||
counter = 0;
|
||||
timesFired++;
|
||||
|
||||
//-----------------
|
||||
// DO ANIM
|
||||
//-----------------
|
||||
|
||||
door_org thread anim_single( guy_and_door, scene );
|
||||
|
||||
// delay the settime by a frame or it wont work
|
||||
// this is so we can skip the slow creep part of the animation
|
||||
delaythread( 0.05, ::anim_set_time, guy_and_door, scene, 0.3 );
|
||||
door_org waittill( scene );
|
||||
|
||||
//-----------------
|
||||
// IDLE FOR A MOMENT
|
||||
//-----------------
|
||||
|
||||
door_org thread anim_first_frame( guy_and_door, "open" );
|
||||
wait( randomfloatrange( 0.2, 1.0 ) );
|
||||
door_org notify( "stop_loop" );
|
||||
}
|
||||
}
|
||||
|
||||
quit_door_behavior( sightTraceRequired, door_org )
|
||||
{
|
||||
if ( !isdefined( sightTraceRequired ) )
|
||||
sightTraceRequired = false;
|
||||
|
||||
if ( sightTraceRequired )
|
||||
{
|
||||
if ( !sightTracePassed( level.player getEye(), self getEye(), false, self ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
self.health = 100;
|
||||
self clear_deathanim();
|
||||
self.goalradius = 512;
|
||||
self setGoalPos( self.origin );
|
||||
self notify( "quit_door_behavior" );
|
||||
self stopanimscripted();
|
||||
self notify( "killanimscript" );
|
||||
return true;
|
||||
}
|
||||
|
||||
player_entered_backdoor( direction )
|
||||
{
|
||||
if ( direction != "behind" )
|
||||
return false;
|
||||
|
||||
d = distance( self.origin, level.player.origin );
|
||||
if ( d > 250 )
|
||||
return false;
|
||||
|
||||
if ( !sightTracePassed( level.player getEye(), self getEye(), false, self ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
hiding_door_guy_should_charge( direction, enemy, timesFired )
|
||||
{
|
||||
TIMES_FIRED_MIN = 3;
|
||||
MIN_DIST = 100;
|
||||
MAX_DIST = 600;
|
||||
|
||||
if ( timesFired < TIMES_FIRED_MIN )
|
||||
return false;
|
||||
|
||||
if ( enemy != level.player )
|
||||
return false;
|
||||
|
||||
if ( direction != "front" )
|
||||
return false;
|
||||
|
||||
d = distance( self.origin, level.player.origin );
|
||||
if ( d < MIN_DIST )
|
||||
return false;
|
||||
if ( d > MAX_DIST )
|
||||
return false;
|
||||
|
||||
return coinToss();
|
||||
}
|
||||
|
||||
hiding_door_guy_should_throw_grenade( direction, timesFired )
|
||||
{
|
||||
if ( timesFired < 1 )
|
||||
return false;
|
||||
if ( direction == "behind" )
|
||||
return false;
|
||||
if ( randomint( 100 ) < 25 * self.grenadeammo )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
hiding_door_get_enemy_direction( viewerAngles, viewerOrigin, targetOrigin )
|
||||
{
|
||||
forward = anglesToForward( viewerAngles );
|
||||
vFacing = vectorNormalize( forward );
|
||||
anglesToFacing = vectorToAngles( vFacing );
|
||||
anglesToPoint = vectorToAngles( targetOrigin - viewerOrigin );
|
||||
|
||||
angle = anglesToFacing[ 1 ] - anglesToPoint[ 1 ];
|
||||
angle += 360;
|
||||
angle = int( angle ) % 360;
|
||||
|
||||
direction = undefined;
|
||||
|
||||
if ( angle >= 90 && angle <= 270 )
|
||||
direction = "behind";
|
||||
else if ( angle >= 300 || angle <= 45 )
|
||||
direction = "front";
|
||||
else if ( angle < 90 )
|
||||
direction = "right";
|
||||
else if ( angle > 270 )
|
||||
direction = "left";
|
||||
|
||||
assert( isdefined( direction ) );
|
||||
return direction;
|
||||
}
|
||||
|
||||
hiding_door_guy_cleanup( door_org, guy, door, door_clip, badplaceBrush )
|
||||
{
|
||||
guy endon( "charge" );
|
||||
|
||||
// if the guy gets deleted before the sequence happens this thread will catch that and clean up any problems that could arise
|
||||
guy waittill_either( "death", "quit_door_behavior" );
|
||||
|
||||
// stop the looping animations because the guy is removed now
|
||||
door_org notify( "stop_loop" );
|
||||
|
||||
thread hiding_door_death_door_connections( door_clip, badplaceBrush );
|
||||
door_org notify( "push_player" );
|
||||
if ( !isdefined( door.played_death_anim ) )
|
||||
{
|
||||
door.played_death_anim = true;
|
||||
door_org thread anim_single_solo( door, "death_2" );
|
||||
}
|
||||
}
|
||||
|
||||
hiding_door_guy_pushplayer( pushPlayerClip )
|
||||
{
|
||||
self waittill( "push_player" );
|
||||
pushPlayerClip moveto( self.origin, 1.5 );
|
||||
wait 1.5;
|
||||
pushPlayerClip delete();
|
||||
}
|
||||
|
||||
hiding_door_guy_grenade_throw( guy )
|
||||
{
|
||||
// called from a notetrack
|
||||
startOrigin = guy getTagOrigin( "J_Wrist_RI" );
|
||||
strength = ( distance( level.player.origin, guy.origin ) * 2.0 );
|
||||
if ( strength < 300 )
|
||||
strength = 300;
|
||||
if ( strength > 1000 )
|
||||
strength = 1000;
|
||||
vector = vectorNormalize( level.player.origin - guy.origin );
|
||||
velocity = vector_multiply( vector, strength );
|
||||
guy magicGrenadeManual( startOrigin, velocity, randomfloatrange( 3.0, 5.0 ) );
|
||||
}
|
||||
|
||||
hiding_door_death( door, door_org, guy, door_clip, badplaceBrush )
|
||||
{
|
||||
guy endon( "charge" );
|
||||
guy endon( "quit_door_behavior" );
|
||||
|
||||
guy waittill( "damage", dmg, attacker );
|
||||
if ( !isalive( guy ) )
|
||||
return;
|
||||
thread hiding_door_death_door_connections( door_clip, badplaceBrush );
|
||||
door_org notify( "push_player" );
|
||||
door_org thread anim_single_solo( guy, "death_2" );
|
||||
if ( !isdefined( door.played_death_anim ) )
|
||||
{
|
||||
door.played_death_anim = true;
|
||||
door_org thread anim_single_solo( door, "death_2" );
|
||||
}
|
||||
wait( 0.5 );
|
||||
if ( isalive( guy ) )
|
||||
{
|
||||
if ( IsDefined( attacker ) )
|
||||
{
|
||||
guy Kill( ( 0, 0, 0 ), attacker );
|
||||
}
|
||||
else
|
||||
{
|
||||
//guy.a.nodeath = true;
|
||||
guy kill( ( 0, 0, 0 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hiding_door_death_door_connections( door_clip, badplaceBrush )
|
||||
{
|
||||
wait 2;
|
||||
|
||||
if ( isdefined( door_clip ) )
|
||||
door_clip disconnectpaths();
|
||||
|
||||
if ( isdefined( badplaceBrush ) )
|
||||
badPlace_Delete( badplaceBrush getentitynumber() );
|
||||
}
|
||||
|
||||
hiding_door_starts_open( door_org )
|
||||
{
|
||||
return ( isdefined( door_org.script_noteworthy ) && ( door_org.script_noteworthy == "starts_open" ) );
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
#include maps\_anim;
|
||||
#include maps\_utility;
|
||||
#using_animtree( "script_model" );
|
||||
main()
|
||||
{
|
||||
//level.scr_anim[ "chair" ][ "chair_react" ] = %parabolic_guard_sleeper_react_chair;
|
||||
//level.scr_animtree[ "chair" ] = #animtree;
|
||||
//level.scr_model[ "chair" ] = "com_folding_chair";
|
||||
|
||||
level.scr_animtree[ "hiding_door" ] = #animtree;
|
||||
level.scr_model[ "hiding_door" ] = "com_door_01_handleleft";
|
||||
|
||||
level.scr_anim[ "hiding_door" ][ "close" ] = %doorpeek_close_door;
|
||||
level.scr_anim[ "hiding_door" ][ "death_1" ] = %doorpeek_deathA_door;
|
||||
level.scr_anim[ "hiding_door" ][ "death_2" ] = %doorpeek_deathB_door;
|
||||
|
||||
level.scr_anim[ "hiding_door" ][ "fire_1" ] = %doorpeek_fireA_door;
|
||||
level.scr_anim[ "hiding_door" ][ "fire_2" ] = %doorpeek_fireB_door;
|
||||
level.scr_anim[ "hiding_door" ][ "fire_3" ] = %doorpeek_fireC_door;
|
||||
level.scr_anim[ "hiding_door" ][ "peek" ] = %doorpeek_idle_door;
|
||||
|
||||
level.scr_anim[ "hiding_door" ][ "grenade" ] = %doorpeek_grenade_door;
|
||||
|
||||
level.scr_anim[ "hiding_door" ][ "idle" ][ 0 ] = %doorpeek_idle_door;
|
||||
level.scr_anim[ "hiding_door" ][ "jump" ] = %doorpeek_jump_door;
|
||||
level.scr_anim[ "hiding_door" ][ "kick" ] = %doorpeek_kick_door;
|
||||
level.scr_anim[ "hiding_door" ][ "open" ] = %doorpeek_open_door;
|
||||
precachemodel( level.scr_model[ "hiding_door" ] );
|
||||
|
||||
addNotetrack_sound( "hiding_door", "sound door death", "any", "scn_doorpeek_door_open_death" );
|
||||
addNotetrack_sound( "hiding_door", "sound door open", "any", "scn_doorpeek_door_open" );
|
||||
addNotetrack_sound( "hiding_door", "sound door slam", "any", "scn_doorpeek_door_slam" );
|
||||
main_guy();
|
||||
thread notetracks();
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
main_guy()
|
||||
{
|
||||
|
||||
level.scr_anim[ "hiding_door_guy" ][ "close" ] = %doorpeek_close;
|
||||
level.scr_anim[ "hiding_door_guy" ][ "death_1" ] = %doorpeek_deathA;
|
||||
level.scr_anim[ "hiding_door_guy" ][ "death_2" ] = %doorpeek_deathB;
|
||||
|
||||
level.scr_anim[ "hiding_door_guy" ][ "fire_1" ] = %doorpeek_fireA;
|
||||
level.scr_anim[ "hiding_door_guy" ][ "fire_2" ] = %doorpeek_fireB;
|
||||
level.scr_anim[ "hiding_door_guy" ][ "fire_3" ] = %doorpeek_fireC;
|
||||
level.scr_anim[ "hiding_door_guy" ][ "peek" ] = %doorpeek_idle;
|
||||
|
||||
level.scr_anim[ "hiding_door_guy" ][ "grenade" ] = %doorpeek_grenade;
|
||||
|
||||
level.scr_anim[ "hiding_door_guy" ][ "idle" ][ 0 ] = %doorpeek_idle;
|
||||
level.scr_anim[ "hiding_door_guy" ][ "jump" ] = %doorpeek_jump;
|
||||
level.scr_anim[ "hiding_door_guy" ][ "kick" ] = %doorpeek_kick;
|
||||
level.scr_anim[ "hiding_door_guy" ][ "open" ] = %doorpeek_open;
|
||||
}
|
||||
|
||||
notetracks()
|
||||
{
|
||||
wait 0.05;
|
||||
maps\_anim::addNotetrack_customFunction( "hiding_door_guy", "grenade_throw", maps\_hiding_door::hiding_door_guy_grenade_throw );
|
||||
}
|
||||
+421
@@ -0,0 +1,421 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
main( model, type )
|
||||
{
|
||||
build_template( "hind", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_mi24p_hind_desert" );
|
||||
build_deathmodel( "vehicle_mi24p_hind_woodland" );
|
||||
build_deathmodel( "vehicle_mi24p_hind_woodland_opened_door" );
|
||||
|
||||
// this doesn't happen very much but it's a nicer cleaner format than the case statement.
|
||||
hind_death_fx = [];
|
||||
hind_death_fx[ "vehicle_mi24p_hind_desert" ] = "explosions/helicopter_explosion_hind_desert";
|
||||
hind_death_fx[ "vehicle_mi24p_hind_woodland" ] = "explosions/helicopter_explosion_hind_woodland";
|
||||
hind_death_fx[ "vehicle_mi24p_hind_woodland_opened_door" ] = "explosions/helicopter_explosion_hind_woodland";
|
||||
hind_death_fx[ "vehicle_mi24p_hind_chernobyl" ] = "explosions/helicopter_explosion_hind_chernobyl";
|
||||
|
||||
hind_aerial_death_fx = [];
|
||||
hind_aerial_death_fx[ "vehicle_mi24p_hind_desert" ] = "explosions/aerial_explosion_hind_desert";
|
||||
hind_aerial_death_fx[ "vehicle_mi24p_hind_woodland" ] = "explosions/aerial_explosion_hind_woodland";
|
||||
hind_aerial_death_fx[ "vehicle_mi24p_hind_woodland_opened_door" ] = "explosions/aerial_explosion_hind_woodland";
|
||||
hind_aerial_death_fx[ "vehicle_mi24p_hind_chernobyl" ] = "explosions/aerial_explosion_hind_chernobyl";
|
||||
|
||||
|
||||
build_drive( %bh_rotors, undefined, 0 );
|
||||
|
||||
build_deathfx( "explosions/grenadeexp_default", "tag_engine_left", "hind_helicopter_hit", undefined, undefined, undefined, 0.2, true );
|
||||
build_deathfx( "explosions/grenadeexp_default", "tail_rotor_jnt", "hind_helicopter_secondary_exp", undefined, undefined, undefined, 0.5, true );
|
||||
build_deathfx( "fire/fire_smoke_trail_L", "tail_rotor_jnt", "hind_helicopter_dying_loop", true, 0.05, true, 0.5, true );
|
||||
build_deathfx( "explosions/aerial_explosion", "tag_engine_right", "hind_helicopter_secondary_exp", undefined, undefined, undefined, 2.5, true );
|
||||
build_deathfx( "explosions/aerial_explosion", "tag_deathfx", "hind_helicopter_secondary_exp", undefined, undefined, undefined, 4.0 );
|
||||
build_deathfx( hind_death_fx[ model ], undefined, "hind_helicopter_crash", undefined, undefined, undefined, - 1, undefined, "stop_crash_loop_sound" );
|
||||
|
||||
build_rocket_deathfx( hind_aerial_death_fx[ model ], "tag_deathfx", "hind_helicopter_crash", undefined, undefined, undefined, undefined, true, undefined, 0 );
|
||||
|
||||
build_treadfx();
|
||||
|
||||
build_life( 999, 500, 1500 );
|
||||
|
||||
build_team( "axis" );
|
||||
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
|
||||
build_attach_models( ::set_attached_models );
|
||||
|
||||
build_unload_groups( ::Unload_Groups );
|
||||
|
||||
randomStartDelay = randomfloatrange( 0, 1 );
|
||||
build_light( model, "cockpit_blue_cargo01", "tag_light_cargo01", "misc/aircraft_light_cockpit_red", "interior", 0.0 );
|
||||
build_light( model, "cockpit_blue_cockpit01", "tag_light_cockpit01", "misc/aircraft_light_cockpit_blue", "interior", 0.1 );
|
||||
build_light( model, "white_blink", "tag_light_belly", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "white_blink_tail", "tag_light_tail", "misc/aircraft_light_red_blink", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_green", "tag_light_L_wing", "misc/aircraft_light_wingtip_green", "running", randomStartDelay );
|
||||
build_light( model, "wingtip_red", "tag_light_R_wing", "misc/aircraft_light_wingtip_red", "running", randomStartDelay );
|
||||
build_compassicon( "helicopter", false );
|
||||
|
||||
build_bulletshield( true );
|
||||
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
self.originheightoffset = 144;// TODO - FIXME: this is ugly.
|
||||
// self.fastropeoffset = 760; //blackhawk
|
||||
self.fastropeoffset = 792;// TODO - FIXME: this is ugly.
|
||||
//self.delete_on_death = true;
|
||||
self.script_badplace = false;// All helicopters dont need to create bad places
|
||||
maps\_vehicle::lights_on( "running" );
|
||||
//maps\_vehicle::lights_on( "interior" );
|
||||
|
||||
}
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
// positions[ 0 ].vehicle_getinanim = %tigertank_hatch_open;
|
||||
|
||||
for ( i = 0;i < positions.size;i++ )
|
||||
positions[ i ].vehicle_getoutanim = %bh_idle;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "fastrope" );
|
||||
|
||||
setplayer_anims( positions )
|
||||
{
|
||||
positions[ 3 ].player_idle = %bh_player_idle;
|
||||
positions[ 3 ].player_getout_sound = "fastrope_start_plr";
|
||||
positions[ 3 ].player_getout_sound_loop = "fastrope_loop_plr";
|
||||
positions[ 3 ].player_getout_sound_end = "fastrope_end_plr";
|
||||
|
||||
positions[ 3 ].player_getout = %bh_player_drop;
|
||||
positions[ 3 ].player_animtree = #animtree;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 9;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].idle[ 0 ] = %helicopter_pilot1_idle;
|
||||
positions[ 0 ].idle[ 1 ] = %helicopter_pilot1_twitch_clickpannel;
|
||||
positions[ 0 ].idle[ 2 ] = %helicopter_pilot1_twitch_lookback;
|
||||
positions[ 0 ].idle[ 3 ] = %helicopter_pilot1_twitch_lookoutside;
|
||||
positions[ 0 ].idleoccurrence[ 0 ] = 500;
|
||||
positions[ 0 ].idleoccurrence[ 1 ] = 100;
|
||||
positions[ 0 ].idleoccurrence[ 2 ] = 100;
|
||||
positions[ 0 ].idleoccurrence[ 3 ] = 100;
|
||||
|
||||
positions[ 1 ].idle[ 0 ] = %helicopter_pilot2_idle;
|
||||
positions[ 1 ].idle[ 1 ] = %helicopter_pilot2_twitch_clickpannel;
|
||||
positions[ 1 ].idle[ 2 ] = %helicopter_pilot2_twitch_lookoutside;
|
||||
positions[ 1 ].idle[ 3 ] = %helicopter_pilot2_twitch_radio;
|
||||
positions[ 1 ].idleoccurrence[ 0 ] = 450;
|
||||
positions[ 1 ].idleoccurrence[ 1 ] = 100;
|
||||
positions[ 1 ].idleoccurrence[ 2 ] = 100;
|
||||
positions[ 1 ].idleoccurrence[ 3 ] = 100;
|
||||
|
||||
positions[ 0 ].bHasGunWhileRiding = false;
|
||||
positions[ 1 ].bHasGunWhileRiding = false;
|
||||
|
||||
|
||||
// 1, 2, 4, 5, 8, 6
|
||||
positions[ 2 ].idle = %bh_1_idle;
|
||||
positions[ 3 ].idle = %bh_2_idle;
|
||||
positions[ 4 ].idle = %bh_4_idle;
|
||||
positions[ 5 ].idle = %bh_5_idle;
|
||||
positions[ 6 ].idle = %bh_8_idle;
|
||||
positions[ 7 ].idle = %bh_6_idle;
|
||||
positions[ 8 ].idle = %bh_7_idle;
|
||||
// positions[ 9 ].idle = %bh_2_idle;
|
||||
|
||||
|
||||
positions[ 0 ].sittag = "tag_driver";
|
||||
positions[ 1 ].sittag = "tag_passenger";
|
||||
positions[ 2 ].sittag = "tag_detach";
|
||||
positions[ 3 ].sittag = "tag_detach";
|
||||
positions[ 4 ].sittag = "tag_detach";
|
||||
positions[ 5 ].sittag = "tag_detach";
|
||||
positions[ 6 ].sittag = "tag_detach";
|
||||
positions[ 7 ].sittag = "tag_detach";
|
||||
positions[ 8 ].sittag = "tag_detach";
|
||||
// positions[ 9 ].sittag = "tag_detach";
|
||||
|
||||
// positions[ 0 ].getout = %bh_Pilot_idle;
|
||||
// positions[ 1 ].getout = %bh_coPilot_idle;
|
||||
|
||||
/*
|
||||
positions[ 2 ].getout = %bh_1_begining;
|
||||
positions[ 3 ].getout = %bh_2_begining;
|
||||
positions[ 4 ].getout = %bh_3_begining;
|
||||
positions[ 5 ].getout = %bh_4_begining;
|
||||
positions[ 6 ].getout = %bh_5_begining;
|
||||
positions[ 7 ].getout = %bh_6_begining;
|
||||
positions[ 8 ].getout = %bh_7_begining;
|
||||
positions[ 9 ].getout = %bh_2_begining;
|
||||
*/
|
||||
|
||||
// 1, 2, 4, 5, 8, 6
|
||||
positions[ 2 ].getout = %bh_1_drop;
|
||||
positions[ 3 ].getout = %bh_2_drop;
|
||||
positions[ 4 ].getout = %bh_4_drop;
|
||||
positions[ 5 ].getout = %bh_5_drop;
|
||||
positions[ 6 ].getout = %bh_8_drop;
|
||||
positions[ 7 ].getout = %bh_6_drop;
|
||||
positions[ 8 ].getout = %bh_7_drop;
|
||||
// positions[ 9 ].getout = %bh_7_drop;
|
||||
|
||||
positions[ 2 ].getoutstance = "crouch";
|
||||
positions[ 3 ].getoutstance = "crouch";
|
||||
positions[ 4 ].getoutstance = "crouch";
|
||||
positions[ 5 ].getoutstance = "crouch";
|
||||
positions[ 6 ].getoutstance = "crouch";
|
||||
positions[ 7 ].getoutstance = "crouch";
|
||||
positions[ 8 ].getoutstance = "crouch";
|
||||
|
||||
|
||||
positions[ 2 ].ragdoll_getout_death = true;
|
||||
positions[ 3 ].ragdoll_getout_death = true;
|
||||
positions[ 4 ].ragdoll_getout_death = true;
|
||||
positions[ 5 ].ragdoll_getout_death = true;
|
||||
positions[ 6 ].ragdoll_getout_death = true;
|
||||
positions[ 7 ].ragdoll_getout_death = true;
|
||||
positions[ 8 ].ragdoll_getout_death = true;
|
||||
|
||||
positions[ 2 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 3 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 4 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 5 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 6 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 7 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
positions[ 8 ].ragdoll_fall_anim = %fastrope_fall;
|
||||
|
||||
positions[ 1 ].rappel_kill_achievement = 1;
|
||||
positions[ 2 ].rappel_kill_achievement = 1;
|
||||
positions[ 3 ].rappel_kill_achievement = 1;
|
||||
positions[ 4 ].rappel_kill_achievement = 1;
|
||||
positions[ 5 ].rappel_kill_achievement = 1;
|
||||
positions[ 6 ].rappel_kill_achievement = 1;
|
||||
positions[ 7 ].rappel_kill_achievement = 1;
|
||||
positions[ 8 ].rappel_kill_achievement = 1;
|
||||
|
||||
// positions[ 2 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 3 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 4 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 5 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 6 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 7 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 8 ].getoutsnd = "fastrope_loop_npc";
|
||||
// positions[ 9 ].getoutsnd = "fastrope_loop_npc";
|
||||
|
||||
|
||||
// positions[ 0 ].getoutloop = %bh_Pilot_idle;
|
||||
// positions[ 1 ].getoutloop = %bh_coPilot_idle;
|
||||
|
||||
/*
|
||||
positions[ 2 ].getoutloop = %bh_fastrope_loop;
|
||||
positions[ 3 ].getoutloop = %bh_fastrope_loop;
|
||||
positions[ 4 ].getoutloop = %bh_fastrope_loop;
|
||||
positions[ 5 ].getoutloop = %bh_fastrope_loop;
|
||||
positions[ 6 ].getoutloop = %bh_fastrope_loop;
|
||||
positions[ 7 ].getoutloop = %bh_fastrope_loop;
|
||||
positions[ 8 ].getoutloop = %bh_fastrope_loop;
|
||||
positions[ 9 ].getoutloop = %bh_fastrope_loop;
|
||||
*/
|
||||
positions[ 2 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 3 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 4 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 5 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 6 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 7 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
positions[ 8 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
// positions[ 9 ].getoutloopsnd = "fastrope_loop_npc";
|
||||
|
||||
// positions[ 0 ].getoutland = %bh_Pilot_idle;
|
||||
// positions[ 1 ].getoutland = %bh_coPilot_idle;
|
||||
/*
|
||||
positions[ 2 ].getoutland = %bh_fastrope_land;
|
||||
positions[ 3 ].getoutland = %bh_fastrope_land;
|
||||
positions[ 4 ].getoutland = %bh_fastrope_land;
|
||||
positions[ 5 ].getoutland = %bh_fastrope_land;
|
||||
positions[ 6 ].getoutland = %bh_fastrope_land;
|
||||
positions[ 7 ].getoutland = %bh_fastrope_land;
|
||||
positions[ 8 ].getoutland = %bh_fastrope_land;
|
||||
positions[ 9 ].getoutland = %bh_fastrope_land;
|
||||
*/
|
||||
|
||||
// positions[ 0 ].fastroperig = "TAG_FastRope_LE";
|
||||
// positions[ 1 ].fastroperig = "TAG_FastRope_LE";
|
||||
|
||||
// 1, 2, 4, 5, 6, & 8
|
||||
|
||||
|
||||
positions[ 2 ].fastroperig = "TAG_FastRope_RI";// 1
|
||||
positions[ 3 ].fastroperig = "TAG_FastRope_RI"; // 2
|
||||
positions[ 4 ].fastroperig = "TAG_FastRope_LE"; // 4
|
||||
positions[ 5 ].fastroperig = "TAG_FastRope_LE"; // 5
|
||||
positions[ 6 ].fastroperig = "TAG_FastRope_RI";// 8
|
||||
positions[ 7 ].fastroperig = "TAG_FastRope_LE";// 6
|
||||
positions[ 8 ].fastroperig = "TAG_FastRope_RI";// 7
|
||||
// positions[ 9 ].fastroperig = "TAG_FastRope_RI";
|
||||
return setplayer_anims( positions );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//WIP.. posible to unload different sets of people wirh vehicle notify( "unload", set ); sets defined here.
|
||||
unload_groups()
|
||||
{
|
||||
unload_groups = [];
|
||||
unload_groups[ "left" ] = [];
|
||||
unload_groups[ "right" ] = [];
|
||||
unload_groups[ "both" ] = [];
|
||||
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 4;
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 5;
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 7;
|
||||
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 2;
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 3;
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 6;
|
||||
unload_groups[ "right" ][ unload_groups[ "right" ].size ] = 8;
|
||||
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 2;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 3;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 4;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 5;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 6;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 7;
|
||||
unload_groups[ "both" ][ unload_groups[ "both" ].size ] = 8;
|
||||
|
||||
unload_groups[ "default" ] = unload_groups[ "both" ];
|
||||
|
||||
return unload_groups;
|
||||
|
||||
}
|
||||
|
||||
|
||||
set_attached_models()
|
||||
{
|
||||
array = [];
|
||||
array[ "TAG_FastRope_LE" ] = spawnstruct();
|
||||
array[ "TAG_FastRope_LE" ].model = "rope_test";
|
||||
array[ "TAG_FastRope_LE" ].tag = "TAG_FastRope_LE";
|
||||
array[ "TAG_FastRope_LE" ].idleanim = %bh_rope_idle_le;
|
||||
array[ "TAG_FastRope_LE" ].dropanim = %bh_rope_drop_le;
|
||||
|
||||
array[ "TAG_FastRope_RI" ] = spawnstruct();
|
||||
array[ "TAG_FastRope_RI" ].model = "rope_test_ri";
|
||||
array[ "TAG_FastRope_RI" ].tag = "TAG_FastRope_RI";
|
||||
array[ "TAG_FastRope_RI" ].idleanim = %bh_rope_idle_ri;
|
||||
array[ "TAG_FastRope_RI" ].dropanim = %bh_rope_drop_ri;
|
||||
|
||||
strings = getarraykeys( array );
|
||||
|
||||
for ( i = 0;i < strings.size;i++ )
|
||||
{
|
||||
precachemodel( array[ strings[ i ] ].model );
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_mi24p_hind_desert (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_hind::main( "vehicle_mi24p_hind_desert" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_mi24p_hind_desert_hind
|
||||
sound,vehicle_hind,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_mi24p_hind_desert"
|
||||
default:"vehicletype" "hind"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hind_desert (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_hind::main( "vehicle_mi24p_hind_desert" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_mi24p_hind_desert_hind
|
||||
sound,vehicle_hind,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_mi24p_hind_desert"
|
||||
default:"vehicletype" "hind"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hind_chernobyl (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_hind::main( "vehicle_mi24p_hind_chernobyl" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_mi24p_hind_chernobyl
|
||||
sound,vehicle_hind,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_mi24p_hind_chernobyl"
|
||||
default:"vehicletype" "hind"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_mi24p_hind_woodland (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_hind::main( "vehicle_mi24p_hind_woodland" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_mi24p_hind_woodland_hind
|
||||
sound,vehicle_hind,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_mi24p_hind_woodland"
|
||||
default:"vehicletype" "hind"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hind_woodland (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_hind::main( "vehicle_mi24p_hind_woodland" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_mi24p_hind_woodland_hind
|
||||
sound,vehicle_hind,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_mi24p_hind_woodland"
|
||||
default:"vehicletype" "hind"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_mi24p_hind_woodland_opened_door (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_hind::main( "vehicle_mi24p_hind_woodland_opened_door" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_mi24p_hind_woodland_opened_door_hind
|
||||
sound,vehicle_hind,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_mi24p_hind_woodland_opened_door"
|
||||
default:"vehicletype" "hind"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
static const char *g_he_font[] =
|
||||
{
|
||||
"default", // HE_FONT_DEFAULT
|
||||
"bigfixed", // HE_FONT_BIGFIXED
|
||||
"smallfixed", // HE_FONT_SMALLFIXED
|
||||
"objective", // HE_FONT_OBJECTIVE
|
||||
};
|
||||
|
||||
|
||||
// These values correspond to the defines in q_shared.h
|
||||
static const char *g_he_alignx[] =
|
||||
{
|
||||
"left", // HE_ALIGN_LEFT
|
||||
"center", // HE_ALIGN_CENTER
|
||||
"right", // HE_ALIGN_RIGHT
|
||||
};
|
||||
|
||||
|
||||
static const char *g_he_aligny[] =
|
||||
{
|
||||
"top", // HE_ALIGN_TOP
|
||||
"middle", // HE_ALIGN_MIDDLE
|
||||
"bottom", // HE_ALIGN_BOTTOM
|
||||
};
|
||||
|
||||
|
||||
// These values correspond to the defines in menudefinition.h
|
||||
static const char *g_he_horzalign[] =
|
||||
{
|
||||
"subleft", // HORIZONTAL_ALIGN_SUBLEFT
|
||||
"left", // HORIZONTAL_ALIGN_LEFT
|
||||
"center", // HORIZONTAL_ALIGN_CENTER
|
||||
"right", // HORIZONTAL_ALIGN_RIGHT
|
||||
"fullscreen", // HORIZONTAL_ALIGN_FULLSCREEN
|
||||
"noscale", // HORIZONTAL_ALIGN_NOSCALE
|
||||
"alignto640", // HORIZONTAL_ALIGN_TO640
|
||||
"center_safearea", // HORIZONTAL_ALIGN_CENTER_SAFEAREA
|
||||
};
|
||||
cassert( ARRAY_COUNT( g_he_horzalign ) == HORIZONTAL_ALIGN_MAX + 1 );
|
||||
|
||||
|
||||
static const char *g_he_vertalign[] =
|
||||
{
|
||||
"subtop", // VERTICAL_ALIGN_SUBTOP
|
||||
"top", // VERTICAL_ALIGN_TOP
|
||||
"middle", // VERTICAL_ALIGN_CENTER
|
||||
"bottom", // VERTICAL_ALIGN_BOTTOM
|
||||
"fullscreen", // VERTICAL_ALIGN_FULLSCREEN
|
||||
"noscale", // VERTICAL_ALIGN_NOSCALE
|
||||
"alignto480", // VERTICAL_ALIGN_TO480
|
||||
"center_safearea", // VERTICAL_ALIGN_CENTER_SAFEAREA
|
||||
};
|
||||
cassert( ARRAY_COUNT( g_he_vertalign ) == VERTICAL_ALIGN_MAX + 1 );
|
||||
*/
|
||||
|
||||
init()
|
||||
{
|
||||
level.uiParent = spawnstruct();
|
||||
level.uiParent.horzAlign = "left";
|
||||
level.uiParent.vertAlign = "top";
|
||||
level.uiParent.alignX = "left";
|
||||
level.uiParent.alignY = "top";
|
||||
level.uiParent.x = 0;
|
||||
level.uiParent.y = 0;
|
||||
level.uiParent.width = 0;
|
||||
level.uiParent.height = 0;
|
||||
level.uiParent.children = [];
|
||||
|
||||
if ( level.console )
|
||||
level.fontHeight = 12;
|
||||
else
|
||||
level.fontHeight = 12;
|
||||
}
|
||||
@@ -0,0 +1,791 @@
|
||||
#include maps\_utility;
|
||||
#include animscripts\utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
setParent( element )
|
||||
{
|
||||
if ( isDefined( self.parent ) && self.parent == element )
|
||||
return;
|
||||
|
||||
if ( isDefined( self.parent ) )
|
||||
self.parent removeChild( self );
|
||||
|
||||
self.parent = element;
|
||||
self.parent addChild( self );
|
||||
|
||||
if ( isDefined( self.point ) )
|
||||
self setPoint( self.point, self.relativePoint, self.xOffset, self.yOffset );
|
||||
else
|
||||
self setPoint( "TOPLEFT" );
|
||||
}
|
||||
|
||||
getParent()
|
||||
{
|
||||
return self.parent;
|
||||
}
|
||||
|
||||
addChild( element )
|
||||
{
|
||||
element.index = self.children.size;
|
||||
self.children[ self.children.size ] = element;
|
||||
}
|
||||
|
||||
removeChild( element )
|
||||
{
|
||||
element.parent = undefined;
|
||||
|
||||
if ( self.children[ self.children.size - 1 ] != element )
|
||||
{
|
||||
self.children[ element.index ] = self.children[ self.children.size - 1 ];
|
||||
self.children[ element.index ].index = element.index;
|
||||
}
|
||||
self.children[ self.children.size - 1 ] = undefined;
|
||||
|
||||
element.index = undefined;
|
||||
}
|
||||
|
||||
|
||||
setPoint( point, relativePoint, xOffset, yOffset, moveTime )
|
||||
{
|
||||
if ( !isDefined( moveTime ) )
|
||||
moveTime = 0;
|
||||
|
||||
element = self getParent();
|
||||
|
||||
if ( moveTime )
|
||||
self moveOverTime( moveTime );
|
||||
|
||||
if ( !isDefined( xOffset ) )
|
||||
xOffset = 0;
|
||||
self.xOffset = xOffset;
|
||||
|
||||
if ( !isDefined( yOffset ) )
|
||||
yOffset = 0;
|
||||
self.yOffset = yOffset;
|
||||
|
||||
self.point = point;
|
||||
|
||||
self.alignX = "center";
|
||||
self.alignY = "middle";
|
||||
|
||||
if ( isSubStr( point, "TOP" ) )
|
||||
self.alignY = "top";
|
||||
if ( isSubStr( point, "BOTTOM" ) )
|
||||
self.alignY = "bottom";
|
||||
if ( isSubStr( point, "LEFT" ) )
|
||||
self.alignX = "left";
|
||||
if ( isSubStr( point, "RIGHT" ) )
|
||||
self.alignX = "right";
|
||||
|
||||
if ( !isDefined( relativePoint ) )
|
||||
relativePoint = point;
|
||||
|
||||
self.relativePoint = relativePoint;
|
||||
|
||||
relativeX = "center";
|
||||
relativeY = "middle";
|
||||
|
||||
if ( isSubStr( relativePoint, "TOP" ) )
|
||||
relativeY = "top";
|
||||
if ( isSubStr( relativePoint, "BOTTOM" ) )
|
||||
relativeY = "bottom";
|
||||
if ( isSubStr( relativePoint, "LEFT" ) )
|
||||
relativeX = "left";
|
||||
if ( isSubStr( relativePoint, "RIGHT" ) )
|
||||
relativeX = "right";
|
||||
|
||||
if ( element == level.uiParent )
|
||||
{
|
||||
self.horzAlign = relativeX;
|
||||
self.vertAlign = relativeY;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.horzAlign = element.horzAlign;
|
||||
self.vertAlign = element.vertAlign;
|
||||
}
|
||||
|
||||
|
||||
if ( relativeX == element.alignX )
|
||||
{
|
||||
offsetX = 0;
|
||||
xFactor = 0;
|
||||
}
|
||||
else if ( relativeX == "center" || element.alignX == "center" )
|
||||
{
|
||||
offsetX = int( element.width / 2 );
|
||||
if ( relativeX == "left" || element.alignX == "right" )
|
||||
xFactor = -1;
|
||||
else
|
||||
xFactor = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
offsetX = element.width;
|
||||
if ( relativeX == "left" )
|
||||
xFactor = -1;
|
||||
else
|
||||
xFactor = 1;
|
||||
}
|
||||
self.x = element.x + ( offsetX * xFactor );
|
||||
|
||||
if ( relativeY == element.alignY )
|
||||
{
|
||||
offsetY = 0;
|
||||
yFactor = 0;
|
||||
}
|
||||
else if ( relativeY == "middle" || element.alignY == "middle" )
|
||||
{
|
||||
offsetY = int( element.height / 2 );
|
||||
if ( relativeY == "top" || element.alignY == "bottom" )
|
||||
yFactor = -1;
|
||||
else
|
||||
yFactor = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
offsetY = element.height;
|
||||
if ( relativeY == "top" )
|
||||
yFactor = -1;
|
||||
else
|
||||
yFactor = 1;
|
||||
}
|
||||
self.y = element.y + ( offsetY * yFactor );
|
||||
|
||||
self.x += self.xOffset;
|
||||
self.y += self.yOffset;
|
||||
|
||||
switch( self.elemType )
|
||||
{
|
||||
case "bar":
|
||||
setPointBar( point, relativePoint, xOffset, yOffset );
|
||||
break;
|
||||
}
|
||||
|
||||
self updateChildren();
|
||||
}
|
||||
|
||||
|
||||
setPointBar( point, relativePoint, xOffset, yOffset )
|
||||
{
|
||||
self.bar.horzAlign = self.horzAlign;
|
||||
self.bar.vertAlign = self.vertAlign;
|
||||
|
||||
self.bar.alignX = "left";
|
||||
self.bar.alignY = self.alignY;
|
||||
self.bar.y = self.y;
|
||||
|
||||
if ( self.alignX == "left" )
|
||||
self.bar.x = self.x + self.padding;
|
||||
else if ( self.alignX == "right" )
|
||||
self.bar.x = self.x - ( self.width - self.padding );
|
||||
else
|
||||
self.bar.x = self.x - int( ( self.width - self.padding ) / 2 );
|
||||
|
||||
self updateBar( self.bar.frac );
|
||||
}
|
||||
|
||||
|
||||
updateBar( barFrac )
|
||||
{
|
||||
barWidth = int( ( self.width - ( self.padding * 2 ) ) * barFrac );
|
||||
|
||||
if ( !barWidth )
|
||||
barWidth = 1;
|
||||
|
||||
self.bar.frac = barFrac;
|
||||
self.bar setShader( self.bar.shader, barWidth, self.height - ( self.padding * 2 ) );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
///ScriptDocBegin
|
||||
"Name: createFontString( <font>, <fontScale> )"
|
||||
"Summary: Creates a hud element for font purposes"
|
||||
"Module: Hud"
|
||||
"MandatoryArg: <font>: Apparently this is always set to default."
|
||||
"MandatoryArg: <fontScale>: The scale you want."
|
||||
"Example: level.hintElem = createFontString( "default", 2.0 );"
|
||||
"SPMP: singleplayer"
|
||||
///ScriptDocEnd
|
||||
=============
|
||||
*/
|
||||
|
||||
createFontString( font, fontScale )
|
||||
{
|
||||
fontElem = newHudElem();
|
||||
fontElem.elemType = "font";
|
||||
fontElem.font = font;
|
||||
fontElem.fontscale = fontScale;
|
||||
fontElem.x = 0;
|
||||
fontElem.y = 0;
|
||||
fontElem.width = 0;
|
||||
fontElem.height = int( level.fontHeight * fontScale );
|
||||
fontElem.xOffset = 0;
|
||||
fontElem.yOffset = 0;
|
||||
fontElem.children = [];
|
||||
fontElem setParent( level.uiParent );
|
||||
|
||||
return fontElem;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
///ScriptDocBegin
|
||||
"Name: createClientFontString( <font>, <fontScale> )"
|
||||
"Summary: Creates a client hud element for font purposes"
|
||||
"Module: Hud"
|
||||
"MandatoryArg: <font>: Apparently this is always set to default."
|
||||
"MandatoryArg: <fontScale>: The scale you want."
|
||||
"Example: level.hintElem = level.player createClientFontString( "default", 2.0 );"
|
||||
"SPMP: singleplayer"
|
||||
///ScriptDocEnd
|
||||
=============
|
||||
*/
|
||||
|
||||
createClientFontString( font, fontScale )
|
||||
{
|
||||
assert( isplayer( self ) );
|
||||
|
||||
fontElem = newClientHudElem( self );
|
||||
fontElem.elemType = "font";
|
||||
fontElem.font = font;
|
||||
fontElem.fontscale = fontScale;
|
||||
fontElem.x = 0;
|
||||
fontElem.y = 0;
|
||||
fontElem.width = 0;
|
||||
fontElem.height = int( level.fontHeight * fontScale );
|
||||
fontElem.xOffset = 0;
|
||||
fontElem.yOffset = 0;
|
||||
fontElem.children = [];
|
||||
fontElem setParent( level.uiParent );
|
||||
|
||||
return fontElem;
|
||||
}
|
||||
|
||||
createClientTimer( font, fontScale )
|
||||
{
|
||||
assert( isplayer( self ) );
|
||||
|
||||
timerElem = newClientHudElem( self );
|
||||
timerElem.elemType = "timer";
|
||||
timerElem.font = font;
|
||||
timerElem.fontscale = fontScale;
|
||||
timerElem.x = 0;
|
||||
timerElem.y = 0;
|
||||
timerElem.width = 0;
|
||||
timerElem.height = int( level.fontHeight * fontScale );
|
||||
timerElem.xOffset = 0;
|
||||
timerElem.yOffset = 0;
|
||||
timerElem.children = [];
|
||||
timerElem setParent( level.uiParent );
|
||||
|
||||
return timerElem;
|
||||
}
|
||||
|
||||
|
||||
createServerFontString( font, fontScale )
|
||||
{
|
||||
fontElem = newHudElem();
|
||||
fontElem.elemType = "font";
|
||||
fontElem.font = font;
|
||||
fontElem.fontscale = fontScale;
|
||||
fontElem.x = 0;
|
||||
fontElem.y = 0;
|
||||
fontElem.width = 0;
|
||||
fontElem.height = int( level.fontHeight * fontScale );
|
||||
fontElem.xOffset = 0;
|
||||
fontElem.yOffset = 0;
|
||||
fontElem.children = [];
|
||||
fontElem setParent( level.uiParent );
|
||||
|
||||
return fontElem;
|
||||
}
|
||||
|
||||
createServerTimer( font, fontScale )
|
||||
{
|
||||
timerElem = newHudElem();
|
||||
timerElem.elemType = "timer";
|
||||
timerElem.font = font;
|
||||
timerElem.fontscale = fontScale;
|
||||
timerElem.x = 0;
|
||||
timerElem.y = 0;
|
||||
timerElem.width = 0;
|
||||
timerElem.height = int( level.fontHeight * fontScale );
|
||||
timerElem.xOffset = 0;
|
||||
timerElem.yOffset = 0;
|
||||
timerElem.children = [];
|
||||
timerElem setParent( level.uiParent );
|
||||
|
||||
return timerElem;
|
||||
}
|
||||
|
||||
createIcon( shader, width, height )
|
||||
{
|
||||
iconElem = newHudElem();
|
||||
return createIcon_Hudelem( iconElem, shader, width, height );
|
||||
}
|
||||
|
||||
createClientIcon( shader, width, height )
|
||||
{
|
||||
iconElem = newClientHudElem( self );
|
||||
return createIcon_Hudelem( iconElem, shader, width, height );
|
||||
}
|
||||
|
||||
createIcon_Hudelem( iconElem, shader, width, height )
|
||||
{
|
||||
iconElem.elemType = "icon";
|
||||
iconElem.x = 0;
|
||||
iconElem.y = 0;
|
||||
iconElem.width = width;
|
||||
iconElem.height = height;
|
||||
iconElem.xOffset = 0;
|
||||
iconElem.yOffset = 0;
|
||||
iconElem.children = [];
|
||||
iconElem setParent( level.uiParent );
|
||||
|
||||
if ( isDefined( shader ) )
|
||||
iconElem setShader( shader, width, height );
|
||||
|
||||
return iconElem;
|
||||
}
|
||||
|
||||
|
||||
createBar( shader, bgshader, width, height, flashFrac )
|
||||
{
|
||||
if ( !isdefined( shader ) )
|
||||
shader = "white";
|
||||
|
||||
if ( !isdefined( bgshader ) )
|
||||
bgshader = "black";
|
||||
|
||||
if ( !isdefined( width ) )
|
||||
width = 100;
|
||||
|
||||
if ( !isdefined( height ) )
|
||||
height = 9;
|
||||
|
||||
barElem = newHudElem();
|
||||
barElem.x = 0 + 2;
|
||||
barElem.y = 0 + 2;
|
||||
barElem.frac = 0.25;
|
||||
barElem.shader = shader;
|
||||
barElem.sort = -1;
|
||||
barElem setShader( shader, width - 2, height - 2 );
|
||||
if ( isDefined( flashFrac ) )
|
||||
{
|
||||
barElem.flashFrac = flashFrac;
|
||||
barElem thread flashThread();
|
||||
}
|
||||
|
||||
barElemBG = newHudElem();
|
||||
barElemBG.elemType = "bar";
|
||||
barElemBG.x = 0;
|
||||
barElemBG.y = 0;
|
||||
barElemBG.width = width;
|
||||
barElemBG.height = height;
|
||||
barElemBG.xOffset = 0;
|
||||
barElemBG.yOffset = 0;
|
||||
barElemBG.bar = barElem;
|
||||
barElemBG.children = [];
|
||||
barElemBG.padding = 2;
|
||||
barElemBG.sort = -2;
|
||||
barElemBG.alpha = 0.5;
|
||||
barElemBG setParent( level.uiParent );
|
||||
barElemBG setShader( bgshader, width, height );
|
||||
|
||||
return barElemBG;
|
||||
}
|
||||
|
||||
createClientProgressBar( player, offset )
|
||||
{
|
||||
if ( !isdefined( player ) )
|
||||
player = level.player;
|
||||
|
||||
if ( !isdefined( offset ) )
|
||||
offset = 90;
|
||||
|
||||
bar = player createClientBar( "white", "black", 100, 9 );
|
||||
bar setPoint( "CENTER", undefined, 0, offset );
|
||||
|
||||
return bar;
|
||||
}
|
||||
|
||||
createClientBar( shader, bgshader, width, height, flashFrac )
|
||||
{
|
||||
barElem = newClientHudElem( self );
|
||||
barElem.x = 0 + 2;
|
||||
barElem.y = 0 + 2;
|
||||
barElem.frac = 0.25;
|
||||
barElem.shader = shader;
|
||||
barElem.sort = -1;
|
||||
barElem setShader( shader, width - 2, height - 2 );
|
||||
if ( isDefined( flashFrac ) )
|
||||
{
|
||||
barElem.flashFrac = flashFrac;
|
||||
barElem thread flashThread();
|
||||
}
|
||||
|
||||
barElemBG = newClientHudElem( self );
|
||||
barElemBG.elemType = "bar";
|
||||
barElemBG.x = 0;
|
||||
barElemBG.y = 0;
|
||||
barElemBG.width = width;
|
||||
barElemBG.height = height;
|
||||
barElemBG.xOffset = 0;
|
||||
barElemBG.yOffset = 0;
|
||||
barElemBG.bar = barElem;
|
||||
barElemBG.children = [];
|
||||
barElemBG.padding = 2;
|
||||
barElemBG.sort = -2;
|
||||
barElemBG.alpha = 0.5;
|
||||
barElemBG setParent( level.uiParent );
|
||||
barElemBG setShader( bgshader, width, height );
|
||||
|
||||
return barElemBG;
|
||||
}
|
||||
|
||||
|
||||
setFlashFrac( flashFrac )
|
||||
{
|
||||
self.bar.flashFrac = flashFrac;
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
///ScriptDocBegin
|
||||
"Name: fade_over_time( <target_alpha> , <fade_time> )"
|
||||
"Summary: "
|
||||
"Module: Entity"
|
||||
"CallOn: An entity"
|
||||
"MandatoryArg: <param1>: "
|
||||
"OptionalArg: <param2>: "
|
||||
"Example: "
|
||||
"SPMP: singleplayer"
|
||||
///ScriptDocEnd
|
||||
=============
|
||||
*/
|
||||
fade_over_time( target_alpha, fade_time )
|
||||
{
|
||||
self fadeOverTime( fade_time );
|
||||
self.alpha = target_alpha;
|
||||
wait fade_time;
|
||||
}
|
||||
|
||||
flashThread()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
self.alpha = 1;
|
||||
while ( 1 )
|
||||
{
|
||||
if ( self.frac >= self.flashFrac )
|
||||
{
|
||||
self fadeOverTime( 0.3 );
|
||||
self.alpha = .2;
|
||||
wait( 0.35 );
|
||||
self fadeOverTime( 0.3 );
|
||||
self.alpha = 1;
|
||||
wait( 0.7 );
|
||||
}
|
||||
else
|
||||
{
|
||||
self.alpha = 1;
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
destroyElem()
|
||||
{
|
||||
tempChildren = [];
|
||||
|
||||
for ( index = 0; index < self.children.size; index++ )
|
||||
tempChildren[ index ] = self.children[ index ];
|
||||
|
||||
for ( index = 0; index < tempChildren.size; index++ )
|
||||
tempChildren[ index ] setParent( self getParent() );
|
||||
|
||||
if ( self.elemType == "bar" )
|
||||
self.bar destroy();
|
||||
|
||||
self destroy();
|
||||
}
|
||||
|
||||
setIconShader( shader )
|
||||
{
|
||||
self setShader( shader, self.width, self.height );
|
||||
}
|
||||
|
||||
setWidth( width )
|
||||
{
|
||||
self.width = width;
|
||||
}
|
||||
|
||||
|
||||
setHeight( height )
|
||||
{
|
||||
self.height = height;
|
||||
}
|
||||
|
||||
setSize( width, height )
|
||||
{
|
||||
self.width = width;
|
||||
self.height = height;
|
||||
}
|
||||
|
||||
updateChildren()
|
||||
{
|
||||
for ( index = 0; index < self.children.size; index++ )
|
||||
{
|
||||
child = self.children[ index ];
|
||||
child setPoint( child.point, child.relativePoint, child.xOffset, child.yOffset );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
thread stance_carry_icon_enable( bool );
|
||||
Diasables all stance icons and replaces with an icon of
|
||||
a person carrying another person on his back. True/false
|
||||
*/
|
||||
stance_carry_icon_enable( bool )
|
||||
{
|
||||
if ( isdefined( bool ) && bool == false )
|
||||
{
|
||||
stance_carry_icon_disable();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isDefined( level.stance_carry ) )
|
||||
level.stance_carry destroy();
|
||||
|
||||
SetSavedDvar( "hud_showStance", "0" );
|
||||
|
||||
level.stance_carry = newHudElem();
|
||||
level.stance_carry.x = 100;
|
||||
if ( level.console )
|
||||
level.stance_carry.y = 20;
|
||||
else
|
||||
level.stance_carry.y = 10;
|
||||
level.stance_carry setshader( "stance_carry", 64, 64 );
|
||||
level.stance_carry.alignX = "left";
|
||||
level.stance_carry.alignY = "bottom";
|
||||
level.stance_carry.horzAlign = "left";
|
||||
level.stance_carry.vertAlign = "bottom";
|
||||
level.stance_carry.foreground = true;
|
||||
level.stance_carry.alpha = 0;
|
||||
level.stance_carry fadeOverTime( 0.5 );
|
||||
level.stance_carry.alpha = 1;
|
||||
}
|
||||
|
||||
stance_carry_icon_disable()
|
||||
{
|
||||
if ( isDefined( level.stance_carry ) )
|
||||
{
|
||||
level.stance_carry fadeOverTime( 0.5 );
|
||||
level.stance_carry.alpha = 0;
|
||||
level.stance_carry destroy();
|
||||
}
|
||||
SetSavedDvar( "hud_showStance", "1" );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
///ScriptDocBegin
|
||||
"Name: create_mantle( <create_mantle> )"
|
||||
"Summary: "
|
||||
"Module: Entity"
|
||||
"CallOn: An entity"
|
||||
"MandatoryArg: <param1>: "
|
||||
"OptionalArg: <param2>: "
|
||||
"Example: "
|
||||
"SPMP: singleplayer"
|
||||
///ScriptDocEnd
|
||||
=============
|
||||
*/
|
||||
create_mantle()
|
||||
{
|
||||
if ( level.console )
|
||||
{
|
||||
text = createFontString( "default", 1.8 );
|
||||
text setPoint( "CENTER", undefined, -23, 115 );
|
||||
text settext( level.strings[ "mantle" ] );
|
||||
|
||||
icon = createIcon( "hint_mantle", 40, 40 );
|
||||
icon setPoint( "CENTER", undefined, 73, 0 );
|
||||
icon setparent( text );
|
||||
}
|
||||
else
|
||||
{
|
||||
text = createFontString( "default", 1.6 );
|
||||
text setPoint( "CENTER", undefined, 0, 115 );
|
||||
text settext( level.strings[ "mantle" ] );
|
||||
|
||||
icon = createIcon( "hint_mantle", 40, 40 );
|
||||
icon setPoint( "CENTER", undefined, 0, 30 );
|
||||
icon setparent( text );
|
||||
}
|
||||
|
||||
icon.alpha = 0;
|
||||
text.alpha = 0;
|
||||
|
||||
level.hud_mantle = [];
|
||||
level.hud_mantle[ "text" ] = text;
|
||||
level.hud_mantle[ "icon" ] = icon;
|
||||
}
|
||||
|
||||
get_countdown_hud( x, y, player, forceXPos )
|
||||
{
|
||||
if ( !isdefined( forceXPos ) )
|
||||
forceXPos = false;
|
||||
xPos = undefined;
|
||||
if ( !level.Console )
|
||||
xPos = -250; //override x-position if this is PC or the timer will get cut off
|
||||
else if ( !isdefined( x ) )
|
||||
xPos = -225;
|
||||
else
|
||||
xPos = x;
|
||||
|
||||
if ( forceXPos )
|
||||
xPos = x;
|
||||
|
||||
if ( !isdefined( y ) )
|
||||
yPos = 100;
|
||||
else
|
||||
yPos = y;
|
||||
|
||||
if ( isdefined( player ) )
|
||||
hudelem = newClientHudElem( player );
|
||||
else
|
||||
hudelem = newHudElem();
|
||||
|
||||
hudelem.alignX = "left";
|
||||
hudelem.alignY = "middle";
|
||||
hudelem.horzAlign = "right";
|
||||
hudelem.vertAlign = "top";
|
||||
hudelem.x = xPos;
|
||||
hudelem.y = yPos;
|
||||
hudelem.fontScale = 1.6;
|
||||
hudelem.color = ( 0.8, 1.0, 0.8 );
|
||||
hudelem.font = "objective";
|
||||
hudelem.glowColor = ( 0.3, 0.6, 0.3 );
|
||||
hudelem.glowAlpha = 1;
|
||||
hudelem.foreground = 1;
|
||||
hudelem.hidewheninmenu = true;
|
||||
hudelem.hidewhendead = true;
|
||||
return hudelem;
|
||||
}
|
||||
|
||||
get_download_state_hud( x, y, player, forceXPos )
|
||||
{
|
||||
if ( !isdefined( forceXPos ) )
|
||||
forceXPos = false;
|
||||
|
||||
xPos = undefined;
|
||||
if ( !level.Console )
|
||||
xPos = -250; //override x-position if this is PC or the timer will get cut off
|
||||
else if ( !isdefined( x ) )
|
||||
xPos = -170;
|
||||
else
|
||||
xPos = x;
|
||||
|
||||
if ( forceXPos )
|
||||
xPos = x;
|
||||
|
||||
if ( !isdefined( y ) )
|
||||
yPos = 100;
|
||||
else
|
||||
yPos = y;
|
||||
|
||||
if ( isdefined( player ) )
|
||||
hudelem = newClientHudElem( player );
|
||||
else
|
||||
hudelem = newHudElem();
|
||||
|
||||
hudelem.alignX = "right";
|
||||
hudelem.alignY = "middle";
|
||||
hudelem.horzAlign = "right";
|
||||
hudelem.vertAlign = "top";
|
||||
hudelem.x = xPos;
|
||||
hudelem.y = yPos;
|
||||
hudelem.fontScale = 1.6;
|
||||
hudelem.color = ( 0.8, 1.0, 0.8 );
|
||||
hudelem.font = "objective";
|
||||
hudelem.glowColor = ( 0.3, 0.6, 0.3 );
|
||||
hudelem.glowAlpha = 1;
|
||||
hudelem.foreground = 1;
|
||||
hudelem.hidewheninmenu = true;
|
||||
hudelem.hidewhendead = true;
|
||||
return hudelem;
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
///ScriptDocBegin
|
||||
"Name: create_client_overlay( <shader_name>, <start_alpha>, <player> )"
|
||||
"Summary: Creates a full screen client hud overlay. Must also use code command precacheShader( <shader_name> ) to precache the element used (black, white, etc)."
|
||||
"Module: Hud"
|
||||
"MandatoryArg: <shader_name>: Name of the shader precached that you want to have displayed."
|
||||
"MandatoryArg: <start_alpha>: Beginning alpha value for the element."
|
||||
"OptionalArg: <player>: Pointer to the player for which the overlay will be displayed. If left blank, overlay will be displayed for all players."
|
||||
"Example: black_overlay = create_client_overlay( "black", 0, level.player );"
|
||||
"SPMP: singleplayer"
|
||||
///ScriptDocEnd
|
||||
=============
|
||||
*/
|
||||
create_client_overlay( shader_name, start_alpha, player )
|
||||
{
|
||||
if ( isdefined( player ) )
|
||||
overlay = newClientHudElem( player );
|
||||
else
|
||||
overlay = newHudElem();
|
||||
overlay.x = 0;
|
||||
overlay.y = 0;
|
||||
overlay setshader( shader_name, 640, 480 );
|
||||
overlay.alignX = "left";
|
||||
overlay.alignY = "top";
|
||||
overlay.sort = 1;
|
||||
overlay.horzAlign = "fullscreen";
|
||||
overlay.vertAlign = "fullscreen";
|
||||
overlay.alpha = start_alpha;
|
||||
overlay.foreground = true;
|
||||
return overlay;
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
///ScriptDocBegin
|
||||
"Name: create_client_overlay_custom_size( <shader_name>, <start_alpha>, <x>, <y> )"
|
||||
"Summary: Creates a full screen client hud overlay. Must also use code command precacheShader( <shader_name> ) to precache the element used (black, white, etc)."
|
||||
"Module: Hud"
|
||||
"MandatoryArg: <shader_name>: Name of the shader precached that you want to have displayed."
|
||||
"MandatoryArg: <start_alpha>: Beginning alpha value for the element."
|
||||
"MandatoryArg: <x>: Width."
|
||||
"MandatoryArg: <y>: Height."
|
||||
"CallOn: A player"
|
||||
"Example: black_overlay = create_client_overlay_custom_size( "black", 0, 100, 50 );"
|
||||
"SPMP: singleplayer"
|
||||
///ScriptDocEnd
|
||||
=============
|
||||
*/
|
||||
create_client_overlay_custom_size( shader_name, start_alpha, x, y )
|
||||
{
|
||||
player = get_player_from_self();
|
||||
overlay = newClientHudElem( player );
|
||||
|
||||
overlay.x = 0;
|
||||
overlay.y = 0;
|
||||
overlay setshader( shader_name, x, y );
|
||||
overlay.alignX = "center";
|
||||
overlay.alignY = "middle";
|
||||
overlay.sort = 1;
|
||||
overlay.horzAlign = "center";
|
||||
overlay.vertAlign = "middle";
|
||||
overlay.alpha = start_alpha;
|
||||
overlay.foreground = true;
|
||||
return overlay;
|
||||
}
|
||||
@@ -0,0 +1,360 @@
|
||||
#include maps\_hud_util;
|
||||
|
||||
registerWeaponInfo( name, string, type, clip )
|
||||
{
|
||||
level.weaponInfo[ name ][ "type" ] = type;
|
||||
level.weaponInfo[ name ][ "clip" ] = clip;
|
||||
level.weaponInfo[ name ][ "string" ] = string;
|
||||
|
||||
precacheString( string );
|
||||
}
|
||||
|
||||
isWeaponRegistered( name )
|
||||
{
|
||||
if ( !isDefined( level.weaponInfo[ name ] ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
getWeaponInfoType( name )
|
||||
{
|
||||
return level.weaponInfo[ name ][ "type" ];
|
||||
}
|
||||
|
||||
getWeaponInfoClip( name )
|
||||
{
|
||||
return level.weaponInfo[ name ][ "clip" ];
|
||||
}
|
||||
|
||||
getWeaponInfoString( name )
|
||||
{
|
||||
return level.weaponInfo[ name ][ "string" ];
|
||||
}
|
||||
|
||||
init()
|
||||
{
|
||||
precacheShader( "hud_bullets_rifle" );
|
||||
precacheShader( "hud_bullets_pistol" );
|
||||
precacheShader( "hud_bullets_sniper" );
|
||||
precacheShader( "hud_bullets_spread" );
|
||||
precacheShader( "hud_bullets_support_front" );
|
||||
precacheShader( "hud_bullets_support_back" );
|
||||
|
||||
level.bulletAlphas = [];
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 1.000;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.996;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.949;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.909;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.870;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.835;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.803;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.776;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.749;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.721;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.698;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.674;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.654;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.635;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.615;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.596;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.580;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.564;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.549;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.537;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.521;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.509;
|
||||
level.bulletAlphas[ level.bulletAlphas.size ] = 0.498;
|
||||
|
||||
level.weaponInfo = [];
|
||||
//
|
||||
registerWeaponInfo( "ak47", &"WEAPON_AK47_FULLAUTO", "rifle", 30 );
|
||||
//
|
||||
registerWeaponInfo( "ak47_semi", &"WEAPON_AK47_SEMIAUTO", "rifle", 30 );
|
||||
// AK-47
|
||||
registerWeaponInfo( "ak47_grenadier", &"WEAPON_AK47", "rifle", 30 );
|
||||
//
|
||||
registerWeaponInfo( "ak74u", &"WEAPON_AK74U_FULLAUTO", "rifle", 30 );
|
||||
//
|
||||
registerWeaponInfo( "ak74u_semi", &"WEAPON_AK74U_SEMIAUTO", "rifle", 30 );
|
||||
// M9
|
||||
registerWeaponInfo( "beretta", &"WEAPON_BERETTA", "pistol", 15 );
|
||||
// G36C
|
||||
registerWeaponInfo( "g36c", &"WEAPON_G36C", "rifle", 30 );
|
||||
// M14
|
||||
registerWeaponInfo( "m14_scoped", &"WEAPON_M14", "sniper", 10 );
|
||||
//
|
||||
registerWeaponInfo( "m16_basic", &"WEAPON_M16A4_FULLAUTO", "rifle", 30 );
|
||||
//
|
||||
registerWeaponInfo( "m16_basic_semi", &"WEAPON_M16A4_SEMIAUTO", "rifle", 30 );
|
||||
// M16A4
|
||||
registerWeaponInfo( "m16_grenadier", &"WEAPON_M16", "rifle", 30 );
|
||||
// M203
|
||||
registerWeaponInfo( "m203", &"WEAPON_M203", "grenade", 1 );
|
||||
// RPG-7
|
||||
registerWeaponInfo( "rpg", &"WEAPON_RPG", "grenade", 5 );
|
||||
// M249 SAW
|
||||
registerWeaponInfo( "saw", &"WEAPON_SAW", "support", 100 );
|
||||
//
|
||||
registerWeaponInfo( "m4_grunt", &"WEAPON_M4_FULLAUTO", "rifle", 30 );
|
||||
//
|
||||
registerWeaponInfo( "m4_grunt_semi", &"WEAPON_M4_SEMIAUTO", "rifle", 30 );
|
||||
// M4A1
|
||||
registerWeaponInfo( "m4_grenadier", &"WEAPON_M4", "rifle", 30 );
|
||||
// M40A3
|
||||
registerWeaponInfo( "m40a3", &"WEAPON_M40A3", "sniper", 10 );
|
||||
// MP5
|
||||
registerWeaponInfo( "mp5", &"WEAPON_MP5", "smg", 30 );
|
||||
//
|
||||
registerWeaponInfo( "mp5_silencer", &"WEAPON_MP5SD", "smg", 30 );
|
||||
// USP .45
|
||||
registerWeaponInfo( "usp", &"WEAPON_USP", "pistol", 10 );
|
||||
// AT4
|
||||
registerWeaponInfo( "at4", &"WEAPON_AT4", "rocketlauncher", 1 );
|
||||
// Dragunov
|
||||
registerWeaponInfo( "dragunov", &"WEAPON_DRAGUNOV", "sniper", 10 );
|
||||
// G3
|
||||
registerWeaponInfo( "g3", &"WEAPON_G3", "rifle", 30 );
|
||||
// W1200
|
||||
registerWeaponInfo( "winchester1200", &"WEAPON_WINCHESTER1200", "shotgun", 4 );
|
||||
// Mini-Uzi
|
||||
registerWeaponInfo( "uzi", &"WEAPON_UZI", "smg", 32 );
|
||||
|
||||
level.player initWeaponHUD();
|
||||
}
|
||||
|
||||
initWeaponHUD()
|
||||
{
|
||||
if ( !isDefined( self.hud_bullets ) )
|
||||
self.hud_bullets = [];
|
||||
|
||||
if ( !isDefined( self.hud_bullets[ 0 ] ) )
|
||||
{
|
||||
self.hud_bullets[ 0 ] = createIcon( undefined, 24, 96 );
|
||||
self.hud_bullets[ 0 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 0 ].sort = 10;
|
||||
}
|
||||
|
||||
if ( !isDefined( self.hud_bullets[ 1 ] ) )
|
||||
{
|
||||
self.hud_bullets[ 1 ] = createIcon( undefined, 24, 96 );
|
||||
self.hud_bullets[ 1 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 1 ].color = ( 0.7, 0.7, 0.7 );
|
||||
self.hud_bullets[ 1 ].sort = 9;
|
||||
}
|
||||
|
||||
if ( !isDefined( self.hud_bullets[ 2 ] ) )
|
||||
{
|
||||
self.hud_bullets[ 2 ] = createIcon( undefined, 24, 96 );
|
||||
self.hud_bullets[ 2 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 2 ].sort = 10;
|
||||
}
|
||||
|
||||
if ( !isDefined( self.hud_bullets[ 3 ] ) )
|
||||
{
|
||||
self.hud_bullets[ 3 ] = createIcon( undefined, 24, 96 );
|
||||
self.hud_bullets[ 3 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 3 ].color = ( 0.7, 0.7, 0.7 );
|
||||
self.hud_bullets[ 3 ].sort = 9;
|
||||
}
|
||||
|
||||
if ( !isDefined( self.hud_bullets[ 4 ] ) )
|
||||
{
|
||||
self.hud_bullets[ 4 ] = createIcon( undefined, 24, 96 );
|
||||
self.hud_bullets[ 4 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 4 ].sort = 10;
|
||||
}
|
||||
/*
|
||||
if ( !isDefined( self.hud_totalammo ) )
|
||||
{
|
||||
self.hud_totalammo = createFontString( "default", 1.5 );
|
||||
self.hud_totalammo setParent( self.hud_bullets[0] );
|
||||
self.hud_totalammo setPoint( "TOPRIGHT", "BOTTOMRIGHT", 0, 5 );
|
||||
}
|
||||
|
||||
if ( !isDefined( self.hud_weaponname ) )
|
||||
{
|
||||
self.hud_weaponname = createFontString( "default", 1.5 );
|
||||
self.hud_weaponname setParent( self.hud_totalammo );
|
||||
self.hud_weaponname setPoint( "RIGHT", "LEFT", -40, 0 );
|
||||
}
|
||||
*/
|
||||
self thread updateBulletHudThink();
|
||||
}
|
||||
|
||||
|
||||
updateBulletHudThink()
|
||||
{
|
||||
self endon( "death" );
|
||||
lastAmmoCount = -1;
|
||||
lastWeapon = "";
|
||||
lastWeaponType = "";
|
||||
|
||||
while ( true )
|
||||
{
|
||||
weapon = self getCurrentWeapon();
|
||||
if ( isWeaponRegistered( weapon ) )
|
||||
{
|
||||
weaponType = self getWeaponInfoType( weapon );
|
||||
ammoCount = self GetWeaponAmmoClip( self GetCurrentWeapon() );
|
||||
|
||||
if ( ( weapon != lastWeapon ) && ( weaponType != lastWeaponType ) )
|
||||
{
|
||||
self setHudWeaponType( weaponType );
|
||||
lastWeapon = weapon;
|
||||
lastWeaponType = weaponType;
|
||||
lastAmmoCount = -1;
|
||||
}
|
||||
|
||||
if ( ammoCount != lastAmmoCount )
|
||||
{
|
||||
self updateHudWeaponAmmo( weapon, ammoCount );
|
||||
lastAmmoCount = ammoCount;
|
||||
}
|
||||
/*
|
||||
self.hud_totalammo setValue( self GetWeaponAmmoStock( self GetCurrentWeapon() ) );
|
||||
if ( self getFractionMaxAmmo( weapon ) < 0.25 )
|
||||
self.hud_totalammo.color = (1,0,0);
|
||||
else
|
||||
self.hud_totalammo.color = (1,1,1);
|
||||
|
||||
self.hud_weaponname setText( getWeaponInfoString( weapon ) );
|
||||
*/
|
||||
}
|
||||
|
||||
wait( 0.05 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setHudWeaponType( type )
|
||||
{
|
||||
self.pers[ "weaponType" ] = type;
|
||||
|
||||
if ( !isDefined( self.hud_bullets ) )
|
||||
return;
|
||||
|
||||
for ( index = 0; index < self.hud_bullets.size; index++ )
|
||||
self.hud_bullets[ index ].alpha = 0;
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case "pistol":
|
||||
self.hud_bullets[ 0 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 0 ] setIconShader( "hud_bullets_pistol" );
|
||||
self.hud_bullets[ 0 ].alpha = 1;
|
||||
break;
|
||||
case "smg":
|
||||
self.hud_bullets[ 0 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 0 ] setIconShader( "hud_bullets_rifle" );
|
||||
self.hud_bullets[ 1 ] setIconShader( "hud_bullets_rifle" );
|
||||
self.hud_bullets[ 1 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -4, -50 );
|
||||
self.hud_bullets[ 0 ].alpha = 1;
|
||||
self.hud_bullets[ 1 ].alpha = 1;
|
||||
break;
|
||||
case "rifle":
|
||||
self.hud_bullets[ 0 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 0 ] setIconShader( "hud_bullets_rifle" );
|
||||
self.hud_bullets[ 1 ] setIconShader( "hud_bullets_rifle" );
|
||||
self.hud_bullets[ 1 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -4, -50 );
|
||||
self.hud_bullets[ 0 ].alpha = 1;
|
||||
self.hud_bullets[ 1 ].alpha = 1;
|
||||
break;
|
||||
case "sniper":
|
||||
self.hud_bullets[ 0 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 0 ] setIconShader( "hud_bullets_sniper" );
|
||||
self.hud_bullets[ 0 ].alpha = 1;
|
||||
break;
|
||||
case "spread":
|
||||
self.hud_bullets[ 0 ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6, -47 );
|
||||
self.hud_bullets[ 0 ] setIconShader( "hud_bullets_spread" );
|
||||
self.hud_bullets[ 0 ].alpha = 1;
|
||||
break;
|
||||
case "support":
|
||||
xOffset = 0;
|
||||
for ( index = 0; index < 5; index++ )
|
||||
{
|
||||
self.hud_bullets[ index ] setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -6 + xOffset, -70 );
|
||||
self.hud_bullets[ index ].alpha = 1;
|
||||
|
||||
if ( index % 2 )
|
||||
self.hud_bullets[ index ] setIconShader( "hud_bullets_support_back" );
|
||||
else
|
||||
self.hud_bullets[ index ] setIconShader( "hud_bullets_support_front" );
|
||||
|
||||
xOffset -= 14;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
getHudWeaponType()
|
||||
{
|
||||
return( self.pers[ "weaponType" ] );
|
||||
}
|
||||
|
||||
updateHudWeaponAmmo( weapon, ammoCount )
|
||||
{
|
||||
if ( !isDefined( self.hud_bullets ) )
|
||||
return;
|
||||
|
||||
switch( self getHudWeaponType() )
|
||||
{
|
||||
case "pistol":
|
||||
baseDiff = 15 - getWeaponInfoClip( weapon );
|
||||
diff = getWeaponInfoClip( weapon ) - ammoCount;
|
||||
|
||||
self.hud_bullets[ 0 ].alpha = level.bulletAlphas[ baseDiff + diff ];
|
||||
break;
|
||||
case "rifle":
|
||||
diff = getWeaponInfoClip( weapon ) - ammoCount;
|
||||
|
||||
col1Diff = int( diff / 2 );
|
||||
col1Diff += ( diff %2 );
|
||||
col2Diff = int( diff / 2 );
|
||||
|
||||
self.hud_bullets[ 0 ].alpha = level.bulletAlphas[ col1Diff ];
|
||||
self.hud_bullets[ 1 ].alpha = level.bulletAlphas[ col2Diff ];
|
||||
break;
|
||||
case "smg":
|
||||
diff = getWeaponInfoClip( weapon ) - ammoCount;
|
||||
|
||||
col1Diff = int( diff / 2 );
|
||||
col1Diff += ( diff %2 );
|
||||
col2Diff = int( diff / 2 );
|
||||
|
||||
self.hud_bullets[ 0 ].alpha = level.bulletAlphas[ col1Diff ];
|
||||
self.hud_bullets[ 1 ].alpha = level.bulletAlphas[ col2Diff ];
|
||||
break;
|
||||
case "sniper":
|
||||
baseDiff = 15 - getWeaponInfoClip( weapon );
|
||||
diff = getWeaponInfoClip( weapon ) - ammoCount;
|
||||
|
||||
self.hud_bullets[ 0 ].alpha = level.bulletAlphas[ baseDiff + diff ];
|
||||
break;
|
||||
case "spread":
|
||||
baseDiff = 15 - getWeaponInfoClip( weapon );
|
||||
diff = getWeaponInfoClip( weapon ) - ammoCount;
|
||||
|
||||
self.hud_bullets[ 0 ].alpha = level.bulletAlphas[ baseDiff + diff ];
|
||||
break;
|
||||
case "support":
|
||||
baseDiff = 100 - getWeaponInfoClip( weapon );
|
||||
diff = getWeaponInfoClip( weapon ) - ammoCount;
|
||||
diff = baseDiff + diff;
|
||||
|
||||
bulletOffset = 20;
|
||||
for ( index = 4; index >= 0; index -- )
|
||||
{
|
||||
if ( diff > bulletOffset )
|
||||
self.hud_bullets[ index ].alpha = 0;
|
||||
else if ( ( bulletOffset - diff ) <= 20 )
|
||||
self.hud_bullets[ index ].alpha = level.bulletAlphas[ diff - ( bulletOffset - 20 ) ];
|
||||
else
|
||||
self.hud_bullets[ index ].alpha = 1;
|
||||
|
||||
bulletOffset += 20;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
|
||||
main( model, type, turret_type )
|
||||
{
|
||||
if ( !IsDefined( type ) )
|
||||
{
|
||||
type = "hummer_minigun";
|
||||
}
|
||||
|
||||
build_template( "hummer_minigun", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_hummer", "vehicle_hummer_destroyed" );
|
||||
|
||||
build_deathfx( "fire/firelp_med_pm", "TAG_CAB_FIRE", "fire_metal_medium", undefined, undefined, true, 0 );
|
||||
build_deathfx( "explosions/vehicle_explosion_hummer_minigun", "tag_deathfx", "car_explode", undefined, undefined, undefined, 0 );
|
||||
|
||||
|
||||
build_drive( %humvee_50cal_driving_idle_forward, %humvee_50cal_driving_idle_backward, 10 );
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
build_aianims( ::setanims, ::set_vehicle_anims );
|
||||
build_unload_groups( ::Unload_Groups );
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
// build_turret( "minigun_hummer", "tag_turret", "weapon_suburban_minigun_no_doors", undefined, undefined, 0.2 );
|
||||
|
||||
if ( !isdefined( turret_type ) )
|
||||
turret_type = "minigun_hummer";
|
||||
build_turret( turret_type, "tag_turret", "weapon_suburban_minigun_no_doors", undefined, undefined, 0.2, 20, -14 );
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
init_local()
|
||||
{
|
||||
if ( issubstr( self.vehicletype, "physics" ) )
|
||||
{
|
||||
anims = [];
|
||||
anims[ "idle" ] = %humvee_antennas_idle_movement;
|
||||
anims[ "rot_l" ] = %humvee_antenna_L_rotate_360;
|
||||
anims[ "rot_r" ] = %humvee_antenna_R_rotate_360;
|
||||
thread humvee_antenna_animates( anims );
|
||||
|
||||
//thread maps\_debug::drawTagForever( "tag_antenna" );
|
||||
//thread maps\_debug::drawTagForever( "tag_antenna2" );
|
||||
}
|
||||
|
||||
self hidepart( "tag_blood" );
|
||||
}
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0; i < 5; i++ )
|
||||
{
|
||||
positions[ i ] = spawnstruct();
|
||||
}
|
||||
|
||||
positions[ 0 ].sittag = "tag_driver";
|
||||
positions[ 1 ].sittag = "tag_passenger";
|
||||
positions[ 2 ].sittag = "tag_guy0";
|
||||
positions[ 3 ].sittag = "tag_guy1";
|
||||
positions[ 4 ].sittag = "tag_passenger";
|
||||
|
||||
positions[ 0 ].bHasGunWhileRiding = false;
|
||||
|
||||
positions[ 0 ].idle = %humvee_idle_frontL;
|
||||
positions[ 1 ].idle = %humvee_idle_frontR;
|
||||
positions[ 2 ].idle = %humvee_idle_backL;
|
||||
positions[ 3 ].idle = %humvee_idle_backR;
|
||||
|
||||
positions[ 0 ].getout = %humvee_driver_climb_out;
|
||||
positions[ 1 ].getout = %humvee_passenger_out_R;
|
||||
positions[ 2 ].getout = %humvee_passenger_out_L;
|
||||
positions[ 3 ].getout = %humvee_passenger_out_R;
|
||||
|
||||
// turret gunner
|
||||
positions[ 4 ].getout = %humvee_turret_2_passenger;
|
||||
positions[ 4 ].exittag = "tag_guy1";
|
||||
positions[ 4 ].getout_secondary = %humvee_passenger_out_R;
|
||||
positions[ 4 ].getout_secondary_tag = "tag_guy1";
|
||||
|
||||
positions[ 0 ].getin = %humvee_mount_frontL;
|
||||
positions[ 1 ].getin = %roadkill_hummer_mount_frontR;
|
||||
positions[ 2 ].getin = %humvee_mount_backL;
|
||||
positions[ 3 ].getin = %humvee_mount_backR;
|
||||
positions[ 4 ].getin = %humvee_mount_frontR;
|
||||
|
||||
|
||||
positions[ 4 ].mgturret = 0;// which of the turrets is this guy going to use
|
||||
|
||||
positions[ 4 ].passenger_2_turret_func = ::humvee_turret_guy_gettin_func;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
humvee_turret_guy_gettin_func( vehicle, guy, pos, turret )
|
||||
{
|
||||
animation = %humvee_passenger_2_turret;
|
||||
guy animscripts\hummer_turret\common::guy_goes_directly_to_turret( vehicle, pos, turret, animation );
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
positions[ 0 ].vehicle_getoutanim = %uaz_driver_exit_into_run_door;
|
||||
positions[ 1 ].vehicle_getoutanim = %uaz_rear_driver_exit_into_run_door;
|
||||
positions[ 2 ].vehicle_getoutanim = %uaz_passenger_exit_into_run_door;
|
||||
positions[ 3 ].vehicle_getoutanim = %uaz_passenger2_exit_into_run_door;
|
||||
|
||||
positions[ 0 ].vehicle_getinanim = %humvee_mount_frontL_door;
|
||||
positions[ 1 ].vehicle_getinanim = %roadkill_hummer_mount_frontR_door;
|
||||
positions[ 2 ].vehicle_getinanim = %humvee_mount_backL_door;
|
||||
positions[ 3 ].vehicle_getinanim = %humvee_mount_backR_door;
|
||||
positions[ 4 ].vehicle_getinanim = %humvee_mount_frontR_door;
|
||||
|
||||
positions[ 0 ].vehicle_getoutsound = "hummer_door_open";
|
||||
positions[ 1 ].vehicle_getoutsound = "hummer_door_open";
|
||||
positions[ 2 ].vehicle_getoutsound = "hummer_door_open";
|
||||
positions[ 3 ].vehicle_getoutsound = "hummer_door_open";
|
||||
positions[ 4 ].vehicle_getoutsound = "hummer_door_open";
|
||||
|
||||
positions[ 0 ].vehicle_getinsound = "hummer_door_close";
|
||||
positions[ 1 ].vehicle_getinsound = "hummer_door_close";
|
||||
positions[ 2 ].vehicle_getinsound = "hummer_door_close";
|
||||
positions[ 3 ].vehicle_getinsound = "hummer_door_close";
|
||||
positions[ 4 ].vehicle_getinsound = "hummer_door_close";
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
unload_groups()
|
||||
{
|
||||
unload_groups = [];
|
||||
|
||||
group = "passengers";
|
||||
unload_groups[ group ] = [];
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 1;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 3;
|
||||
|
||||
group = "passengers_and_gunner";
|
||||
unload_groups[ group ] = [];
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 1;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 3;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 4; // turret gunner
|
||||
|
||||
group = "all";
|
||||
unload_groups[ group ] = [];
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 0;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 1;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 3;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 4; // turret gunner
|
||||
|
||||
unload_groups[ "default" ] = unload_groups[ "all" ];
|
||||
|
||||
return unload_groups;
|
||||
}
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_hummer_minigun (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_hummer_minigun::main( "vehicle_hummer" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer_minigun
|
||||
sound,weapon_minigun,vehicle_standard,all_sp
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_hummer"
|
||||
default:"vehicletype" "hummer_minigun"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hummer_minigun_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_hummer_minigun::main( "vehicle_hummer", "hummer_minigun_physics" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer_minigun
|
||||
sound,weapon_minigun,vehicle_standard,all_sp
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_hummer"
|
||||
default:"vehicletype" "hummer_minigun_physics"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hummer_minigun_physics_player (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_hummer_minigun::main( "vehicle_hummer", "hummer_minigun_physics_player", "minigun_hummer_player" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer_minigun
|
||||
sound,weapon_minigun,vehicle_standard,all_sp
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_hummer"
|
||||
default:"vehicletype" "hummer_minigun_physics_player"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,301 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
|
||||
main( model, type )
|
||||
{
|
||||
//SNDFILE=vehicle_hummer
|
||||
|
||||
build_template( "humvee", model, type );
|
||||
build_localinit( ::init_local );
|
||||
|
||||
build_deathmodel( "vehicle_hummer", "vehicle_hummer_destroyed" );
|
||||
build_deathmodel( "vehicle_hummer_no_doors", "vehicle_hummer_destroyed" );
|
||||
build_deathmodel( "vehicle_hummer_viewmodel", "vehicle_hummer_opentop_destroyed" );
|
||||
build_deathmodel( "vehicle_hummer_opentop", "vehicle_hummer_opentop_destroyed" );
|
||||
build_deathmodel( "vehicle_humvee_camo" ); //old humvee
|
||||
build_deathmodel( "vehicle_humvee_camo_50cal_doors" ); //old humvee
|
||||
build_deathmodel( "vehicle_humvee_camo_50cal_nodoors" ); //old humvee
|
||||
|
||||
hummer_death_fx = [];
|
||||
hummer_death_fx[ "vehicle_hummer" ] = "explosions/vehicle_explosion_hummer";
|
||||
hummer_death_fx[ "vehicle_hummer_no_doors" ] = "explosions/vehicle_explosion_hummer_nodoors";
|
||||
hummer_death_fx[ "vehicle_hummer_viewmodel" ] = "explosions/vehicle_explosion_hummer_nodoors";
|
||||
hummer_death_fx[ "vehicle_hummer_opentop" ] = "explosions/vehicle_explosion_hummer_nodoors";
|
||||
hummer_death_fx[ "vehicle_humvee_camo" ] = "explosions/vehicle_explosion_medium";
|
||||
hummer_death_fx[ "vehicle_humvee_camo_50cal_doors" ] = "explosions/vehicle_explosion_medium";
|
||||
hummer_death_fx[ "vehicle_humvee_camo_50cal_nodoors" ] = "explosions/vehicle_explosion_medium";
|
||||
|
||||
build_unload_groups( ::Unload_Groups );
|
||||
|
||||
build_deathfx( "fire/firelp_med_pm", "TAG_CAB_FIRE", "fire_metal_medium", undefined, undefined, true, 0 );
|
||||
build_deathfx( hummer_death_fx[ model ], "tag_deathfx", "car_explode" );
|
||||
|
||||
build_drive( %humvee_50cal_driving_idle_forward, %humvee_50cal_driving_idle_backward, 10 );
|
||||
build_treadfx();
|
||||
build_life( 999, 500, 1500 );
|
||||
build_team( "allies" );
|
||||
anim_func = ::setanims;
|
||||
if ( isdefined( type ) && issubstr( type, "open" ) )
|
||||
anim_func = ::opentop_anims;
|
||||
|
||||
build_aianims( anim_func, ::set_vehicle_anims );
|
||||
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
init_local()
|
||||
{
|
||||
if ( issubstr( self.vehicletype, "physics" ) )
|
||||
{
|
||||
anims = [];
|
||||
anims[ "idle" ] = %humvee_antennas_idle_movement;
|
||||
anims[ "rot_l" ] = %humvee_antenna_L_rotate_360;
|
||||
anims[ "rot_r" ] = %humvee_antenna_R_rotate_360;
|
||||
thread humvee_antenna_animates( anims );
|
||||
|
||||
//thread maps\_debug::drawTagForever( "tag_antenna" );
|
||||
//thread maps\_debug::drawTagForever( "tag_antenna2" );
|
||||
}
|
||||
|
||||
if ( !issubstr( self.model, "opentop" ) )
|
||||
self hidepart( "tag_blood" );
|
||||
}
|
||||
|
||||
|
||||
unload_groups()
|
||||
{
|
||||
unload_groups = [];
|
||||
|
||||
group = "passengers";
|
||||
unload_groups[ group ] = [];
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 1;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 3;
|
||||
|
||||
group = "rear_driver_side";
|
||||
unload_groups[ group ] = [];
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
|
||||
group = "all";
|
||||
unload_groups[ group ] = [];
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 0;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 1;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 2;
|
||||
unload_groups[ group ][ unload_groups[ group ].size ] = 3;
|
||||
|
||||
unload_groups[ "default" ] = unload_groups[ "all" ];
|
||||
|
||||
return unload_groups;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
positions[ 0 ].vehicle_getoutanim = %uaz_driver_exit_into_run_door;
|
||||
positions[ 1 ].vehicle_getoutanim = %uaz_rear_driver_exit_into_run_door;
|
||||
positions[ 2 ].vehicle_getoutanim = %uaz_passenger_exit_into_run_door;
|
||||
positions[ 3 ].vehicle_getoutanim = %uaz_passenger2_exit_into_run_door;
|
||||
|
||||
positions[ 0 ].vehicle_getinanim = %humvee_mount_frontL_door;
|
||||
positions[ 1 ].vehicle_getinanim = %humvee_mount_frontR_door;
|
||||
positions[ 2 ].vehicle_getinanim = %humvee_mount_backL_door;
|
||||
positions[ 3 ].vehicle_getinanim = %humvee_mount_backR_door;
|
||||
|
||||
positions[ 0 ].vehicle_getoutsound = "hummer_door_open";
|
||||
positions[ 1 ].vehicle_getoutsound = "hummer_door_open";
|
||||
positions[ 2 ].vehicle_getoutsound = "hummer_door_open";
|
||||
positions[ 3 ].vehicle_getoutsound = "hummer_door_open";
|
||||
|
||||
positions[ 0 ].vehicle_getinsound = "hummer_door_close";
|
||||
positions[ 1 ].vehicle_getinsound = "hummer_door_close";
|
||||
positions[ 2 ].vehicle_getinsound = "hummer_door_close";
|
||||
positions[ 3 ].vehicle_getinsound = "hummer_door_close";
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
|
||||
opentop_anims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 4;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "tag_driver";
|
||||
positions[ 1 ].sittag = "tag_passenger";
|
||||
positions[ 2 ].sittag = "tag_guy0";
|
||||
positions[ 3 ].sittag = "tag_guy1";
|
||||
|
||||
positions[ 0 ].bHasGunWhileRiding = false;
|
||||
|
||||
positions[ 0 ].idle = %humvee_idle_frontL;
|
||||
positions[ 1 ].idle = %humvee_idle_frontR;
|
||||
positions[ 2 ].idle = %humvee_idle_backL;
|
||||
positions[ 3 ].idle = %humvee_idle_backR;
|
||||
|
||||
positions[ 0 ].getout = %humvee_driver_climb_out;
|
||||
positions[ 1 ].getout = %humvee_passenger_out_R;
|
||||
positions[ 2 ].getout = %humvee_passenger_out_L;
|
||||
positions[ 3 ].getout = %humvee_passenger_out_R;
|
||||
|
||||
positions[ 0 ].getin = %humvee_mount_frontL_nodoor;
|
||||
positions[ 1 ].getin = %humvee_mount_frontR_nodoor;
|
||||
positions[ 2 ].getin = %humvee_mount_backL_nodoor;
|
||||
positions[ 3 ].getin = %humvee_mount_backR_nodoor;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
setanims()
|
||||
{
|
||||
positions = [];
|
||||
for ( i = 0;i < 4;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "tag_driver";
|
||||
positions[ 1 ].sittag = "tag_passenger";
|
||||
positions[ 2 ].sittag = "tag_guy0";
|
||||
positions[ 3 ].sittag = "tag_guy1";
|
||||
|
||||
positions[ 0 ].bHasGunWhileRiding = false;
|
||||
|
||||
positions[ 0 ].idle = %humvee_idle_frontL;
|
||||
positions[ 1 ].idle = %humvee_idle_frontR;
|
||||
positions[ 2 ].idle = %humvee_idle_backL;
|
||||
positions[ 3 ].idle = %humvee_idle_backR;
|
||||
|
||||
positions[ 0 ].getout = %humvee_driver_climb_out;
|
||||
positions[ 1 ].getout = %humvee_passenger_out_R;
|
||||
positions[ 2 ].getout = %humvee_passenger_out_L;
|
||||
positions[ 3 ].getout = %humvee_passenger_out_R;
|
||||
|
||||
positions[ 0 ].getin = %humvee_mount_frontL;
|
||||
positions[ 1 ].getin = %humvee_mount_frontR;
|
||||
positions[ 2 ].getin = %humvee_mount_backL;
|
||||
positions[ 3 ].getin = %humvee_mount_backR;
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_hummer (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_humvee::main( "vehicle_hummer" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_hummer"
|
||||
default:"vehicletype" "humvee"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hummer_nodoors (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_humvee::main( "vehicle_hummer_no_doors" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer_nodoors
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_hummer_no_doors"
|
||||
default:"vehicletype" "humvee"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hummer_opentop (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_humvee::main( "vehicle_hummer_opentop" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer_opentop
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_hummer_opentop"
|
||||
default:"vehicletype" "humvee"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hummer_viewmodel (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_humvee::main( "vehicle_hummer_viewmodel" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer_viewmodel
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_hummer_viewmodel"
|
||||
default:"vehicletype" "humvee"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_hummer_viewmodel_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_humvee::main( "vehicle_hummer_viewmodel", "hummer_physics" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer_viewmodel
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_hummer_viewmodel"
|
||||
default:"vehicletype" "hummer_physics"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hummer_opentop_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_humvee::main( "vehicle_hummer_opentop", "hummer_opentop_physics" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer_opentop
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_hummer_opentop"
|
||||
default:"vehicletype" "hummer_opentop_physics"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hummer_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
put this in your GSC:
|
||||
maps\_humvee::main( "vehicle_hummer", "hummer_physics" );
|
||||
|
||||
and these lines in your CSV:
|
||||
include,vehicle_hummer
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_hummer"
|
||||
default:"vehicletype" "hummer_physics"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
@@ -0,0 +1,32 @@
|
||||
#include maps\_vehicle_aianim;
|
||||
#include maps\_vehicle;
|
||||
main( model, type )
|
||||
{
|
||||
//SNDFILE=vehicle_hummer
|
||||
|
||||
if ( !isdefined( type ) )
|
||||
type = "humvee50cal";
|
||||
maps\_humvee::main( model, type );
|
||||
level.vehicle_aianims[ type ] = setanims( type );
|
||||
build_turret( "humvee_50cal_mg", "tag_turret", "vehicle_humvee_camo_50cal_mg", undefined, undefined, 2.9 );
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
setanims( type )
|
||||
{
|
||||
positions = level.vehicle_aianims[ type ];
|
||||
positions[ 4 ] = spawnstruct();
|
||||
|
||||
positions[ 4 ].sittag = "tag_guy_turret";
|
||||
// positions[ 4 ].idle = %humvee_turret_idle;
|
||||
|
||||
positions[ 4 ].getout = %humvee_driver_climb_out;
|
||||
positions[ 4 ].getin = %humvee_driver_climb_in;
|
||||
|
||||
// positions[ 4 ].turret_fire = %humvee_turret_fire;
|
||||
|
||||
positions[ 4 ].mgturret = 0;// which of the turrets is this guy going to use
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
+340
@@ -0,0 +1,340 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
#include maps\_stealth_utility;
|
||||
#include maps\_anim;
|
||||
#include maps\_props;
|
||||
|
||||
create_animation_list()
|
||||
{
|
||||
array = [];
|
||||
array[ array.size ] = "phone"; // 0
|
||||
array[ array.size ] = "smoke"; // 1
|
||||
array[ array.size ] = "lean_smoke"; // 2
|
||||
array[ array.size ] = "coffee"; // 3
|
||||
array[ array.size ] = "sleep"; // 4
|
||||
array[ array.size ] = "sit_load_ak"; // 5
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
idle_main()
|
||||
{
|
||||
level.global_callbacks[ "_idle_call_idle_func" ] = ::idle;
|
||||
}
|
||||
|
||||
idle()
|
||||
{
|
||||
//->since this system works with the stealth system - we want to make sure that _stealth has had a chance
|
||||
//to be initialized...if it's done through radient it will be, but if it's done through script with a
|
||||
//spawn_func, then it will initalize after this causing problems...this waittillframeend insures that the
|
||||
//spawn_func for stealth apps has a chance to run before this does.
|
||||
waittillframeend;
|
||||
|
||||
//the waittillframeend ( which is necessary ) is just enough time for this guy to be deleted from max 32 ai over-spawning.
|
||||
if( !isalive( self ) )
|
||||
return;
|
||||
|
||||
node = undefined;
|
||||
|
||||
if ( !isdefined( self.target ) )
|
||||
node = self;
|
||||
else
|
||||
{
|
||||
node = getnode( self.target, "targetname" );
|
||||
ent = getent( self.target, "targetname" );
|
||||
struct = getstruct( self.target, "targetname" );
|
||||
getfunc = undefined;
|
||||
|
||||
if ( isdefined( node ) )
|
||||
getfunc = ::get_node;
|
||||
else if ( isdefined( ent ) )
|
||||
getfunc = ::get_ent;
|
||||
else if ( isdefined( struct ) )
|
||||
getfunc = ::getstruct;
|
||||
|
||||
node = [[ getfunc ]]( self.target, "targetname" );
|
||||
|
||||
while ( isdefined( node.target ) )
|
||||
node = [[ getfunc ]]( node.target, "targetname" );
|
||||
}
|
||||
|
||||
anime = node.script_animation;
|
||||
if ( !isdefined( anime ) )
|
||||
anime = "random";
|
||||
|
||||
if ( !check_animation( anime, node ) )
|
||||
return;
|
||||
|
||||
if ( anime == "random" )
|
||||
{
|
||||
anime = create_random_animation();
|
||||
node.script_animation = anime;
|
||||
}
|
||||
idle_anim = anime + "_idle";
|
||||
react_anim = anime + "_react";
|
||||
|
||||
self thread idle_proc( node, idle_anim, react_anim );
|
||||
}
|
||||
|
||||
idle_reach_node( node, idle_anim )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "stop_idle_proc" );
|
||||
|
||||
if ( isdefined( self._stealth ) )
|
||||
{
|
||||
level add_wait( ::flag_wait, self stealth_get_group_spotted_flag() );
|
||||
if( isdefined( self._stealth.plugins.corpse ) )
|
||||
{
|
||||
level add_wait( ::flag_wait, self stealth_get_group_corpse_flag() );
|
||||
self add_wait( ::ent_flag_wait, "_stealth_saw_corpse" );
|
||||
}
|
||||
}
|
||||
else
|
||||
self add_wait( ::waittill_msg, "enemy" );
|
||||
|
||||
self add_func( ::send_notify, "stop_idle_proc" );
|
||||
self thread do_wait_any();
|
||||
|
||||
if ( isdefined( self.script_patroller ) )
|
||||
self waittill( "_patrol_reached_path_end" );
|
||||
else
|
||||
node anim_generic_reach( self, idle_anim );
|
||||
}
|
||||
|
||||
idle_proc( node, idle_anim, react_anim )
|
||||
{
|
||||
self.allowdeath = true;
|
||||
|
||||
self endon( "death" );
|
||||
|
||||
if ( isdefined( self.script_idlereach ) )
|
||||
{
|
||||
self endon( "stop_idle_proc" );
|
||||
self idle_reach_node( node, idle_anim );
|
||||
}
|
||||
|
||||
if ( isdefined( self.script_idlereach ) )
|
||||
{
|
||||
self.script_animation = node.script_animation;
|
||||
node = self;
|
||||
}
|
||||
|
||||
|
||||
if ( node.script_animation == "sit_load_ak" )
|
||||
{
|
||||
chair = spawn_anim_model( "chair_ak" );
|
||||
self.has_delta = true;
|
||||
self.anim_props = make_array( chair );
|
||||
node thread anim_first_frame_solo( chair, "sit_load_ak_react" );
|
||||
}
|
||||
|
||||
if( node.script_animation == "lean_smoke" )
|
||||
self thread attach_cig_self();
|
||||
|
||||
if ( node.script_animation == "sleep" )
|
||||
{
|
||||
chair = spawn_anim_model( "chair" );
|
||||
self.has_delta = true;
|
||||
self.anim_props = make_array( chair );
|
||||
node thread anim_first_frame_solo( chair, "sleep_react" );
|
||||
self thread reaction_sleep();
|
||||
}
|
||||
|
||||
node script_delay();
|
||||
|
||||
if ( isdefined( self._stealth ) )
|
||||
{
|
||||
node stealth_ai_idle_and_react( self, idle_anim, react_anim );
|
||||
return;
|
||||
}
|
||||
|
||||
ender = "stop_loop";
|
||||
node thread anim_generic_loop( self, idle_anim, ender );
|
||||
self thread animate_props_on_death( node, react_anim );
|
||||
self thread reaction_proc( node, ender, react_anim );
|
||||
}
|
||||
|
||||
reaction_sleep()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
self.ignoreall = true;
|
||||
|
||||
self reaction_sleep_wait_wakeup();
|
||||
|
||||
self.ignoreall = false;
|
||||
}
|
||||
|
||||
reaction_sleep_wait_wakeup()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
if ( isdefined( self._stealth ) )
|
||||
{
|
||||
self thread stealth_enemy_endon_alert();
|
||||
self endon( "stealth_enemy_endon_alert" );
|
||||
}
|
||||
|
||||
dist = 70;
|
||||
array_thread( level.players, ::reaction_sleep_wait_wakeup_dist, self, dist );
|
||||
|
||||
self waittill( "_idle_reaction" );
|
||||
}
|
||||
|
||||
reaction_sleep_wait_wakeup_dist( guy, dist )
|
||||
{
|
||||
guy endon( "death" );
|
||||
guy endon( "_idle_reaction" );
|
||||
self endon( "death" );
|
||||
guy endon( "enemy" );
|
||||
|
||||
distsqrd = dist * dist;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
while ( distancesquared( self.origin, guy.origin ) > distsqrd )
|
||||
wait .1;
|
||||
guy.ignoreall = false;
|
||||
|
||||
while ( distancesquared( self.origin, guy.origin ) <= distsqrd )
|
||||
wait .1;
|
||||
guy.ignoreall = true;
|
||||
}
|
||||
}
|
||||
|
||||
reaction_proc( node, ender, react_anim, tag )
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
self thread reaction_wait( "enemy" );
|
||||
self thread reaction_wait( "stop_idle_proc" );
|
||||
self thread reaction_wait( "react" );
|
||||
self thread reaction_wait( "doFlashBanged" );
|
||||
self thread reaction_wait( "explode" );
|
||||
|
||||
type = undefined;
|
||||
self waittill( "_idle_reaction", type );
|
||||
|
||||
// cut the loop
|
||||
node notify( ender );
|
||||
|
||||
if ( isdefined( self.anim_props ) )
|
||||
{
|
||||
self.anim_props_animated = true;
|
||||
node thread anim_single( self.anim_props, react_anim );
|
||||
}
|
||||
|
||||
if ( type == "stop_idle_proc" )
|
||||
{
|
||||
self anim_stopanimscripted();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( type != "doFlashBanged" )
|
||||
{
|
||||
// this is the reaction
|
||||
if ( isdefined( tag ) || isdefined( self.has_delta ) )
|
||||
node anim_generic( self, react_anim, tag );
|
||||
else
|
||||
node anim_generic_custom_animmode( self, "gravity", react_anim );
|
||||
}
|
||||
}
|
||||
|
||||
reaction_wait( msg )
|
||||
{
|
||||
self waittill( msg );
|
||||
self notify( "_idle_reaction", msg );
|
||||
}
|
||||
|
||||
animate_props_on_death( node, anime )
|
||||
{
|
||||
if ( !isdefined( self.anim_props ) )
|
||||
return;
|
||||
|
||||
prop = self.anim_props;
|
||||
|
||||
self waittill( "death" );
|
||||
|
||||
if ( isdefined( self.anim_props_animated ) )
|
||||
return;
|
||||
|
||||
node thread anim_single( prop, anime );
|
||||
}
|
||||
|
||||
create_random_animation()
|
||||
{
|
||||
array = create_animation_list();
|
||||
//never return sleep, lean smoke, coffee, or sit_load_ak as a random animation
|
||||
return array[ randomint( array.size - 4 ) ];
|
||||
}
|
||||
|
||||
check_animation( anime, node )
|
||||
{
|
||||
array = create_animation_list();
|
||||
|
||||
if ( anime == "random" )
|
||||
{
|
||||
array2 = [];
|
||||
for ( i = 0; i < array.size; i++ )
|
||||
{
|
||||
if ( !isdefined( level.scr_anim[ "generic" ][ array[ i ] + "_react" ] ) )
|
||||
array2[ array2.size ] = array[ i ];
|
||||
}
|
||||
|
||||
if ( !array2.size )
|
||||
return true;
|
||||
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- " );
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- " );
|
||||
println( " -- -- - add these lines to your level script AFTER maps\\\_load::main(); -- -- -- -- -- -- - " );
|
||||
for ( i = 0; i < array2.size; i++ )
|
||||
println( "maps\\\_idle_" + array2[ i ] + "::main();" );
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- " );
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- - hint copy paste them from console.log -- -- -- -- -- -- -- -- -- -- " );
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- " );
|
||||
assertEX( false, "missing _idle scripts, see above console prints" );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
for ( i = 0; i < array.size; i++ )
|
||||
{
|
||||
if ( array[ i ] == anime )
|
||||
{
|
||||
if ( !isdefined( level.scr_anim[ "generic" ][ anime + "_react" ] ) )
|
||||
{
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- " );
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- " );
|
||||
println( " -- -- - add these lines to your level script AFTER maps\\\_load::main(); -- -- -- -- -- -- - " );
|
||||
println( "maps\\\_idle_" + anime + "::main();" );
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- " );
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- - hint copy paste them from console.log -- -- -- -- -- -- -- -- -- -- " );
|
||||
println( " -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- " );
|
||||
assertEX( false, "missing _idle scripts, see above console prints" );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
msg = "";
|
||||
for ( i = 0; i < array.size; i++ )
|
||||
msg = msg + array[ i ] + ", ";
|
||||
msg = msg + "and random.";
|
||||
|
||||
assertmsg( "node at (" + node.origin[ 0 ] + ", " + node.origin[ 1 ] + ", " + node.origin[ 2 ] + ") using the maps\_idle:: system with script_animation set to " + anime + ", which isn't valid. Valid names are " + msg );
|
||||
return false;
|
||||
}
|
||||
|
||||
get_ent( name, type )
|
||||
{
|
||||
return getent( name, type );
|
||||
}
|
||||
|
||||
get_node( name, type )
|
||||
{
|
||||
return getnode( name, type );
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#include maps\_props;
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
level.scr_anim[ "generic" ][ "coffee_idle" ][ 0 ] = %cargoship_stunned_coffee_react_idle;
|
||||
level.scr_anim[ "generic" ][ "coffee_react" ] = %exposed_idle_twitch_v4;
|
||||
script_models();
|
||||
}
|
||||
|
||||
#using_animtree( "script_model" );
|
||||
script_models()
|
||||
{
|
||||
level.scr_anim[ "chair" ][ "sleep_react" ] = %parabolic_guard_sleeper_react_chair;
|
||||
level.scr_animtree[ "chair" ] = #animtree;
|
||||
level.scr_model[ "chair" ] = "com_folding_chair";
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#include maps\_props;
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
add_smoking_notetracks( "generic" );
|
||||
level.scr_anim[ "generic" ][ "lean_smoke_idle" ][ 0 ] = %parabolic_leaning_guy_smoking_idle;
|
||||
level.scr_anim[ "generic" ][ "lean_smoke_idle" ][ 1 ] = %parabolic_leaning_guy_smoking_twitch;
|
||||
level.scr_anim[ "generic" ][ "lean_smoke_react" ] = %parabolic_leaning_guy_react;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#include maps\_props;
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
add_cellphone_notetracks( "generic" );
|
||||
level.scr_anim[ "generic" ][ "phone_idle" ][ 0 ] = %patrol_bored_idle_cellphone;
|
||||
level.scr_anim[ "generic" ][ "phone_react" ] = %patrol_bored_react_look_retreat;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#include maps\_props;
|
||||
#include maps\_anim;
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
|
||||
add_sit_load_ak_notetracks( "generic" );
|
||||
level.scr_anim[ "generic" ][ "sit_load_ak_idle" ][ 0 ] = %sitting_guard_loadAK_idle;
|
||||
level.scr_anim[ "generic" ][ "sit_load_ak_react" ] = %sitting_guard_loadAK_react1;
|
||||
addNotetrack_customFunction( "generic", "detach clip left" , ::load_ak_deathanim , "sit_load_ak_react" );
|
||||
//level.scr_anim[ "generic" ][ "phone_react" ] = %sitting_guard_loadAK_react2;
|
||||
script_models();
|
||||
}
|
||||
|
||||
load_ak_deathanim( guy )
|
||||
{
|
||||
guy.deathanim = %exposed_death_nerve;
|
||||
|
||||
guy endon( "death" );
|
||||
|
||||
wait 2;
|
||||
|
||||
guy.deathanim = undefined;
|
||||
}
|
||||
|
||||
#using_animtree( "script_model" );
|
||||
script_models()
|
||||
{
|
||||
level.scr_anim[ "chair_ak" ][ "sit_load_ak_react" ] = %sitting_guard_loadAK_idle_chair;
|
||||
level.scr_animtree[ "chair_ak" ] = #animtree;
|
||||
level.scr_model[ "chair_ak" ] = "com_folding_chair";
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#include maps\_props;
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
level.scr_anim[ "generic" ][ "sleep_idle" ][ 0 ] = %parabolic_guard_sleeper_idle;
|
||||
level.scr_anim[ "generic" ][ "sleep_react" ] = %parabolic_guard_sleeper_react;
|
||||
script_models();
|
||||
}
|
||||
|
||||
#using_animtree( "script_model" );
|
||||
script_models()
|
||||
{
|
||||
level.scr_anim[ "chair" ][ "sleep_react" ] = %parabolic_guard_sleeper_react_chair;
|
||||
level.scr_animtree[ "chair" ] = #animtree;
|
||||
level.scr_model[ "chair" ] = "com_folding_chair";
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#include maps\_props;
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
main()
|
||||
{
|
||||
add_smoking_notetracks( "generic" );
|
||||
level.scr_anim[ "generic" ][ "smoke_idle" ][ 0 ] = %patrol_bored_idle_smoke;
|
||||
level.scr_anim[ "generic" ][ "smoke_react" ] = %patrol_bored_react_look_advance;
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
#include maps\_hud_util;
|
||||
|
||||
//need to be able to save select dvar in menu (spending points while in the menu)
|
||||
//need to be able to save select dvar from script (dvars track which items are found)
|
||||
main()
|
||||
{
|
||||
// &&1/30 pieces of enemy intel found.
|
||||
precachestring( &"SCRIPT_INTELLIGENCE_OF_FOURTYFIVE" );
|
||||
precachestring( &"SCRIPT_INTELLIGENCE_PREV_FOUND" );
|
||||
level.intel_items = create_array_of_intel_items();
|
||||
println( "intelligence.gsc: intelligence items:", level.intel_items.size );
|
||||
|
||||
setDvar( "ui_level_cheatpoints", level.intel_items.size );
|
||||
level.intel_counter = 0; // intel counter for collected intel points for this mission
|
||||
setDvar( "ui_level_player_cheatpoints", level.intel_counter );
|
||||
|
||||
level.table_origins = create_array_of_origins_from_table();
|
||||
initialize_intel();
|
||||
|
||||
if( is_specialop() )
|
||||
{
|
||||
remove_all_intel();
|
||||
return;
|
||||
}
|
||||
|
||||
intel_think();
|
||||
|
||||
wait .05;
|
||||
}
|
||||
|
||||
remove_all_intel()
|
||||
{
|
||||
foreach ( index, trigger in level.intel_items )
|
||||
{
|
||||
if ( !isdefined( trigger.removed ) )
|
||||
trigger remove_intel_item();
|
||||
}
|
||||
}
|
||||
|
||||
remove_intel_item()
|
||||
{
|
||||
self.removed = true;
|
||||
self.item hide();
|
||||
self.item notsolid();
|
||||
self trigger_off();
|
||||
|
||||
level.intel_counter++;
|
||||
setDvar( "ui_level_player_cheatpoints", level.intel_counter );
|
||||
|
||||
self notify( "end_trigger_thread" );
|
||||
/#
|
||||
println( "^3Removed Intel: " + self.num );
|
||||
#/
|
||||
}
|
||||
|
||||
initialize_intel()
|
||||
{
|
||||
foreach ( index, trigger in level.intel_items )
|
||||
{
|
||||
origin = trigger.origin;
|
||||
trigger.num = get_nums_from_origins( origin );
|
||||
}
|
||||
}
|
||||
|
||||
intel_think()
|
||||
{
|
||||
foreach ( index, trigger in level.intel_items )
|
||||
{
|
||||
if ( trigger check_item_found() )
|
||||
{
|
||||
trigger remove_intel_item();
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger thread wait_for_pickup();
|
||||
trigger thread poll_for_found();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//we poll constantly to see if the item's been picked up...this is because script only checks at the
|
||||
//beginning if the item was found or not...after that, it doesn't check anymore, however a player can
|
||||
//pick up intel, die, reload an earlier part of script and then pick up intel again...this polling
|
||||
//insures things like that dont happen.
|
||||
poll_for_found()
|
||||
{
|
||||
self endon( "end_loop_thread" );
|
||||
|
||||
while( !self check_item_found() )
|
||||
wait .1;
|
||||
|
||||
self remove_intel_item();
|
||||
}
|
||||
|
||||
check_item_found()
|
||||
{
|
||||
foreach( player in level.players )
|
||||
{
|
||||
if( !player GetPlayerIntelIsFound( self.num ) )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
create_array_of_intel_items()
|
||||
{
|
||||
intelligence_items = getentarray( "intelligence_item", "targetname" );
|
||||
for ( i = 0;i < intelligence_items.size;i++ )
|
||||
{
|
||||
println( intelligence_items[ i ].origin );
|
||||
intelligence_items[ i ].item = getent( intelligence_items[ i ].target, "targetname" );
|
||||
intelligence_items[ i ].found = false;
|
||||
}
|
||||
return intelligence_items;
|
||||
}
|
||||
|
||||
create_array_of_origins_from_table()
|
||||
{
|
||||
origins = [];
|
||||
for ( num = 1; num <= 64; num++ )
|
||||
{
|
||||
location = tablelookup( "maps/_intel_items.csv", 0, num, 4 );
|
||||
if ( isdefined( location ) && ( location != "undefined" ) )
|
||||
{
|
||||
locArray = strTok( location, "," );
|
||||
assert( locArray.size == 3 );
|
||||
for ( i = 0;i < locArray.size;i++ )
|
||||
locArray[ i ] = int( locArray[ i ] );
|
||||
origins [ num ] = ( locArray[ 0 ], locArray[ 1 ], locArray[ 2 ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
origins [ num ] = undefined;
|
||||
}
|
||||
}
|
||||
return origins;
|
||||
}
|
||||
|
||||
wait_for_pickup()
|
||||
{
|
||||
self endon( "end_trigger_thread" );
|
||||
|
||||
if( self.classname == "trigger_use" )
|
||||
{
|
||||
// Press and hold^3 &&1 ^7to secure the enemy intelligence.
|
||||
self setHintString( &"SCRIPT_INTELLIGENCE_PICKUP" );
|
||||
self usetriggerrequirelookat();
|
||||
}
|
||||
|
||||
self waittill( "trigger", player );
|
||||
self notify( "end_loop_thread" );
|
||||
|
||||
self intel_feedback( player );
|
||||
self save_intel_for_all_players();
|
||||
UpdateGamerProfileAll();
|
||||
|
||||
waittillframeend;
|
||||
|
||||
self remove_intel_item();
|
||||
}
|
||||
|
||||
save_intel_for_all_players()
|
||||
{
|
||||
assert( ! self check_item_found() );
|
||||
|
||||
foreach( player in level.players )
|
||||
{
|
||||
if( player GetPlayerIntelIsFound( self.num ) )
|
||||
continue;
|
||||
|
||||
player SetPlayerIntelFound( self.num );
|
||||
}
|
||||
logString( "found intel item " + self.num );
|
||||
|
||||
// updates percent complete
|
||||
/#
|
||||
PrintLn( ">> SP PERCENT UPDATE - save_intel_for_all_players()" );
|
||||
#/
|
||||
maps\_endmission::updateSpPercent();
|
||||
}
|
||||
|
||||
give_point()
|
||||
{
|
||||
//give_points
|
||||
curValue = ( self GetLocalPlayerProfileData( "cheatPoints" ));
|
||||
self SetLocalPlayerProfileData( "cheatPoints", curValue + 1 );
|
||||
}
|
||||
|
||||
intel_feedback( found_by_player )
|
||||
{
|
||||
self.item hide();
|
||||
self.item notsolid();
|
||||
level thread play_sound_in_space( "intelligence_pickup", self.item.origin );
|
||||
|
||||
display_time = 3000;
|
||||
fade_time = 700;
|
||||
delete_time = display_time + fade_time / 1000;
|
||||
|
||||
foreach( player in level.players )
|
||||
{
|
||||
//if i did NOT find it, but I already had it, print nothing
|
||||
if( found_by_player != player && player GetPlayerIntelIsFound( self.num ) )
|
||||
continue;
|
||||
|
||||
remaining_print = player createClientFontString( "objective", 1.5 );
|
||||
remaining_print.glowColor = ( 0.7, 0.7, 0.3 );
|
||||
remaining_print.glowAlpha = 1;
|
||||
remaining_print setup_hud_elem();
|
||||
remaining_print.y = -60;
|
||||
remaining_print SetPulseFX( 60, display_time, fade_time );
|
||||
|
||||
intel_found = 0;
|
||||
|
||||
//if I found it and I already had it
|
||||
if( found_by_player == player && player GetPlayerIntelIsFound( self.num ) )
|
||||
remaining_print.label = &"SCRIPT_INTELLIGENCE_PREV_FOUND";
|
||||
else
|
||||
{
|
||||
// &&1/30 pieces of enemy intel found.
|
||||
remaining_print.label = &"SCRIPT_INTELLIGENCE_OF_FOURTYFIVE";
|
||||
player give_point();
|
||||
intel_found = ( player GetLocalPlayerProfileData( "cheatPoints" ));
|
||||
remaining_print setValue( intel_found );
|
||||
}
|
||||
|
||||
if ( intel_found == 22 )
|
||||
player maps\_utility::player_giveachievement_wrapper( "THE_ROAD_LESS_TRAVELED" );
|
||||
|
||||
if ( intel_found == 45 )
|
||||
player maps\_utility::player_giveachievement_wrapper( "LEAVE_NO_STONE_UNTURNED" );
|
||||
|
||||
remaining_print delaycall( delete_time, ::Destroy );
|
||||
}
|
||||
}
|
||||
|
||||
setup_hud_elem()
|
||||
{
|
||||
self.color = ( 1, 1, 1 );
|
||||
self.alpha = 1;
|
||||
self.x = 0;
|
||||
self.alignx = "center";
|
||||
self.aligny = "middle";
|
||||
self.horzAlign = "center";
|
||||
self.vertAlign = "middle";
|
||||
self.foreground = true;
|
||||
}
|
||||
|
||||
assert_if_identical_origins()
|
||||
{
|
||||
origins = [];
|
||||
for ( i = 1;i < 65;i++ )
|
||||
{
|
||||
location = tablelookup( "maps/_intel_items.csv", 0, i, 4 );
|
||||
locArray = strTok( location, "," );
|
||||
//assert( locArray.size == 3 );
|
||||
for ( i = 0;i < locArray.size;i++ )
|
||||
locArray[ i ] = int( locArray[ i ] );
|
||||
origins [ i ] = ( locArray[ 0 ], locArray[ 1 ], locArray[ 2 ] );
|
||||
|
||||
|
||||
//if ( distancesquared( first.origin, second.origin ) < 4 );
|
||||
}
|
||||
|
||||
for ( i = 0;i < origins.size;i++ )
|
||||
{
|
||||
if ( ! isdefined( origins [ i ] ) )
|
||||
continue;
|
||||
if ( origins [ i ] == "undefined" )
|
||||
continue;
|
||||
for ( j = 0;j < origins.size;j++ )
|
||||
{
|
||||
if ( ! isdefined( origins [ j ] ) )
|
||||
continue;
|
||||
if ( origins [ j ] == "undefined" )
|
||||
continue;
|
||||
if ( i == j )
|
||||
continue;
|
||||
if ( origins [ i ] == origins[ j ] )
|
||||
assertmsg( "intel items in maps/_intel_items.csv with identical origins (" + origins[ i ] + ") " );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get_nums_from_origins( origin )
|
||||
{
|
||||
for ( i = 1;i < level.table_origins.size + 1;i++ )
|
||||
{
|
||||
if ( !isdefined( level.table_origins [ i ] ) )
|
||||
continue;
|
||||
if ( distancesquared( origin, level.table_origins[ i ] ) < squared( 75 ) )
|
||||
return i;
|
||||
}
|
||||
|
||||
assertmsg( "Add the origin of this intel item ( " + origin + " ) to maps/_intel_items.csv file" );
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Loaded 100 of 5854 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user