mirror of
https://github.com/reaaLx/nx1-gsc-dump.git
synced 2025-06-27 23:01:49 +00:00
Incomplete SP dump provided by Louvenarde
This commit is contained in:
176
maps/_80s_hatch1.gsc
Normal file
176
maps/_80s_hatch1.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_brn_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_green_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_red_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_silv_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_tan_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_hatch1::main( "vehicle_80s_hatch1_yel_destructible_mp" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
250
maps/_80s_sedan1.gsc
Normal file
250
maps/_80s_sedan1.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_brn" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_brn_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_green" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_green_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_red" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_red_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_silv" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_silv_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_tan" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_tan_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_yel" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_sedan1::main( "vehicle_80s_sedan1_yel_destructible_mp" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
177
maps/_80s_wagon1.gsc
Normal file
177
maps/_80s_wagon1.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_brn_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_green_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_red_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_silv_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_tan_destructible_mp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_80s_wagon1::main( "vehicle_80s_wagon1_yel_destructible_mp" );
|
||||
|
||||
|
||||
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
maps/_ac130.gsc
Normal file
1987
maps/_ac130.gsc
Normal file
File diff suppressed because it is too large
Load Diff
24
maps/_ac130_amb.gsc
Normal file
24
maps/_ac130_amb.gsc
Normal file
@ -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" );
|
||||
}
|
||||
|
||||
|
179
maps/_ac130_snd.gsc
Normal file
179
maps/_ac130_snd.gsc
Normal file
@ -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 <20>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 <20>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<68>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<75>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<72>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<72>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<68>s headin<69> 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 );
|
||||
}
|
||||
}
|
1475
maps/_ambient.gsc
Normal file
1475
maps/_ambient.gsc
Normal file
File diff suppressed because it is too large
Load Diff
65
maps/_ambulance.gsc
Normal file
65
maps/_ambulance.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_ambulance::main( "vehicle_ambulance_russian" );
|
||||
|
||||
|
||||
include,vehicle_ambulance_russian
|
||||
sound,vehicle_ambulance,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_ambulance_russian"
|
||||
default:"vehicletype" "ambulance"
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
3396
maps/_anim.gsc
Normal file
3396
maps/_anim.gsc
Normal file
File diff suppressed because it is too large
Load Diff
94
maps/_animatedmodels.gsc
Normal file
94
maps/_animatedmodels.gsc
Normal file
@ -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 );
|
||||
}
|
||||
|
72
maps/_antonov.gsc
Normal file
72
maps/_antonov.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_antonov::main( "vehicle_antonov_fly" );
|
||||
|
||||
|
||||
include,vehicle_antonov
|
||||
sound,vehicle_antonov,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_antonov_fly"
|
||||
default:"vehicletype" "antonov"
|
||||
default:"script_team" "allies"
|
||||
*/
|
103
maps/_apache.gsc
Normal file
103
maps/_apache.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_apache::main( "vehicle_apache" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_apache::main( "vehicle_apache_dark" );
|
||||
|
||||
|
||||
include,vehicle_apache_dark_apache
|
||||
sound,vehicle_apache,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_apache_dark"
|
||||
default:"vehicletype" "apache"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
2363
maps/_arcademode.gsc
Normal file
2363
maps/_arcademode.gsc
Normal file
File diff suppressed because it is too large
Load Diff
739
maps/_art.gsc
Normal file
739
maps/_art.gsc
Normal file
@ -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;
|
||||
}
|
||||
|
||||
|
185
maps/_atbr.gsc
Normal file
185
maps/_atbr.gsc
Normal file
@ -0,0 +1,185 @@
|
||||
#include maps\_utility;
|
||||
#include maps\_hud_util;
|
||||
#include common_scripts\utility;
|
||||
#include common_scripts\_atbr;
|
||||
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
init_atbr()
|
||||
{
|
||||
// Register local callbacks.
|
||||
level._atbr_callback_set_targets = ::atbr_set_targets;
|
||||
level._atbr_callback_remove_targets = ::atbr_remove_targets;
|
||||
|
||||
// Weapons.
|
||||
level._atbr_weapons = [];
|
||||
level._atbr_weapons["base"] = "atbr_base";
|
||||
level._atbr_weapons["detonate"] = "atbr_detonate";
|
||||
level._atbr_weapons["missile"] = "atbr_missile";
|
||||
level._atbr_weapons["bullet"] = "atbr_bullet";
|
||||
|
||||
common_scripts\_atbr::atbr_common_init();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
give_atbr()
|
||||
{
|
||||
common_scripts\_atbr::atbr_common_give();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
atbr_set_targets( missile )
|
||||
{
|
||||
// Targets.
|
||||
self thread add_target_draw();
|
||||
ai_list = getaiarray( "all" );
|
||||
foreach( ai in ai_list )
|
||||
{
|
||||
ai thread add_target_draw();
|
||||
}
|
||||
thread draw_targets( missile, self );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
atbr_remove_targets()
|
||||
{
|
||||
thread remove_targets();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
add_target_draw()
|
||||
{
|
||||
if ( !isdefined( level._atbr_targets ) )
|
||||
{
|
||||
level._atbr_targets = [];
|
||||
}
|
||||
level._atbr_targets[ level._atbr_targets.size ] = self;
|
||||
|
||||
// Remove target on death.
|
||||
self waittill( "death" );
|
||||
self remove_target_draw();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
remove_target_draw()
|
||||
{
|
||||
if ( IsDefined( self.has_target_shader ) )
|
||||
{
|
||||
self.has_target_shader = undefined;
|
||||
Target_Remove( self );
|
||||
}
|
||||
level._atbr_targets = array_remove( level._atbr_targets, self );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
draw_targets( missile, controlling_player )
|
||||
{
|
||||
missile endon( "death" );
|
||||
|
||||
if ( !isdefined( level._atbr_targets ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw update.
|
||||
targets_per_frame = 5;
|
||||
targets_drawn = 0;
|
||||
time_between_updates = .05;
|
||||
for( ;; )
|
||||
{
|
||||
foreach( tgt in level._atbr_targets )
|
||||
{
|
||||
if( IsAlive( tgt ))
|
||||
{
|
||||
tgt draw_target( controlling_player );
|
||||
targets_drawn++;
|
||||
if( targets_drawn >= targets_per_frame )
|
||||
{
|
||||
targets_drawn = 0;
|
||||
wait time_between_updates;
|
||||
}
|
||||
}
|
||||
}
|
||||
wait( 0.001 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
draw_target( controlling_player )
|
||||
{
|
||||
// Shader setup.
|
||||
self.has_target_shader = true;
|
||||
Target_Set( self, ( 0, 0, 64 ) );
|
||||
if( IsAI( self ))
|
||||
{
|
||||
Target_SetShader( self, "remotemissile_infantry_target" );
|
||||
}
|
||||
else if( IsPlayer( self ) )
|
||||
{
|
||||
Target_SetShader( self, "hud_fofbox_self_sp" );
|
||||
}
|
||||
else
|
||||
{
|
||||
Target_SetShader( self, "veh_hud_target" );
|
||||
}
|
||||
|
||||
// Target drawing.
|
||||
Target_ShowToPlayer( self, controlling_player );
|
||||
if( IsPlayer( self ) && self != controlling_player )
|
||||
{
|
||||
Target_HideFromPlayer( controlling_player, self );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
remove_targets()
|
||||
{
|
||||
foreach( tgt in level._atbr_targets )
|
||||
{
|
||||
tgt remove_target_draw();
|
||||
}
|
||||
}
|
3057
maps/_attack_heli.gsc
Normal file
3057
maps/_attack_heli.gsc
Normal file
File diff suppressed because it is too large
Load Diff
688
maps/_autosave.gsc
Normal file
688
maps/_autosave.gsc
Normal file
@ -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
maps/_b2.gsc
Normal file
108
maps/_b2.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_b2::main( "vehicle_b2_bomber" );
|
||||
|
||||
|
||||
include,vehicle_b2
|
||||
sound,vehicle_b2,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_b2_bomber"
|
||||
default:"vehicletype" "b2"
|
||||
default:"script_team" "allies"
|
||||
*/
|
2807
maps/_bcs_location_trigs.gsc
Normal file
2807
maps/_bcs_location_trigs.gsc
Normal file
File diff suppressed because it is too large
Load Diff
359
maps/_blackhawk.gsc
Normal file
359
maps/_blackhawk.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_blackhawk::main( "vehicle_blackhawk" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_blackhawk::main( "vehicle_blackhawk_hero_sas_night" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_blackhawk::main( "vehicle_blackhawk_low" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_blackhawk::main( "vehicle_blackhawk_low_thermal" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_blackhawk_minigun::main( "vehicle_blackhawk_minigun_low" );
|
||||
|
||||
|
||||
include,vehicle_blackhawk_minigun_low_blackhawk_minigun
|
||||
|
||||
|
||||
defaultmdl="vehicle_blackhawk_minigun_low"
|
||||
default:"vehicletype" "blackhawk_minigun"
|
||||
default:"script_team" "allies"
|
||||
*/
|
107
maps/_bm21.gsc
Normal file
107
maps/_bm21.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_bm21::main( "vehicle_bm21_mobile" );
|
||||
|
||||
|
||||
include,vehicle_bm21_mobile_bm21
|
||||
sound,vehicle_bm21,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bm21_mobile"
|
||||
default:"vehicletype" "bm21"
|
||||
default:"script_team" "allies"
|
||||
*/
|
216
maps/_bm21_drivable.gsc
Normal file
216
maps/_bm21_drivable.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_bm21_drivable::main( "vehicle_bm21_mobile_bed" );
|
||||
|
||||
|
||||
include,vehicle_bm21_drivable
|
||||
sound,vehicle_bm21,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_bm21_mobile_bed"
|
||||
default:"vehicletype" "bm21_drivable"
|
||||
default:"script_team" "axis"
|
||||
*/
|
276
maps/_bm21_troops.gsc
Normal file
276
maps/_bm21_troops.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile_bed" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile_cover_snow" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile_cover" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bm21_troops::main( "vehicle_bm21_mobile_cover_no_bench" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
254
maps/_bmp.gsc
Normal file
254
maps/_bmp.gsc
Normal file
@ -0,0 +1,254 @@
|
||||
#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
|
||||
|
||||
|
||||
maps\_bmp::main( "vehicle_bmp" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bmp::main( "vehicle_bmp_winter", "bmp_physics" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bmp::main( "vehicle_bmp_winter" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bmp::main( "vehicle_bmp_desert" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bmp::main( "vehicle_bmp_low" );
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bmp::main( "vehicle_bmp_thermal" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bmp::main( "vehicle_bmp_woodland" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bmp::main( "vehicle_bmp_woodland_jeepride" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bmp::main( "vehicle_bmp_woodland_low" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
74
maps/_bradley.gsc
Normal file
74
maps/_bradley.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_bradley::main( "vehicle_bradley" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_bradley::main( "vehicle_bradley", "bradley_physics" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
834
maps/_breach.gsc
Normal file
834
maps/_breach.gsc
Normal file
@ -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;
|
||||
}
|
346
maps/_briefing.gsc
Normal file
346
maps/_briefing.gsc
Normal file
@ -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 );
|
||||
}
|
||||
|
238
maps/_btr80.gsc
Normal file
238
maps/_btr80.gsc
Normal file
@ -0,0 +1,238 @@
|
||||
#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" );
|
||||
|
||||
|
||||
maps\_btr80::main( "vehicle_btr80" );
|
||||
|
||||
|
||||
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_rocket (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
|
||||
maps\_btr80::main( "vehicle_btr80", "nx_btr80_rocket" );
|
||||
|
||||
|
||||
include,vehicle_btr80
|
||||
sound,vehicle_btr80,vehicle_standard,all_sp
|
||||
sound,vehicle_armor_exp,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_btr80"
|
||||
default:"vehicletype" "nx_btr80_rocket"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
|
||||
/*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" );
|
||||
|
||||
|
||||
maps\_btr80::main( "vehicle_btr80_low" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_btr80::main( "vehicle_btr80_snow" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_btr80::main( "vehicle_btr80_snow", "btr80_physics" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_btr80::main( "vehicle_btr80", "btr80_physics" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
18
maps/_bus.gsc
Normal file
18
maps/_bus.gsc
Normal file
@ -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()
|
||||
{
|
||||
}
|
64
maps/_c130.gsc
Normal file
64
maps/_c130.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_c130::main( "vehicle_ac130_low" );
|
||||
|
||||
|
||||
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
maps/_c4.gsc
Normal file
270
maps/_c4.gsc
Normal file
@ -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;
|
||||
}
|
29
maps/_cagedchickens.gsc
Normal file
29
maps/_cagedchickens.gsc
Normal file
@ -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" );
|
||||
}
|
||||
}
|
27
maps/_camera.gsc
Normal file
27
maps/_camera.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_camera::main( "vehicle_camera" );
|
||||
|
||||
|
||||
include,vehicle_camera_camera
|
||||
|
||||
|
||||
defaultmdl="vehicle_camera"
|
||||
default:"vehicletype" "camera"
|
||||
*/
|
195
maps/_carry_ai.gsc
Normal file
195
maps/_carry_ai.gsc
Normal file
@ -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;
|
||||
}
|
321
maps/_casual_killer.gsc
Normal file
321
maps/_casual_killer.gsc
Normal file
@ -0,0 +1,321 @@
|
||||
#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\init_common::clear_custom_animset();
|
||||
|
||||
self.prevMoveMode = "none";
|
||||
|
||||
self allowedStances( "stand", "crouch", "prone" );
|
||||
|
||||
self animscripts\init_common::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[ "straight_variation" ] = %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\init_common::set_animset_complete_custom_stand( animset );
|
||||
self animscripts\init_common::set_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;
|
||||
}
|
||||
}
|
1306
maps/_chute.gsc
Normal file
1306
maps/_chute.gsc
Normal file
File diff suppressed because it is too large
Load Diff
4479
maps/_climb.gsc
Normal file
4479
maps/_climb.gsc
Normal file
File diff suppressed because it is too large
Load Diff
156
maps/_cobra.gsc
Normal file
156
maps/_cobra.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_cobra::main( "vehicle_cobra_helicopter" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_cobra::main( "vehicle_cobra_helicopter_fly" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_cobra::main( "vehicle_cobra_helicopter_fly_low" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_cobra::main( "vehicle_cobra_helicopter_low" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
111
maps/_cobra_harbor.gsc
Normal file
111
maps/_cobra_harbor.gsc
Normal file
@ -0,0 +1,111 @@
|
||||
#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_harbor (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
|
||||
maps\_cobra::main( "vehicle_cobra_helicopter_fly", "cobra_harbor" );
|
||||
|
||||
|
||||
include,vehicle_cobra_helicopter_harbor
|
||||
sound,vehicle_cobra,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_cobra_helicopter_fly"
|
||||
default:"vehicletype" "cobra_harbor"
|
||||
default:"script_team" "allies"
|
||||
*/
|
69
maps/_cobra_player.gsc
Normal file
69
maps/_cobra_player.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_cobra_player::main( "vehicle_cobra_helicopter" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_cobra_player::main( "vehicle_cobra_helicopter_fly" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
2658
maps/_cobrapilot.gsc
Normal file
2658
maps/_cobrapilot.gsc
Normal file
File diff suppressed because it is too large
Load Diff
1882
maps/_colors.gsc
Normal file
1882
maps/_colors.gsc
Normal file
File diff suppressed because it is too large
Load Diff
92
maps/_compass.gsc
Normal file
92
maps/_compass.gsc
Normal file
@ -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
maps/_coop.gsc
Normal file
1315
maps/_coop.gsc
Normal file
File diff suppressed because it is too large
Load Diff
92
maps/_coupe.gsc
Normal file
92
maps/_coupe.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_coupe::main( "vehicle_coupe_gray_destructible" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_coupe::main( "vehicle_coupe_gold_destructible" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
69
maps/_createfx.gsc
Normal file
69
maps/_createfx.gsc
Normal file
@ -0,0 +1,69 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
#include common_scripts\_createFxMenu;
|
||||
#include common_scripts\_createfx;
|
||||
#include common_scripts\_fx;
|
||||
|
||||
createfx()
|
||||
{
|
||||
// tagPP<NOTE> by the time createfx is called, player position is already updated so those 2 functions don't work anymore.
|
||||
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_updatefx = ::restart_fx_looper;
|
||||
level._func_process_fx_rotater = ::process_fx_rotater;
|
||||
level._mp_createfx = false;
|
||||
|
||||
// tagPP<NOTE> what do they do?
|
||||
// level.func_exploder_preload = ::exploder_before_load;
|
||||
// level.func_exploder_postload = ::exploder_after_load;
|
||||
|
||||
// SP only stuff
|
||||
ai = getaiarray();
|
||||
for ( i = 0;i < ai.size;i++ )
|
||||
{
|
||||
ai[ i ] delete();
|
||||
}
|
||||
|
||||
// build _effect_keys array
|
||||
func_get_level_fx();
|
||||
|
||||
// createFX thread
|
||||
thread createFxLogic();
|
||||
|
||||
// remove triggers, turn on painter.
|
||||
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
|
||||
// ## this is not working anymore. maybe it was working before. Peter Pon ##
|
||||
|
||||
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 ] ) );
|
||||
|
||||
// level._player restore_for_createfx();
|
||||
}
|
607
maps/_createpath.gsc
Normal file
607
maps/_createpath.gsc
Normal file
@ -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;
|
||||
}
|
81
maps/_damagefeedback.gsc
Normal file
81
maps/_damagefeedback.gsc
Normal file
@ -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 );
|
||||
}
|
98
maps/_deadbody.gsc
Normal file
98
maps/_deadbody.gsc
Normal file
@ -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 );
|
||||
}
|
3353
maps/_debug.gsc
Normal file
3353
maps/_debug.gsc
Normal file
File diff suppressed because it is too large
Load Diff
627
maps/_detonategrenades.gsc
Normal file
627
maps/_detonategrenades.gsc
Normal file
@ -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 );
|
||||
}
|
||||
}
|
111
maps/_documents.gsc
Normal file
111
maps/_documents.gsc
Normal file
@ -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();
|
||||
}
|
918
maps/_drone.gsc
Normal file
918
maps/_drone.gsc
Normal file
@ -0,0 +1,918 @@
|
||||
#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_weaponsound[ "axis" ] = [ "drone_ak47_fire_npc" , "drone_g36c_fire_npc", "drone_fnp90_fire_npc" ];
|
||||
level._drone_weaponsound[ "allies" ] = [ "drone_m4carbine_fire_npc" , "drone_m16_fire_npc", "drone_fnp90_fire_npc" ];
|
||||
|
||||
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, 0.2, 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( 0, 3 );
|
||||
|
||||
//assign drone a random weapon for sound variety
|
||||
if( self.team == "axis" )
|
||||
{
|
||||
self.weaponsound = level._drone_weaponsound[ "axis" ][ iRand ];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.weaponsound = level._drone_weaponsound[ "allies" ][ iRand ];
|
||||
}
|
||||
|
||||
|
||||
//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 ( isArray( runAnim ) )
|
||||
{
|
||||
runAnim = runAnim[ randomint( runAnim.size ) ];
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
191
maps/_drone_ai.gsc
Normal file
191
maps/_drone_ai.gsc
Normal file
@ -0,0 +1,191 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
#using_animtree( "generic_human" );
|
||||
|
||||
//call from _drone_ai_lunar.gsc if being used on a moon mission.
|
||||
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();
|
||||
}
|
190
maps/_drone_ai_lunar.gsc
Normal file
190
maps/_drone_ai_lunar.gsc
Normal file
@ -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" ] = %tp_moon_death_stand_exposed_01;
|
||||
|
||||
|
||||
//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();
|
||||
}
|
16
maps/_drone_civilian.gsc
Normal file
16
maps/_drone_civilian.gsc
Normal file
@ -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_common::attachProps;
|
||||
|
||||
// init the generic drone script
|
||||
maps\_drone::initGlobals();
|
||||
}
|
16
maps/_drone_civilian_lunar.gsc
Normal file
16
maps/_drone_civilian_lunar.gsc
Normal file
@ -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" ] = %tp_moon_death_stand_exposed_01;
|
||||
|
||||
level._attachPropsFunction = animscripts\civilian\civilian_init_common::attachProps;
|
||||
|
||||
// init the generic drone script
|
||||
maps\_drone::initGlobals();
|
||||
}
|
851
maps/_dynamic_cover.gsc
Normal file
851
maps/_dynamic_cover.gsc
Normal file
@ -0,0 +1,851 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
#include maps\_anim;
|
||||
|
||||
//A semi-generic dynamic cover system. Each of the different types of dynamic cover have their own behavior,
|
||||
//but share some scripts so they're being all wrapped up in here.
|
||||
|
||||
//Each unique instance needs it's own script_noteworthy.
|
||||
main()
|
||||
{
|
||||
dynamic_cover_precache();
|
||||
|
||||
setup_player_anims();
|
||||
setup_script_model_anims();
|
||||
setup_generic_human_anims();
|
||||
|
||||
table_triggers = GetEntArray( "dynamic_cover_table_flip", "targetname" );
|
||||
array_thread( table_triggers, ::monitor_table_flip );
|
||||
|
||||
table_triggers = GetEntArray( "dynamic_cover_small_table_flip", "targetname" );
|
||||
array_thread( table_triggers, ::monitor_small_table_flip );
|
||||
|
||||
table_triggers = GetEntArray( "dynamic_cover_slide_exam_table_right", "targetname" );
|
||||
array_thread( table_triggers, ::monitor_exam_table_slide, "right" );
|
||||
|
||||
table_triggers = GetEntArray( "dynamic_cover_slide_exam_table_left", "targetname" );
|
||||
array_thread( table_triggers, ::monitor_exam_table_slide, "left" );
|
||||
|
||||
table_triggers = GetEntArray( "dynamic_cover_vending_machine_tip_right", "targetname" );
|
||||
array_thread( table_triggers, ::monitor_vending_machine_tip, "right" );
|
||||
|
||||
table_triggers = GetEntArray( "dynamic_cover_vending_machine_tip_left", "targetname" );
|
||||
array_thread( table_triggers, ::monitor_vending_machine_tip, "left" );
|
||||
}
|
||||
|
||||
dynamic_cover_precache()
|
||||
{
|
||||
precacheModel( "viewhands_player_us_army" );
|
||||
}
|
||||
|
||||
#using_animtree( "player" );
|
||||
setup_player_anims()
|
||||
{
|
||||
level._scr_animtree[ "player_hands" ] = #animtree;
|
||||
level._scr_model[ "player_hands" ] = "viewhands_player_us_army";
|
||||
level._scr_anim[ "player_hands" ][ "player_table_flip" ] = %nx_fp_dynamic_cover_table;
|
||||
level._scr_anim[ "player_hands" ][ "player_small_table_flip" ] = %nx_fp_dynamic_cover_table_small;
|
||||
level._scr_anim[ "player_hands" ][ "player_table_slide_right" ] = %nx_fp_dynamic_cover_examtable_2R;
|
||||
level._scr_anim[ "player_hands" ][ "player_table_slide_left" ] = %nx_fp_dynamic_cover_examtable_2L;
|
||||
level._scr_anim[ "player_hands" ][ "player_vend_mach_right" ] = %nx_fp_dynamic_cover_soda_machine_S_2R;
|
||||
level._scr_anim[ "player_hands" ][ "player_vend_mach_left" ] = %nx_fp_dynamic_cover_soda_machine_S_2L;
|
||||
|
||||
// Crouch versions.
|
||||
level._scr_player_anim_crouch = [];
|
||||
level._scr_player_anim_crouch[ "player_vend_mach_right" ] = true;
|
||||
level._scr_player_anim_crouch[ "player_vend_mach_left" ] = true;
|
||||
level._scr_player_anim_crouch[ "player_table_flip" ] = true;
|
||||
level._scr_player_anim_crouch[ "player_small_table_flip" ] = true;
|
||||
level._scr_player_anim_crouch[ "player_table_slide_left" ] = true;
|
||||
level._scr_player_anim_crouch[ "player_table_slide_right" ] = true;
|
||||
|
||||
addNotetrack_customFunction( "player_hands", "rumble_heavy", ::DynamicCover_rumble_heavy );
|
||||
addNotetrack_customFunction( "player_hands", "rumble_medium", ::DynamicCover_rumble_medium );
|
||||
addNotetrack_customFunction( "player_hands", "rumble_light", ::DynamicCover_rumble_light );
|
||||
|
||||
}
|
||||
|
||||
#using_animtree( "script_model" );
|
||||
setup_script_model_anims()
|
||||
{
|
||||
level._scr_animtree[ "dynamic_cover_table" ] = #animtree;
|
||||
level._scr_model[ "dynamic_cover_table" ] = "dynamic_cover_table";
|
||||
level._scr_anim[ "dynamic_cover_table" ][ "player_table_flip" ] = %nx_pr_dynamic_cover_table;
|
||||
level._scr_anim[ "dynamic_cover_table" ][ "actor_table_flip" ] = %tp_hospital_flip_over_front_table;
|
||||
|
||||
level._scr_animtree[ "dynamic_cover_small_table" ] = #animtree;
|
||||
level._scr_model[ "dynamic_cover_small_table" ] = "nx_dynamic_cover_table_02";
|
||||
level._scr_anim[ "dynamic_cover_small_table" ][ "player_small_table_flip" ] = %nx_pr_dynamic_cover_table_small;
|
||||
level._scr_anim[ "dynamic_cover_small_table" ][ "actor_small_table_flip" ] = %nx_pr_dynamic_cover_table_small;
|
||||
|
||||
level._scr_animtree[ "dynamic_cover_exam_table" ] = #animtree;
|
||||
level._scr_model[ "dynamic_cover_exam_table" ] = "nx_exam_table";
|
||||
level._scr_anim[ "dynamic_cover_exam_table" ][ "player_table_slide_right" ] = %nx_pr_dynamic_cover_examtable_2R;
|
||||
level._scr_anim[ "dynamic_cover_exam_table" ][ "actor_table_slide_right" ] = %tp_hospital_slide_examtable_R_props;
|
||||
level._scr_anim[ "dynamic_cover_exam_table" ][ "player_table_slide_left" ] = %nx_pr_dynamic_cover_examtable_2L;
|
||||
level._scr_anim[ "dynamic_cover_exam_table" ][ "actor_table_slide_left" ] = %tp_hospital_slide_examtable_L_props;
|
||||
|
||||
level._scr_animtree[ "dynamic_cover_vend_mach" ] = #animtree;
|
||||
level._scr_model[ "dynamic_cover_vend_mach" ] = "dynamic_cover_soda_machine";
|
||||
level._scr_anim[ "dynamic_cover_vend_mach" ][ "player_vend_mach_right" ] = %nx_pr_dynamic_cover_soda_machine_S_2R;
|
||||
level._scr_anim[ "dynamic_cover_vend_mach" ][ "actor_vend_mach_right" ] = %pr_hospital_soda_fall_R;
|
||||
level._scr_anim[ "dynamic_cover_vend_mach" ][ "player_vend_mach_left" ] = %nx_pr_dynamic_cover_soda_machine_S_2L;
|
||||
level._scr_anim[ "dynamic_cover_vend_mach" ][ "actor_vend_mach_left" ] = %pr_hospital_soda_fall_L;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
setup_generic_human_anims()
|
||||
{
|
||||
//these names should match the targetname for script simplicity.
|
||||
level._scr_animtree[ "actor_dynamic_cover_table" ] = #animtree;
|
||||
level._scr_anim[ "actor_dynamic_cover_table" ][ "actor_table_flip" ] = %tp_hospital_flip_over_front;
|
||||
level._scr_anim[ "actor_dynamic_cover_table" ][ "actor_table_slide_right" ] = %tp_hospital_slide_examtable_R;
|
||||
level._scr_anim[ "actor_dynamic_cover_table" ][ "actor_table_slide_left" ] = %tp_hospital_slide_examtable_L;
|
||||
level._scr_anim[ "actor_dynamic_cover_table" ][ "actor_small_table_flip" ] = %tp_hospital_flip_over_front;
|
||||
level._scr_anim[ "actor_dynamic_cover_table" ][ "actor_vend_mach_right" ] = %tp_hospital_soda_fall_R;
|
||||
level._scr_anim[ "actor_dynamic_cover_table" ][ "actor_vend_mach_left" ] = %tp_hospital_soda_fall_L;
|
||||
|
||||
}
|
||||
|
||||
monitor_table_flip()
|
||||
{
|
||||
self endon( "abort" );
|
||||
assertEx( IsDefined( self.script_noteworthy ), "dynamic_cover prefab at position " + vector_string( self.origin ) + " is missing a unique script_noteworthy" );
|
||||
|
||||
self table_flip_params();
|
||||
|
||||
/#
|
||||
self check_for_duplicated_unique_name(); //do a test to verify that each dynamic_cover has been given a unique script_noteworthy.
|
||||
#/
|
||||
|
||||
//disconnected by default. Reconnect and then move the geo out of the way so the player or actors dont collide.
|
||||
self reconnect_paths( self.collision_block );
|
||||
self hide_blocking_geo( self.collision_block );
|
||||
self hide_blocking_geo( self.traversal_block );
|
||||
|
||||
self thread monitor_table_flip_triggers();
|
||||
self thread monitor_actor_table_flip();
|
||||
|
||||
//wait until the player or an actor flips the table.
|
||||
self waittill( "table_flip" );
|
||||
|
||||
self.dynamic_cover_activated = true;
|
||||
|
||||
//now enable the traversal
|
||||
|
||||
self reconnect_paths( self.init_collision_block );
|
||||
self hide_blocking_geo( self.init_collision_block );
|
||||
self unhide_blocking_geo( self.traversal_block );
|
||||
self reconnect_paths( self.traversal_block );
|
||||
//self hide_blocking_geo( self.traversal_block );
|
||||
self unhide_blocking_geo( self.collision_block );
|
||||
self disconnect_paths( self.collision_block );
|
||||
|
||||
}
|
||||
|
||||
//called on a trigger_use entity.
|
||||
monitor_table_flip_triggers()
|
||||
{
|
||||
self endon( "table_flip" );
|
||||
self endon( "dynamic_cover_ai_activate" );
|
||||
|
||||
self SetHintString( &"SCRIPT_HINT_FLIP_TABLE" );
|
||||
self UseTriggerRequireLookAt();
|
||||
self thread monitor_trigger_view_direction( "table_flip" );
|
||||
|
||||
//wait until the player selects to use the table.
|
||||
self waittill( "trigger" );
|
||||
|
||||
self MakeUnusable();
|
||||
|
||||
//lets flip the table!
|
||||
self player_animate_dynamic_cover( "player_table_flip", "dynamic_cover_table" );
|
||||
|
||||
level notify( "table_flip" );
|
||||
self notify( "table_flip" ); //must be the last line in the script because the script ends on the same endon.
|
||||
}
|
||||
|
||||
monitor_actor_table_flip()
|
||||
{
|
||||
self endon( "table_flip" );
|
||||
self endon( "dynamic_cover_player_activate" );
|
||||
|
||||
self waittill( "actor_activate", actor ); //wait until
|
||||
|
||||
self MakeUnusable();
|
||||
|
||||
//play the vignette.
|
||||
self actor_animate_dynamic_cover( actor, "actor_table_flip", "actor_dynamic_cover_table", "dynamic_cover_table" );
|
||||
|
||||
actor set_closest_node_as_goal( self.end_cover_nodes );
|
||||
|
||||
level notify( "table_flip" );
|
||||
self notify( "table_flip" ); //must be the last line in the script because the script ends on the same endon.
|
||||
}
|
||||
|
||||
monitor_small_table_flip()
|
||||
{
|
||||
self endon( "abort" );
|
||||
assertEx( IsDefined( self.script_noteworthy ), "dynamic_cover prefab at position " + vector_string(self.origin) + " is missing a unique script_noteworthy" );
|
||||
|
||||
self table_flip_params();
|
||||
|
||||
/#
|
||||
self check_for_duplicated_unique_name(); //do a test to verify that each dynamic_cover has been given a unique script_noteworthy.
|
||||
#/
|
||||
|
||||
//disconnected by default. Reconnect and then move the geo out of the way so the player or actors dont collide.
|
||||
self reconnect_paths( self.collision_block );
|
||||
self hide_blocking_geo( self.collision_block );
|
||||
self hide_blocking_geo( self.traversal_block );
|
||||
|
||||
self thread monitor_small_table_flip_triggers();
|
||||
self thread monitor_actor_small_table_flip();
|
||||
|
||||
//wait until the player or an actor flips the table.
|
||||
self waittill( "table_flip" );
|
||||
|
||||
self.dynamic_cover_activated = true;
|
||||
|
||||
//now enable the traversal
|
||||
|
||||
self reconnect_paths( self.init_collision_block );
|
||||
self hide_blocking_geo( self.init_collision_block );
|
||||
self unhide_blocking_geo( self.traversal_block );
|
||||
self reconnect_paths( self.traversal_block );
|
||||
//self hide_blocking_geo( self.traversal_block );
|
||||
self unhide_blocking_geo( self.collision_block );
|
||||
self disconnect_paths( self.collision_block );
|
||||
|
||||
}
|
||||
|
||||
//called on a trigger_use entity.
|
||||
monitor_small_table_flip_triggers()
|
||||
{
|
||||
self endon( "table_flip" );
|
||||
self endon( "dynamic_cover_ai_activate" );
|
||||
|
||||
self SetHintString( &"SCRIPT_HINT_FLIP_TABLE" );
|
||||
self UseTriggerRequireLookAt();
|
||||
self thread monitor_trigger_view_direction( "table_flip" );
|
||||
|
||||
//wait until the player selects to use the table.
|
||||
self waittill( "trigger" );
|
||||
|
||||
self MakeUnusable();
|
||||
|
||||
//lets flip the table!
|
||||
self player_animate_dynamic_cover( "player_small_table_flip", "dynamic_cover_small_table" );
|
||||
|
||||
level notify( "table_flip" );
|
||||
self notify( "table_flip" ); //must be the last line in the script because the script ends on the same endon.
|
||||
}
|
||||
|
||||
monitor_actor_small_table_flip()
|
||||
{
|
||||
self endon( "table_flip" );
|
||||
self endon( "dynamic_cover_player_activate" );
|
||||
|
||||
self waittill( "actor_activate", actor ); //wait until
|
||||
|
||||
self MakeUnusable();
|
||||
|
||||
//play the vignette.
|
||||
self actor_animate_dynamic_cover( actor, "actor_small_table_flip", "actor_dynamic_cover_table", "dynamic_cover_small_table" );
|
||||
|
||||
actor set_closest_node_as_goal( self.end_cover_nodes );
|
||||
|
||||
level notify( "table_flip" );
|
||||
self notify( "table_flip" ); //must be the last line in the script because the script ends on the same endon.
|
||||
}
|
||||
|
||||
table_flip_params()
|
||||
{
|
||||
self.dynamic_cover_root = true;
|
||||
self.dynamic_cover_activated = false;
|
||||
self.script_models = find_entity_by_targetname( "dynamic_cover_table" );
|
||||
self.collision_block = find_entity_by_targetname( "collision_block" );
|
||||
self.init_collision_block = find_entity_by_targetname( "init_collision_block" );
|
||||
self.traversal_block = find_entity_by_targetname( "traversal_block" );
|
||||
self.anim_start = find_first_ent_by_targetname( "anim_start" );
|
||||
self.player_avoid_volume = find_first_ent_by_targetname( "player_avoid_volume" );
|
||||
self.end_cover_nodes = find_nodes_by_targetname( "end_cover" );
|
||||
}
|
||||
|
||||
//external script to trigger flipping of a specific table.
|
||||
actor_table_flip( script_noteworthy )
|
||||
{
|
||||
external_actor_activate( script_noteworthy, "dynamic_cover_table_flip" );
|
||||
}
|
||||
|
||||
//external script to trigger flipping of a specific table.
|
||||
actor_small_table_flip( script_noteworthy )
|
||||
{
|
||||
external_actor_activate( script_noteworthy, "dynamic_cover_small_table_flip" );
|
||||
}
|
||||
|
||||
//a placeholder until there is an animation. Just lerp it to the position we want.
|
||||
placeholder_fake_table_flip()
|
||||
{
|
||||
time = 0.5;
|
||||
|
||||
foreach( table in self.script_models )
|
||||
{
|
||||
table MoveTo( table.origin + (0, -2, 40), time );
|
||||
table RotateTo( (270, 90, 0), time );
|
||||
}
|
||||
|
||||
wait time;
|
||||
|
||||
self notify( "anim_complete");
|
||||
}
|
||||
|
||||
monitor_exam_table_slide( direction )
|
||||
{
|
||||
self endon( "abort" );
|
||||
assertEx( IsDefined( self.script_noteworthy ), "dynamic_cover prefab at position " + vector_string(self.origin) + " is missing a unique script_noteworthy" );
|
||||
|
||||
self complex_dynamic_cover_params();
|
||||
|
||||
/#
|
||||
self check_for_duplicated_unique_name(); //do a test to verify that each dynamic_cover has been given a unique script_noteworthy.
|
||||
#/
|
||||
|
||||
//disconnected by default. Reconnect and then move the geo out of the way so the player or actors dont collide.
|
||||
self reconnect_paths( self.end_collision );
|
||||
self hide_blocking_geo( self.end_collision );
|
||||
|
||||
self thread monitor_exam_table_slide_triggers( direction );
|
||||
self thread monitor_actor_exam_table_slide( direction );
|
||||
|
||||
//wait until the player or an actor flips the table.
|
||||
self waittill( "table_slide" );
|
||||
|
||||
self.dynamic_cover_activated = true;
|
||||
|
||||
//now enable the traversal and the cover nodes.
|
||||
self reconnect_paths( self.start_collision );
|
||||
self hide_blocking_geo( self.start_collision );
|
||||
self unhide_blocking_geo( self.end_collision );
|
||||
self disconnect_paths( self.end_collision );
|
||||
|
||||
}
|
||||
|
||||
monitor_exam_table_slide_triggers( direction )
|
||||
{
|
||||
self endon( "table_slide" );
|
||||
self endon( "dynamic_cover_ai_activate" );
|
||||
|
||||
self SetHintString( &"SCRIPT_HINT_SLIDE_TABLE" );
|
||||
self UseTriggerRequireLookAt();
|
||||
self thread monitor_trigger_view_direction( "table_slide" );
|
||||
|
||||
//wait until the player selects to use the table.
|
||||
self waittill( "trigger" );
|
||||
|
||||
self MakeUnusable();
|
||||
|
||||
//lets slide the table!
|
||||
self player_animate_dynamic_cover( "player_table_slide_" + direction, "dynamic_cover_exam_table" );
|
||||
//self placeholder_fake_table_slide( );
|
||||
|
||||
level notify( "table_slide" );
|
||||
self notify( "table_slide" ); //must be the last line in the script because the script ends on the same endon.
|
||||
}
|
||||
|
||||
monitor_actor_exam_table_slide( direction )
|
||||
{
|
||||
self endon( "table_slide" );
|
||||
self endon( "dynamic_cover_player_activate" );
|
||||
|
||||
self waittill( "actor_activate", actor ); //wait until
|
||||
|
||||
self MakeUnusable();
|
||||
|
||||
//play the vignette.
|
||||
self actor_animate_dynamic_cover( actor, "actor_table_slide_" + direction, "actor_dynamic_cover_table", "dynamic_cover_exam_table" );
|
||||
|
||||
actor set_closest_node_as_goal( self.end_cover_nodes );
|
||||
|
||||
level notify( "table_slide" );
|
||||
self notify( "table_slide" ); //must be the last line in the script because the script ends on the same endon.
|
||||
}
|
||||
|
||||
//external script to trigger flipping of a specific table.
|
||||
actor_exam_table_slide( script_noteworthy )
|
||||
{
|
||||
external_actor_activate( script_noteworthy, "dynamic_cover_slide_exam_table_left", "dynamic_cover_slide_exam_table_right" );
|
||||
}
|
||||
|
||||
placeholder_fake_table_slide( )
|
||||
{
|
||||
time = 0.5;
|
||||
|
||||
foreach( table in self.script_models )
|
||||
{
|
||||
offset = -76 * VectorNormalize(AnglesToRight( table.angles ));
|
||||
table MoveTo( table.origin + offset, time );
|
||||
}
|
||||
|
||||
wait time;
|
||||
|
||||
self notify( "anim_complete");
|
||||
}
|
||||
|
||||
monitor_vending_machine_tip( direction )
|
||||
{
|
||||
self endon( "abort" );
|
||||
assertEx( IsDefined( self.script_noteworthy ), "dynamic_cover prefab at position " + vector_string(self.origin) + " is missing a unique script_noteworthy" );
|
||||
|
||||
self complex_dynamic_cover_params();
|
||||
|
||||
/#
|
||||
self check_for_duplicated_unique_name(); //do a test to verify that each dynamic_cover has been given a unique script_noteworthy.
|
||||
#/
|
||||
|
||||
//disconnected by default. Reconnect and then move the geo out of the way so the player or actors dont collide.
|
||||
self reconnect_paths( self.end_collision );
|
||||
self hide_blocking_geo( self.end_collision );
|
||||
self hide_blocking_geo( self.end_cover );
|
||||
self reconnect_paths( self.start_cover );
|
||||
self hide_blocking_geo( self.start_cover );
|
||||
|
||||
self thread monitor_vending_machine_tip_triggers( direction );
|
||||
self thread monitor_vending_machine_tip_actor( direction );
|
||||
|
||||
//wait until the player or an actor flips the table.
|
||||
self waittill( "dynamic_cover_activate" );
|
||||
|
||||
self.dynamic_cover_activated = true;
|
||||
|
||||
//now enable the traversal and the cover nodes.
|
||||
self reconnect_paths( self.start_collision );
|
||||
self hide_blocking_geo( self.start_collision );
|
||||
self unhide_blocking_geo( self.end_collision );
|
||||
self disconnect_paths( self.end_collision );
|
||||
|
||||
//enable the nodes.
|
||||
self unhide_blocking_geo( self.end_cover );
|
||||
self reconnect_paths( self.end_cover );
|
||||
self hide_blocking_geo( self.end_cover );
|
||||
|
||||
//disable the starting cover.
|
||||
self unhide_blocking_geo( self.start_cover );
|
||||
self disconnect_paths( self.start_cover );
|
||||
self hide_blocking_geo( self.start_cover );
|
||||
}
|
||||
|
||||
monitor_vending_machine_tip_triggers( direction )
|
||||
{
|
||||
self endon( "dynamic_cover_activate" );
|
||||
self endon( "dynamic_cover_ai_activate" );
|
||||
|
||||
self SetHintString( &"SCRIPT_HINT_VENDING_MACHINE_TIP" );
|
||||
self UseTriggerRequireLookAt();
|
||||
self thread monitor_trigger_view_direction( "dynamic_cover_activate" );
|
||||
|
||||
//wait until the player selects to use the table.
|
||||
self waittill( "trigger" );
|
||||
|
||||
self MakeUnusable();
|
||||
|
||||
//lets slide the table!
|
||||
level._player playsound( "scn_hospital_vending_push_plr" );
|
||||
self player_animate_dynamic_cover( "player_vend_mach_" + direction, "dynamic_cover_vend_mach" );
|
||||
//self placeholder_fake_vending_machine_tip( direction );
|
||||
|
||||
level notify( "dynamic_cover_activate" );
|
||||
self notify( "dynamic_cover_activate" ); //must be the last line in the script because the script ends on the same endon.
|
||||
}
|
||||
|
||||
monitor_vending_machine_tip_actor( direction )
|
||||
{
|
||||
self endon( "dynamic_cover_activate" );
|
||||
self endon( "dynamic_cover_player_activate" );
|
||||
|
||||
self waittill( "actor_activate", actor ); //wait until
|
||||
|
||||
self MakeUnusable();
|
||||
|
||||
//play the vignette.
|
||||
self actor_animate_dynamic_cover( actor, "actor_vend_mach_" + direction, "actor_dynamic_cover_table", "dynamic_cover_vend_mach" );
|
||||
//self placeholder_fake_vending_machine_tip( direction );
|
||||
|
||||
actor set_closest_node_as_goal( self.end_cover_nodes );
|
||||
|
||||
level notify( "dynamic_cover_activate" );
|
||||
self notify( "dynamic_cover_activate" ); //must be the last line in the script because the script ends on the same endon.
|
||||
}
|
||||
|
||||
//external script to trigger flipping of a specific table.
|
||||
actor_vending_machine_tip( script_noteworthy )
|
||||
{
|
||||
external_actor_activate( script_noteworthy, "dynamic_cover_vending_machine_tip_left", "dynamic_cover_vending_machine_tip_right" );
|
||||
}
|
||||
|
||||
placeholder_fake_vending_machine_tip( direction )
|
||||
{
|
||||
time = 0.5;
|
||||
|
||||
foreach( table in self.script_models )
|
||||
{
|
||||
offset = (-20 * VectorNormalize(AnglesToForward( table.angles ))) + ( 0, 0, 20 );
|
||||
pitch = 90;
|
||||
if( direction == "left" )
|
||||
{
|
||||
pitch = -1 * pitch;
|
||||
}
|
||||
table MoveTo( table.origin + offset, time );
|
||||
table RotatePitch( -90, time );
|
||||
}
|
||||
|
||||
wait time;
|
||||
|
||||
self notify( "anim_complete");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//Some Utility scripts.
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
complex_dynamic_cover_params()
|
||||
{
|
||||
self.dynamic_cover_root = true;
|
||||
self.dynamic_cover_activated = false;
|
||||
self.script_models = find_entity_by_targetname( "dynamic_cover_model" );
|
||||
self.anim_start = find_first_ent_by_targetname( "anim_start" );
|
||||
self.end_cover_nodes = find_nodes_by_targetname( "end_cover" );
|
||||
self.start_collision = find_entity_by_targetname( "start_position" );
|
||||
self.end_collision = find_entity_by_targetname( "end_position" );
|
||||
self.end_cover = find_entity_by_targetname( "end_cover_brush" );
|
||||
self.start_cover = find_entity_by_targetname( "start_cover_brush" );
|
||||
self.player_avoid_volume = find_first_ent_by_targetname( "player_avoid_volume" );
|
||||
}
|
||||
|
||||
external_actor_activate( script_noteworthy, targetname_1, targetname_2 )
|
||||
{
|
||||
if( IsDefined( targetname_1 ) )
|
||||
{
|
||||
target_1_triggers = GetEntArray( targetname_1, "targetname" );
|
||||
foreach ( trigger in target_1_triggers )
|
||||
{
|
||||
if( trigger.script_noteworthy == script_noteworthy ) //find the match.
|
||||
{
|
||||
trigger notify( "actor_activate", self );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( IsDefined( targetname_2 ) )
|
||||
{
|
||||
//if it wasn't a left, check if its a right.
|
||||
target_2_triggers = GetEntArray( targetname_2, "targetname" );
|
||||
foreach ( trigger in target_2_triggers )
|
||||
{
|
||||
if( trigger.script_noteworthy == script_noteworthy ) //find the match.
|
||||
{
|
||||
trigger notify( "actor_activate", self );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assertex( false, "unable to match script_noteworthy" );
|
||||
}
|
||||
|
||||
monitor_trigger_view_direction( endon_condition )
|
||||
{
|
||||
self monitor_trigger_view_direction_internal( endon_condition ) ;
|
||||
self MakeUnusable();
|
||||
}
|
||||
|
||||
MIN_FOV_DOT = 0.90;
|
||||
monitor_trigger_view_direction_internal( endon_condition )
|
||||
{
|
||||
self endon( endon_condition );
|
||||
self endon( "trigger" );
|
||||
self endon( "dynamic_cover_player_activate" );
|
||||
self endon( "dynamic_cover_ai_activate" );
|
||||
|
||||
if( IsDefined( self.target ) )
|
||||
{
|
||||
target = GetEnt( self.target, "targetname" );
|
||||
vector = target.origin - self.origin;
|
||||
while( true )
|
||||
{
|
||||
if( VectorDot( AnglesToForward( level._player.angles ), vector ) < MIN_FOV_DOT )
|
||||
{
|
||||
self MakeUnusable();
|
||||
}
|
||||
else
|
||||
{
|
||||
self MakeUsable();
|
||||
}
|
||||
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#using_animtree( "script_model" );
|
||||
player_animate_dynamic_cover( scene, prop_name )
|
||||
{
|
||||
self notify( "dynamic_cover_player_activate" );
|
||||
|
||||
player_rig = spawn_anim_model( "player_hands" );
|
||||
player_rig Hide();
|
||||
guys = [ player_rig ];
|
||||
|
||||
foreach( model in self.script_models )
|
||||
{
|
||||
model.animname = prop_name;
|
||||
model UseAnimTree( level._scr_animtree[ model.animname ] );
|
||||
guys = array_add( guys, model);
|
||||
}
|
||||
|
||||
//restrict player actions and disable the weapon.
|
||||
level._player DisableWeapons();
|
||||
|
||||
// Check for crouch version.
|
||||
if ( IsDefined( level._scr_player_anim_crouch[ scene ]) && level._scr_player_anim_crouch[ scene ] == true )
|
||||
{
|
||||
// tagBK<NOTE> Delay crouch transition until blend is started.
|
||||
level._player thread set_dynamic_cover_crouch();
|
||||
}
|
||||
else
|
||||
{
|
||||
level._player SetStance( "stand" );
|
||||
level._player AllowCrouch( false );
|
||||
}
|
||||
|
||||
level._player AllowProne( false );
|
||||
level._player EnableInvulnerability();
|
||||
|
||||
level._player PlayerLinkToBlend( player_rig, "tag_player", 0.2, 0.1, 0.1 );
|
||||
player_rig delayCall( 0.2, ::Show );
|
||||
|
||||
self.anim_start anim_single( guys, scene );
|
||||
|
||||
level._player Unlink();
|
||||
|
||||
//get rid of the hands, we're done.
|
||||
player_rig delete( );
|
||||
|
||||
//re-enable the weapon so the player can fire, and
|
||||
level._player EnableWeapons();
|
||||
|
||||
level._player AllowStand( true );
|
||||
level._player AllowCrouch( true );
|
||||
level._player AllowProne( true );
|
||||
level._player DisableInvulnerability();
|
||||
}
|
||||
|
||||
set_dynamic_cover_crouch()
|
||||
{
|
||||
wait( 0.1 );
|
||||
self SetStance( "crouch" );
|
||||
self AllowStand( false );
|
||||
}
|
||||
|
||||
//called on the anim start node.
|
||||
actor_animate_dynamic_cover( actor, scene, actor_anim, prop_name )
|
||||
{
|
||||
old_animname = actor.animname;
|
||||
actor.animname = actor_anim;
|
||||
guys = [ actor ];
|
||||
|
||||
foreach( model in self.script_models )
|
||||
{
|
||||
model.animname = prop_name;
|
||||
model UseAnimTree( level._scr_animtree[ model.animname ] );
|
||||
guys = array_add( guys, model);
|
||||
}
|
||||
|
||||
self thread restore_actor_params( actor, actor get_force_color(), old_animname );
|
||||
|
||||
self.anim_start anim_reach_solo( actor, scene );
|
||||
|
||||
while( true )
|
||||
{
|
||||
//don't flip the table if the actor is no longer alive.
|
||||
if( !IsAlive( actor ) )
|
||||
{
|
||||
self notify( "abort" );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !(IsDefined(self.player_avoid_volume) && level._player IsTouching(self.player_avoid_volume)) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
wait 0.05;
|
||||
}
|
||||
|
||||
|
||||
self notify ( "dynamic_cover_ai_activate" );
|
||||
|
||||
actor playsound( "scn_hospital_vending_push" );
|
||||
self.anim_start thread anim_single( guys, scene );
|
||||
|
||||
self notify ( "dynamic_cover_ai_activate_anim_finished" );
|
||||
}
|
||||
|
||||
restore_actor_params( actor, force_color, animname )
|
||||
{
|
||||
//either the animation completed, or the whole thing was bailed on, either way restore the color and animname.
|
||||
self waittill_any( "dynamic_cover_ai_activate_anim_finished", "dynamic_cover_activate", "dynamic_cover_player_activate", "abort" );
|
||||
|
||||
if( IsDefined( force_color ) )
|
||||
{
|
||||
actor set_force_color( force_color );
|
||||
actor enable_ai_color();
|
||||
}
|
||||
|
||||
actor.animname = animname;
|
||||
}
|
||||
|
||||
reconnect_paths( blocking_geo )
|
||||
{
|
||||
foreach( block in blocking_geo )
|
||||
{
|
||||
block ConnectPaths();
|
||||
}
|
||||
}
|
||||
|
||||
disconnect_paths( blocking_geo )
|
||||
{
|
||||
foreach( block in blocking_geo )
|
||||
{
|
||||
block DisconnectPaths();
|
||||
}
|
||||
}
|
||||
|
||||
hide_blocking_geo( blocking_geo )
|
||||
{
|
||||
foreach( block in blocking_geo )
|
||||
{
|
||||
block.orig_origin = block.origin;
|
||||
block.origin = (0,0,-100000);
|
||||
}
|
||||
}
|
||||
|
||||
unhide_blocking_geo( blocking_geo )
|
||||
{
|
||||
foreach( block in blocking_geo )
|
||||
{
|
||||
block.origin = block.orig_origin;
|
||||
}
|
||||
}
|
||||
|
||||
find_entity_by_targetname( targetname )
|
||||
{
|
||||
ents = [];
|
||||
found_ents = GetEntArray( targetname, "targetname");
|
||||
foreach( ent in found_ents )
|
||||
{
|
||||
if( IsDefined( ent.script_noteworthy ) && ent.script_noteworthy == self.script_noteworthy )
|
||||
{
|
||||
ents = array_add( ents, ent );
|
||||
}
|
||||
}
|
||||
|
||||
return ents;
|
||||
}
|
||||
|
||||
find_nodes_by_targetname( targetname )
|
||||
{
|
||||
nodes = [];
|
||||
found_nodes = GetNodeArray( targetname, "targetname");
|
||||
foreach( node in found_nodes )
|
||||
{
|
||||
if( IsDefined( node.script_noteworthy ) && node.script_noteworthy == self.script_noteworthy )
|
||||
{
|
||||
nodes = array_add( nodes, node );
|
||||
}
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
find_first_ent_by_targetname( targetname )
|
||||
{
|
||||
found_ents = GetEntArray( targetname, "targetname");
|
||||
foreach( ent in found_ents )
|
||||
{
|
||||
if( IsDefined( ent.script_noteworthy ) && ent.script_noteworthy == self.script_noteworthy )
|
||||
{
|
||||
return ent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dynamic_cover_activated( script_noteworthy )
|
||||
{
|
||||
cover_parts = GetEntArray( script_noteworthy, "script_noteworthy" );
|
||||
foreach ( part in cover_parts )
|
||||
{
|
||||
if( IsDefined( part.dynamic_cover_root ) && part.dynamic_cover_root == true ) //find the dynamic cover root trigger.
|
||||
{
|
||||
assert( IsDefined( part.dynamic_cover_activated ) );
|
||||
return part.dynamic_cover_activated;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//called on actor.
|
||||
set_closest_node_as_goal( nodes )
|
||||
{
|
||||
Assert( IsDefined( nodes ) && nodes.size > 0 );
|
||||
closest_dist = 100000;
|
||||
closest_node = undefined;
|
||||
foreach ( node in nodes )
|
||||
{
|
||||
dist = Distance( node.origin, self.origin );
|
||||
if ( dist < closest_dist )
|
||||
{
|
||||
closest_dist = dist;
|
||||
closest_node = node;
|
||||
}
|
||||
}
|
||||
|
||||
if( IsDefined( closest_node ) )
|
||||
{
|
||||
self SetGoalNode( closest_node );
|
||||
}
|
||||
}
|
||||
|
||||
//it would to do a check to verify that each dynamic cover instance has a unique script_noteworthy.
|
||||
//this needs to be done so that only the items within this prefab are effected.
|
||||
//called on this instance's trigger_use.
|
||||
/#
|
||||
check_for_duplicated_unique_name()
|
||||
{
|
||||
ents = GetEntArray( self.script_noteworthy, "script_noteworthy" );
|
||||
|
||||
num_use_triggers = 0;
|
||||
foreach( ent in ents )
|
||||
{
|
||||
if( ent.classname == "trigger_use" )
|
||||
num_use_triggers++;
|
||||
}
|
||||
|
||||
assertEx( num_use_triggers <= 1, "script_noteworthy " + self.script_noteworthy + " used by more than one dynamic_cover prefab" );
|
||||
}
|
||||
#/
|
||||
|
||||
DynamicCover_rumble_heavy( player_rig )
|
||||
{
|
||||
//iprintln("rumble");
|
||||
level._player PlayRumbleOnEntity( "viewmodel_large" );
|
||||
}
|
||||
|
||||
DynamicCover_rumble_medium( player_rig )
|
||||
{
|
||||
level._player PlayRumbleOnEntity( "viewmodel_medium" );
|
||||
}
|
||||
|
||||
DynamicCover_rumble_light( player_rig )
|
||||
{
|
||||
level._player PlayRumbleOnEntity( "viewmodel_small" );
|
||||
}
|
283
maps/_ec_lunar_turret.gsc
Normal file
283
maps/_ec_lunar_turret.gsc
Normal file
@ -0,0 +1,283 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
//call after _load::main()
|
||||
main()
|
||||
{
|
||||
turret_vehicle_anims();
|
||||
|
||||
//not sure how I feel about basing this off of the model name. It's more automatic
|
||||
//than leaving a special targetname or script_noteworthy which might be needed for
|
||||
//something else, but is easier to break;
|
||||
turrets = getEntArray( "misc_turret", "code_classname" );
|
||||
array_thread( turrets, ::animate_player_hands );
|
||||
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
turret_vehicle_anims()
|
||||
{
|
||||
//animation of the hands on the turret.
|
||||
level._scr_animtree[ "lunar_hands" ] = #animtree;
|
||||
level._scr_model[ "lunar_hands" ] = "viewhands_us_lunar_scripted";
|
||||
level._scr_anim[ "lunar_hands" ][ "idle_L" ] = %player_chinese_lgv_turret_idle_L;
|
||||
level._scr_anim[ "lunar_hands" ][ "idle_R" ] = %player_chinese_lgv_turret_idle_R;
|
||||
level._scr_anim[ "lunar_hands" ][ "idle2fire_L" ] = %player_chinese_lgv_turret_idle2fire_L;
|
||||
level._scr_anim[ "lunar_hands" ][ "idle2fire_R" ] = %player_chinese_lgv_turret_idle2fire_R;
|
||||
level._scr_anim[ "lunar_hands" ][ "fire2idle_L" ] = %player_chinese_lgv_turret_fire2idle_L;
|
||||
level._scr_anim[ "lunar_hands" ][ "fire2idle_R" ] = %player_chinese_lgv_turret_fire2idle_R;
|
||||
level._scr_anim[ "lunar_hands" ][ "patch_R" ] = %player_chinese_lgv_turret_suitshield_inject_R;
|
||||
level._scr_anim[ "lunar_hands" ][ "patch_L" ] = %player_chinese_lgv_turret_suitshield_inject_L;
|
||||
level._scr_anim[ "lunar_hands" ][ "react_R" ] = %player_chinese_lgv_turret_reaction_R;
|
||||
level._scr_anim[ "lunar_hands" ][ "react_L" ] = %player_chinese_lgv_turret_reaction_L;
|
||||
level._scr_anim[ "lunar_hands" ][ "react_turret" ] = %nx_chinese_lgv_turret_reaction;
|
||||
}
|
||||
|
||||
|
||||
//called on a turret
|
||||
animate_player_hands()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
//oh my this is uggly, but the hand animations were written to work specifically with this model
|
||||
//so lets only do this script if that's the case.
|
||||
if( self.model != "nx_vehicle_chinese_lgv_main_turret" )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//got to wait until it's used.
|
||||
mounted = false;
|
||||
while ( true )
|
||||
{
|
||||
if ( IsTurretPlayerControlled( self ) )
|
||||
{
|
||||
if( !mounted )
|
||||
{
|
||||
self.animname = "lunar_hands";
|
||||
self useAnimTree( level._scr_animtree[ self.animname ] );
|
||||
self Attach( level._scr_model[ self.animname ] , "tag_player" );
|
||||
self SetAnim( level._scr_anim[ self.animname ][ "idle_L" ] , 1, 0, 1 );
|
||||
self SetAnim( level._scr_anim[ self.animname ][ "idle_R" ] , 1, 0, 1 );
|
||||
|
||||
self thread turret_player_viewhands_hand( "LEFT" );
|
||||
self thread turret_player_viewhands_hand( "RIGHT" );
|
||||
self thread turret_player_viewhands_patch();
|
||||
}
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( mounted )
|
||||
{
|
||||
self Detach( level._scr_model[ self.animname ], "tag_player" );
|
||||
self notify( "dismount" );
|
||||
}
|
||||
|
||||
mounted = false;
|
||||
}
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
turret_player_viewhands_hand( hand )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "patching" );
|
||||
self endon( "dismount" );
|
||||
self endon( "reacting" );
|
||||
|
||||
checkFunc = undefined;
|
||||
if ( hand == "LEFT" )
|
||||
{
|
||||
checkFunc = ::turret_ads_button_pressed;
|
||||
}
|
||||
else if ( hand == "RIGHT" )
|
||||
{
|
||||
checkFunc = ::turret_fire_button_pressed;
|
||||
}
|
||||
assert( isdefined( checkFunc ) );
|
||||
|
||||
while( true )
|
||||
{
|
||||
if( level._player [[checkFunc]]() )
|
||||
{
|
||||
thread turret_player_viewhands_presed( hand );
|
||||
while( level._player [[checkFunc]]() )
|
||||
{
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
thread turret_player_viewhands_idle( hand );
|
||||
while( !level._player [[checkFunc]]() )
|
||||
{
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
turret_ads_button_pressed()
|
||||
{
|
||||
if ( level._player AdsButtonPressed() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ( level._player AttackButtonPressed() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
turret_fire_button_pressed()
|
||||
{
|
||||
return level._player AttackButtonPressed();
|
||||
}
|
||||
|
||||
turret_player_viewhands_idle( hand )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "dismount" );
|
||||
|
||||
animHand = undefined;
|
||||
if ( hand == "LEFT" )
|
||||
{
|
||||
animHand = "L";
|
||||
}
|
||||
else if ( hand == "RIGHT" )
|
||||
{
|
||||
animHand = "R";
|
||||
}
|
||||
assert( isdefined( animHand ) );
|
||||
|
||||
self.animname = "lunar_hands";
|
||||
self useAnimTree( level._scr_animtree[ self.animname ] );
|
||||
|
||||
self clearAnim( self getanim( "idle2fire_" + animHand ), 0.2 );
|
||||
self setFlaggedAnimRestart( "anim", self getanim( "fire2idle_" + animHand ) );
|
||||
self waittillmatch( "anim", "end" );
|
||||
self clearAnim( self getanim( "fire2idle_" + animHand ), 0.2 );
|
||||
self setAnim( self getanim( "idle_" + animHand ) );
|
||||
}
|
||||
|
||||
turret_player_viewhands_presed( hand )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "dismount" );
|
||||
|
||||
animHand = undefined;
|
||||
if ( hand == "LEFT" )
|
||||
{
|
||||
animHand = "L";
|
||||
}
|
||||
else if ( hand == "RIGHT" )
|
||||
{
|
||||
animHand = "R";
|
||||
}
|
||||
assert( isdefined( animHand ) );
|
||||
|
||||
self.animname = "lunar_hands";
|
||||
self useAnimTree( level._scr_animtree[ self.animname ] );
|
||||
|
||||
self clearAnim( self getanim( "idle_" + animHand ), 0.1 ); //made it twice faster
|
||||
self setAnim( self getanim( "idle2fire_" + animHand ) );
|
||||
}
|
||||
|
||||
//fairly analogous to _suitsheild::suit_shield_use_watch()
|
||||
turret_player_viewhands_patch()
|
||||
{
|
||||
self endon("death");
|
||||
self endon( "dismount" );
|
||||
self endon( "reacting" );
|
||||
|
||||
//level._player EnableActionSlot( 4, true );
|
||||
|
||||
patching = false;
|
||||
|
||||
while ( true )
|
||||
{
|
||||
wait 0.05;
|
||||
|
||||
if( ! level._player IsSuitShieldEnabled() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//if the button is pressed and not already patching...
|
||||
if( level._player SuitShieldButtonPressed() && !patching )
|
||||
{
|
||||
//see if we meet the conditions for actually patching.
|
||||
if ( ((level._player GetSuitShieldHealth() >= Int(GetDvar("player_suitshield_max_health")))
|
||||
|| (0 == level._player GetAmmoCount( "nx_suitshield" )))
|
||||
&& !IsGodMode( level._player ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//lock out additional patching and stop idle watching scripts.
|
||||
patching = true;
|
||||
self notify( "patching" );
|
||||
level._player FreezeControls( true );
|
||||
|
||||
//blend in the patch animation.
|
||||
self SetFlaggedAnimKnobRestart( "patch", self getanim( "patch_R" ), 1, 0.2, 1 );
|
||||
self SetFlaggedAnimKnobRestart( "patch", self getanim( "patch_L" ), 1, 0.2, 1 );
|
||||
|
||||
//wait for partway through the animation to reward the patch success.
|
||||
wait Float(GetDvar("suit_shield_patch_wait"));
|
||||
|
||||
//award health and subtract the ammo.
|
||||
level._player SetSuitShieldHealth( Int(GetDvar("player_suitshield_max_health")) );
|
||||
level._player SetWeaponAmmoClip( "nx_suitshield", level._player GetWeaponAmmoClip( "nx_suitshield" ) - 1 );
|
||||
level._player notify("suit_repaired");
|
||||
|
||||
//wait for the animation to finish.
|
||||
self waittillmatch( "patch", "end" );
|
||||
self clearAnim( self getanim( "patch_R" ), 0.2 );
|
||||
self clearAnim( self getanim( "patch_L" ), 0.2 );
|
||||
|
||||
//restart the idle scripts.
|
||||
self thread turret_player_viewhands_hand( "LEFT" );
|
||||
self thread turret_player_viewhands_hand( "RIGHT" );
|
||||
|
||||
//release control and let patching be able to be used some more.
|
||||
level._player FreezeControls( false );
|
||||
patching = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//play a react anim that interupts the current hand anims.
|
||||
turret_player_viewhands_react( look_at_ent_name )
|
||||
{
|
||||
self endon("death");
|
||||
self endon( "dismount" );
|
||||
|
||||
self notify( "reacting" );
|
||||
level._player FreezeControls( true );
|
||||
look_at_ent = GetEnt( look_at_ent_name, "targetname" );
|
||||
level._player TurnToFaceTarget( look_at_ent.origin, 3.0, 1.0 );
|
||||
|
||||
//blend in the react animation.
|
||||
self SetAnimKnobRestart( self getanim( "react_turret" ), 1, 0.2, 1 );
|
||||
self SetFlaggedAnimKnobRestart( "react", self getanim( "react_R" ), 1, 0.2, 1 );
|
||||
self SetFlaggedAnimKnobRestart( "react", self getanim( "react_L" ), 1, 0.2, 1 );
|
||||
|
||||
//wait for the animation to finish.
|
||||
self waittillmatch( "react", "end" );
|
||||
self clearAnim( self getanim( "react_turret" ), 0.2 );
|
||||
self clearAnim( self getanim( "react_R" ), 0.2 );
|
||||
self clearAnim( self getanim( "react_L" ), 0.2 );
|
||||
|
||||
//restart the idle scripts.
|
||||
self thread turret_player_viewhands_hand( "LEFT" );
|
||||
self thread turret_player_viewhands_hand( "RIGHT" );
|
||||
self thread turret_player_viewhands_patch();
|
||||
|
||||
//release control
|
||||
level._player FreezeControls( false );
|
||||
}
|
12
maps/_empty.gsc
Normal file
12
maps/_empty.gsc
Normal file
@ -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"
|
||||
*/
|
||||
|
1064
maps/_endmission.gsc
Normal file
1064
maps/_endmission.gsc
Normal file
File diff suppressed because it is too large
Load Diff
2052
maps/_equalizer.gsc
Normal file
2052
maps/_equalizer.gsc
Normal file
File diff suppressed because it is too large
Load Diff
102
maps/_escalator.gsc
Normal file
102
maps/_escalator.gsc
Normal file
@ -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
maps/_f15.gsc
Normal file
330
maps/_f15.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_f15::main( "vehicle_f15" );
|
||||
|
||||
|
||||
include,vehicle_f15
|
||||
sound,vehicle_f15,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_f15"
|
||||
default:"vehicletype" "f15"
|
||||
default:"script_team" "allies"
|
||||
*/
|
64
maps/_firetruck.gsc
Normal file
64
maps/_firetruck.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_firetruck::main( "vehicle_firetruck" );
|
||||
|
||||
|
||||
include,vehicle_firetruck
|
||||
sound,vehicle_firetruck,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_firetruck"
|
||||
default:"vehicletype" "firetruck"
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
251
maps/_flare.gsc
Normal file
251
maps/_flare.gsc
Normal file
@ -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" );
|
||||
}
|
7
maps/_flashbang.gsc
Normal file
7
maps/_flashbang.gsc
Normal file
@ -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
maps/_float.gsc
Normal file
105
maps/_float.gsc
Normal file
@ -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;
|
||||
}
|
370
maps/_friendlyfire.gsc
Normal file
370
maps/_friendlyfire.gsc
Normal file
@ -0,0 +1,370 @@
|
||||
// 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;
|
||||
}
|
||||
else if (( IsDefined( attacker.code_classname )) && ( attacker.code_classname == "misc_turret" ))
|
||||
{
|
||||
owner = attacker GetSentryOwner();
|
||||
//tagJW<NOTE>: Make sure turret is on the right team before applying friendly fire damage
|
||||
if (( IsDefined( owner )) && ( IsPlayer( owner )) && attacker.script_team == "allies" )
|
||||
{
|
||||
bPlayersDamage = true;
|
||||
if (( IsDefined( owner._in_ugv_vision )) && ( owner._in_ugv_vision == "inactive" ))
|
||||
{
|
||||
bPlayersDamage = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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
maps/_fx.gsc
Normal file
259
maps/_fx.gsc
Normal file
@ -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( "sound_emitter", ( 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( "sound_emitter", ( 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;
|
||||
}
|
||||
}
|
||||
}
|
3146
maps/_gameskill.gsc
Normal file
3146
maps/_gameskill.gsc
Normal file
File diff suppressed because it is too large
Load Diff
65
maps/_gauntlet.gsc
Normal file
65
maps/_gauntlet.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_gauntlet::main( "vehicle_sa15_gauntlet" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
185
maps/_global_fx.gsc
Normal file
185
maps/_global_fx.gsc
Normal file
@ -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
maps/_guide.gsc
Normal file
103
maps/_guide.gsc
Normal file
@ -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;
|
||||
}
|
||||
}
|
38
maps/_hand_signals.gsc
Normal file
38
maps/_hand_signals.gsc
Normal file
@ -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
|
||||
}
|
127
maps/_harrier.gsc
Normal file
127
maps/_harrier.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_harrier::main( "vehicle_av8b_harrier_jet" );
|
||||
|
||||
|
||||
include,vehicle_harrier
|
||||
sound,vehicle_harrier,vehicle_standard,all_sp
|
||||
|
||||
|
||||
defaultmdl="vehicle_av8b_harrier_jet"
|
||||
default:"vehicletype" "harrier"
|
||||
default:"script_team" "allies"
|
||||
*/
|
247
maps/_heli_ride.gsc
Normal file
247
maps/_heli_ride.gsc
Normal file
@ -0,0 +1,247 @@
|
||||
#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
|
||||
if( !isDefined( level.heli_ride_no_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 playerlinktodelta( 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();
|
||||
if( !isDefined( level.heli_ride_no_invlun ) )
|
||||
{
|
||||
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;
|
||||
|
||||
}
|
307
maps/_helicopter_ai.gsc
Normal file
307
maps/_helicopter_ai.gsc
Normal file
@ -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();
|
||||
}
|
594
maps/_helicopter_globals.gsc
Normal file
594
maps/_helicopter_globals.gsc
Normal file
@ -0,0 +1,594 @@
|
||||
#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 );
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
get_potential_enemy_targets( 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;
|
||||
|
||||
eTargets = [];
|
||||
|
||||
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++ )
|
||||
{
|
||||
if ( IsDefined( level._vehicles[enemyTeam][i].ignoreme ) && level._vehicles[enemyTeam][i].ignoreme )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
possibleTargets[ possibleTargets.size ] = level._vehicles[ enemyTeam ][ i ];
|
||||
}
|
||||
}
|
||||
|
||||
if ( getAITargets )
|
||||
{
|
||||
enemyAI = getaiarray( enemyTeam );
|
||||
for ( i = 0 ; i < enemyAI.size ; i++ )
|
||||
{
|
||||
if ( !IsAlive( enemyAI[i] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( isdefined( enemyAI[ i ].ignored_by_attack_heli ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( IsDefined( enemyAI[i].ignoreme ) && enemyAI[i].ignoreme )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
possibleTargets[ possibleTargets.size ] = enemyAI[ i ];
|
||||
}
|
||||
|
||||
if ( enemyTeam == "allies" )
|
||||
{
|
||||
for ( i = 0; i < level._players.size; i++ )
|
||||
{
|
||||
if ( IsDefined( level._players[i].ignoreme ) && level._players[i].ignoreme )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
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 ];
|
||||
}
|
||||
|
||||
return eTargets;
|
||||
}
|
||||
|
||||
getEnemyTarget( fRadius, iFOVcos, getAITargets, doSightTrace, getVehicleTargets, randomizeTargetArray, aExcluders )
|
||||
{
|
||||
eTargets = self get_potential_enemy_targets( fRadius, iFOVcos, getAITargets, doSightTrace, getVehicleTargets, randomizeTargetArray, aExcluders );
|
||||
//prof_end( "cobrapilot_ai" );
|
||||
|
||||
self notify( "gunner_new_target" );
|
||||
|
||||
// return if no targets were found
|
||||
if ( eTargets.size == 0 )
|
||||
return undefined;
|
||||
|
||||
// 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 )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "delete" );
|
||||
|
||||
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();
|
||||
}
|
896
maps/_helicopter_support.gsc
Normal file
896
maps/_helicopter_support.gsc
Normal file
@ -0,0 +1,896 @@
|
||||
//****************************************************************************
|
||||
// **
|
||||
// Confidential - (C) Activision Publishing, Inc. 2010 **
|
||||
// **
|
||||
//****************************************************************************
|
||||
// **
|
||||
// Module: Utility file for helicopter support **
|
||||
// **
|
||||
// Created: 11.15.2011 - Feldman & Chen **
|
||||
// **
|
||||
//****************************************************************************
|
||||
|
||||
#include common_scripts\utility;
|
||||
#include maps\_hud_util;
|
||||
#include maps\_utility;
|
||||
#include maps\_vehicle;
|
||||
#include maps\_nx_utility;
|
||||
#include maps\_anim;
|
||||
|
||||
AIRDROP_MARKER_WEAPON = "airdrop_marker"; //This weapon need to be added to the helicopter_support.csv
|
||||
VEHICLE_TARGETNAME = "intro_chopper_formation_2";
|
||||
ACTOR_TARGETNAME = "heli_support_guys";
|
||||
DPAD_ICON = "hud_us_smokegrenade";
|
||||
MESSAGE_TIME = 3.0; //The amount of time (in second) helicopter support related messages will remain on player's screen
|
||||
HINT_STRING_TIMEOUT = 5.0;
|
||||
TRIGGER_ON_TARGETNAME = "helicopter_support_on";
|
||||
TRIGGER_OFF_TARGETNAME = "helicopter_support_off";
|
||||
DEFAULT_PATH_TARGETNAME = "path3_1";
|
||||
PLAYER_NOTIFY_HELI_SUPPORT_ACTIVE = "heli_support_active";
|
||||
PLAYER_NOTIFY_HELI_SUPPORT_INACTIVE = "heli_support_inactive";
|
||||
|
||||
// tagTC<temp> - height until we get anim adjusted
|
||||
//FAST_ROPE_HEIGHT = 465;
|
||||
|
||||
// tagTC<temp> - desired height
|
||||
FAST_ROPE_HEIGHT = 564;
|
||||
|
||||
SHOW_PATH_DEBUG_LINES = 0;
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
precacheHeliSupport()
|
||||
{
|
||||
precacheItem ( AIRDROP_MARKER_WEAPON );
|
||||
precacheShader( DPAD_ICON );
|
||||
precacheString( &"SCRIPT_HELISUPPORT_IN_PROGRESS" );
|
||||
precacheString( &"SCRIPT_HELISUPPORT_NO_DROP_AVAIL" );
|
||||
add_hint_string( "helicopter_support_pull_RT", &"SCRIPT_HELISUPPORT_PULL_RT_TO_THROW", ::remove_pull_RT_hint_string );
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
startHeliSupport( start_ammo, allow_same_location_drop )
|
||||
{
|
||||
//println ( "### StartingHeliSupport ###" );
|
||||
player = level._player;
|
||||
level._HeliSupportInUse = false;
|
||||
|
||||
if ( isDefined ( allow_same_location_drop ))
|
||||
{
|
||||
level._allow_heli_support_drop_on_same_location = allow_same_location_drop;
|
||||
}
|
||||
|
||||
level._heli_support_drop = GetEntArray ( "heli_support_drop_location" , "targetname" );
|
||||
assertEX ( level._heli_support_drop.size > 0, "No Helicopter Support drop locations are found in the level" );
|
||||
|
||||
level._heli_support_leave = GetEntArray ( "heli_support_leave" , "targetname" );
|
||||
assertEX ( level._heli_support_leave.size > 0, "No Helicopter Support leave nodes are found in the level" );
|
||||
|
||||
level._heli_support_on_triggers = GetEntArray ( TRIGGER_ON_TARGETNAME , "targetname" );
|
||||
//assertEX ( level._heli_support_on_triggers.size > 0, "No helicopter support ON triggers are found in the level" );
|
||||
array_thread( level._heli_support_on_triggers, ::activate_helicopter_support );
|
||||
|
||||
level._heli_support_off_triggers = GetEntArray ( TRIGGER_OFF_TARGETNAME , "targetname" );
|
||||
//assertEX ( level._heli_support_off_triggers.size > 0, "No helicopter support OFF triggers are found in the level" );
|
||||
array_thread( level._heli_support_off_triggers, ::terminate_helicopter_support );
|
||||
|
||||
heli_support_guys = getentarray( ACTOR_TARGETNAME, "script_noteworthy" );
|
||||
array_thread( heli_support_guys, ::add_spawn_function, ::spawnfunc_add_actor_to_level_array );
|
||||
|
||||
assertEX ( start_ammo > 0, "The start ammo count for the airdrop marker needs to be positive" );
|
||||
level._helicopter_support_start_ammo = start_ammo;
|
||||
|
||||
createthreatbiasgroup( "heli_turret" );
|
||||
|
||||
// Init base paths.
|
||||
init_heli_support_paths();
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: self is the helicopter support ON trigger
|
||||
activate_helicopter_support()
|
||||
{
|
||||
level endon ( "level_stop_helicopter_support" );
|
||||
|
||||
while (1)
|
||||
{
|
||||
self thread trigger_helicopter_support();
|
||||
level waittill( "activate_helicopter_support" );
|
||||
|
||||
player = level._player;
|
||||
|
||||
//println ( "##### helicopter_support_on_trigger touched" );
|
||||
if ( !( isDefined ( player.heliSupportStatus )) || ( isDefined ( player.heliSupportStatus ) && player.heliSupportStatus == "inactive" ))
|
||||
{
|
||||
//tagJC<NOTE>: For now, manually manage the ammo count for the airdrop marker
|
||||
if ( isDefined ( self.script_count ) && self.script_count > 0 )
|
||||
{
|
||||
player.airdropMarkerCount = self.script_count;
|
||||
}
|
||||
else if ( isDefined ( player.remainingHeliSupportCount ) && player.remainingHeliSupportCount > 0 )
|
||||
{
|
||||
player.airdropMarkerCount = player.remainingHeliSupportCount;
|
||||
}
|
||||
else if ( isDefined ( player.remainingHeliSupportCount ) && player.remainingHeliSupportCount == 0 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.airdropMarkerCount = level._helicopter_support_start_ammo;
|
||||
}
|
||||
|
||||
player notify ( PLAYER_NOTIFY_HELI_SUPPORT_ACTIVE );
|
||||
player.heliSupportStatus = "active";
|
||||
|
||||
player setWeaponHudIconOverride( "actionslot4", DPAD_ICON );
|
||||
|
||||
player GiveWeapon( AIRDROP_MARKER_WEAPON, 0, false );
|
||||
//tagJC<TODO>: Need to investigate why the start ammo is not set correctly by the following calls
|
||||
//level._player GiveStartAmmo ( AIRDROP_MARKER_WEAPON );
|
||||
player SetWeaponAmmoStock( AIRDROP_MARKER_WEAPON, WeaponStartAmmo ( AIRDROP_MARKER_WEAPON ));
|
||||
//println ( "##### Airdrop marker ammo is: " + ( level._player GetAmmoCount ( AIRDROP_MARKER_WEAPON )));
|
||||
|
||||
player thread waitForActivation();
|
||||
player thread waitForTerminateHeliSupport();
|
||||
player thread waitForLevelTerminateHeliSupport();
|
||||
}
|
||||
|
||||
wait ( 0.05 );
|
||||
}
|
||||
}
|
||||
|
||||
trigger_helicopter_support()
|
||||
{
|
||||
level endon( "activate_helicopter_support" );
|
||||
self waittill( "trigger", player );
|
||||
|
||||
if ( ! IsAI ( player ))
|
||||
{
|
||||
level notify( "activate_helicopter_support" );
|
||||
}
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: self is the helicopter support OFF trigger
|
||||
terminate_helicopter_support()
|
||||
{
|
||||
level endon ( "level_stop_helicopter_support" );
|
||||
|
||||
while (1)
|
||||
{
|
||||
self thread trigger_terminate_helicopter_support();
|
||||
level waittill( "trigger_terminate_helicopter_support" );
|
||||
|
||||
player = level._player;
|
||||
|
||||
if ( ! IsAI ( player ))
|
||||
{
|
||||
//println ( "##### helicopter_support_off_trigger touched" );
|
||||
player.heliSupportStatus = "inactive";
|
||||
if ( isDefined ( player.airdropMarkerCount ))
|
||||
{
|
||||
player.remainingHeliSupportCount = player.airdropMarkerCount;
|
||||
}
|
||||
player notify ( PLAYER_NOTIFY_HELI_SUPPORT_INACTIVE );
|
||||
player notify ( "terminate_helicopter_support" );
|
||||
}
|
||||
wait ( 0.05 );
|
||||
}
|
||||
}
|
||||
|
||||
trigger_terminate_helicopter_support()
|
||||
{
|
||||
level endon( "trigger_terminate_helicopter_support" );
|
||||
self waittill( "trigger", player );
|
||||
|
||||
if ( ! IsAI ( player ))
|
||||
{
|
||||
level notify( "trigger_terminate_helicopter_support" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//tagJC<NOTE>: self is the player
|
||||
waitForActivation()
|
||||
{
|
||||
self endon ( "death" );
|
||||
self endon ( "terminate_helicopter_support" );
|
||||
level endon ( "level_stop_helicopter_support" );
|
||||
|
||||
self.airdropMarkerInHand = false;
|
||||
|
||||
self notifyOnPlayerCommand( "use air support grenade", "+actionslot 4" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill ( "use air support grenade" );
|
||||
//println ( "##### Air support grenade pressed #####" );
|
||||
|
||||
if ( isDefined ( level._HeliSupportInUse ) && level._HeliSupportInUse == true )
|
||||
{
|
||||
self thread createHUDMessage( &"SCRIPT_HELISUPPORT_IN_PROGRESS" );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( allDropLocationsTaken() )
|
||||
{
|
||||
self thread createHUDMessage( &"SCRIPT_HELISUPPORT_NO_DROP_AVAIL" );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isDefined ( self.airdropMarkerInHand ) && ( self.airdropMarkerInHand == false ))
|
||||
{
|
||||
self.weaponBeforeAirdropMarker = self GetCurrentWeapon();
|
||||
self SwitchToWeapon ( AIRDROP_MARKER_WEAPON );
|
||||
self.airdropMarkerInHand = true;
|
||||
self thread waitForMarkerFire();
|
||||
self thread waitForWeaponChange();
|
||||
}
|
||||
else if ( isDefined ( self.airdropMarkerInHand ) && ( self.airdropMarkerInHand == true ))
|
||||
{
|
||||
self SwitchToWeapon ( self.weaponBeforeAirdropMarker );
|
||||
self.airdropMarkerInHand = false;
|
||||
self notify ( "stopWaitForMarkerFire" );
|
||||
}
|
||||
wait ( 0.05 );
|
||||
}
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: self is the player
|
||||
waitForMarkerFire()
|
||||
{
|
||||
self endon ( "death" );
|
||||
self endon ( "stopWaitForMarkerFire" );
|
||||
self endon ( "terminate_helicopter_support" );
|
||||
level endon ( "level_stop_helicopter_support" );
|
||||
|
||||
if ( !isDefined ( level._player.seenPullRTHint ))
|
||||
{
|
||||
display_hint_timeout ( "helicopter_support_pull_RT", HINT_STRING_TIMEOUT );
|
||||
level._player thread setHasSeenHintFlag();
|
||||
}
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
self waittill ( "grenade_fire", airDropWeapon, weapname );
|
||||
//println ( "##### Grenade fired #####" );
|
||||
//println ( "##### weapname is: " + weapname );
|
||||
|
||||
if ( weapname == "airdrop_marker" )
|
||||
{
|
||||
//flyby in sound
|
||||
|
||||
if( flag( "helicopter_reveal" ))
|
||||
{
|
||||
thread sound_helicopter_wait_logic();
|
||||
}
|
||||
else
|
||||
{
|
||||
self playsound ("blackhawk_overhead_passby_fronts");
|
||||
}
|
||||
level thread radio_dialogue( "bor_eag_airdrop_incoming");
|
||||
|
||||
self.seenPullRTHint = true;
|
||||
self SwitchToWeapon ( self.weaponBeforeAirdropMarker );
|
||||
self.airdropMarkerInHand = false;
|
||||
|
||||
airDropWeapon thread waitForExplode( self );
|
||||
self.airdropMarkerCount -= 1;
|
||||
|
||||
if ( self.airdropMarkerCount == 0 )
|
||||
{
|
||||
self.remainingHeliSupportCount = 0;
|
||||
self notify ( "terminate_helicopter_support" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sound_helicopter_wait_logic()
|
||||
{
|
||||
|
||||
level waittill( "helicopter_support_inbound" );
|
||||
level.heli_support_turret playsound ("scn_border_helicopter_reveal");
|
||||
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: This function will handle the case when player switches the weapon (pressing Y) while having the airdrop marker in hand
|
||||
waitForWeaponChange()
|
||||
{
|
||||
self endon ( "death" );
|
||||
self endon ( "stopWaitForMarkerFire" );
|
||||
level endon ( "level_stop_helicopter_support" );
|
||||
|
||||
self notifyOnPlayerCommand( "weapon_switch_during_heli_support", "weapnext" );
|
||||
self waittill ( "weapon_switch_during_heli_support" );
|
||||
self.airdropMarkerInHand = false;
|
||||
self notify ( "stopWaitForMarkerFire" );
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: self is the player
|
||||
//tagJC<NOTE>: This function will terminate the helicopter support once a notification is sent to the player
|
||||
waitForTerminateHeliSupport()
|
||||
{
|
||||
self endon ( "death" );
|
||||
level endon ( "level_stop_helicopter_support" );
|
||||
|
||||
self waittill ( "terminate_helicopter_support" );
|
||||
|
||||
self.heliSupportStatus = "inactive";
|
||||
|
||||
self TakeWeapon ( AIRDROP_MARKER_WEAPON );
|
||||
self setWeaponHudIconOverride( "actionslot4", "none" );
|
||||
|
||||
if ( isDefined ( self.weaponBeforeAirdropMarker ) )
|
||||
{
|
||||
self SwitchToWeapon ( self.weaponBeforeAirdropMarker );
|
||||
self.airdropMarkerInHand = false;
|
||||
}
|
||||
|
||||
if ( isDefined ( self.HeliSupportMessage ))
|
||||
{
|
||||
self.HeliSupportMessage destroy();
|
||||
self.HeliSupportMessage = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: self is the player
|
||||
//tagJC<NOTE>: This function will terminate the helicopter support once a notification is sent to the level
|
||||
waitForLevelTerminateHeliSupport()
|
||||
{
|
||||
self endon ( "death" );
|
||||
|
||||
level waittill ( "level_stop_helicopter_support" );
|
||||
|
||||
self.heliSupportStatus = "inactive";
|
||||
|
||||
self TakeWeapon ( AIRDROP_MARKER_WEAPON );
|
||||
self setWeaponHudIconOverride( "actionslot4", "none" );
|
||||
|
||||
if ( isDefined ( self.weaponBeforeAirdropMarker ) )
|
||||
{
|
||||
self SwitchToWeapon ( self.weaponBeforeAirdropMarker );
|
||||
self.airdropMarkerInHand = false;
|
||||
}
|
||||
|
||||
if ( isDefined ( self.HeliSupportMessage ))
|
||||
{
|
||||
self.HeliSupportMessage destroy();
|
||||
self.HeliSupportMessage = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: self is the airdrop marker grenade
|
||||
waitForExplode( owner )
|
||||
{
|
||||
self waittill ( "explode", position );
|
||||
|
||||
level._HeliSupportInUse = true;
|
||||
|
||||
//println ( "##### The position for the explosion is: " + position );
|
||||
//println ( "##### Airdrop marker ammo after explosion is: " + (level._player GetAmmoCount ( AIRDROP_MARKER_WEAPON )));
|
||||
|
||||
target_name_vehicle = VEHICLE_TARGETNAME;
|
||||
|
||||
target_drop_location = find_closest_drop_location ( position );
|
||||
|
||||
if ( isDefined ( target_drop_location.script_parameters ))
|
||||
{
|
||||
//println ( "##### script_parameters is: " + target_drop_location.script_parameters );
|
||||
target_name_vehicle = target_name_vehicle + "_" + target_drop_location.script_parameters;
|
||||
}
|
||||
|
||||
chopper = spawn_vehicle_from_targetname( target_name_vehicle );
|
||||
|
||||
// Set the chopper to the angles of the first node in the path
|
||||
if( IsDefined( target_drop_location.script_noteworthy ))
|
||||
{
|
||||
first_node = GetStruct( target_drop_location.script_noteworthy, "targetname" );
|
||||
if( IsDefined( first_node ))
|
||||
{
|
||||
if( IsDefined( first_node.origin ) && IsDefined( first_node.angles ))
|
||||
{
|
||||
chopper Vehicle_Teleport( first_node.origin, first_node.angles );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
turret = chopper.mgturret[ 0 ];
|
||||
turret SetMode( "manual" );
|
||||
level.heli_support_turret = turret;
|
||||
|
||||
turret_guys = getentarray("turret_guy", "script_noteworthy");
|
||||
foreach ( turret_guy in turret_guys )
|
||||
{
|
||||
if ( !isSpawner( turret_guy ) )
|
||||
{
|
||||
turret_guy setthreatbiasgroup( "heli_turret" );
|
||||
turret_guy thread magic_bullet_shield();
|
||||
level.heli_support_turret_guy = turret_guy;
|
||||
}
|
||||
}
|
||||
|
||||
chopper thread monitorMovement( target_drop_location );
|
||||
|
||||
level.support_heli = chopper;
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: self is the helicopter
|
||||
monitorMovement( target_node )
|
||||
{
|
||||
//thread script to start loop self playsound loop
|
||||
|
||||
|
||||
self endon ( "death" );
|
||||
|
||||
// Make invincible.
|
||||
self GodOn();
|
||||
|
||||
// tagTC<note> - notify to check when helicopter is inbound
|
||||
level notify( "helicopter_support_inbound" );
|
||||
|
||||
// Spawn special enemies.
|
||||
self special_enemy_spawn( target_node );
|
||||
|
||||
// New Path System.
|
||||
self set_on_path( target_node );
|
||||
|
||||
// tagBK<NOTE> We still need this, or the heli ends up in awkward orientations.
|
||||
// self Vehicle_SetSpeed( 50, 5 );
|
||||
// self SetVehGoalPos( target_node.origin + ( 0, 0, FAST_ROPE_HEIGHT ), 1 );
|
||||
// self SetNearGoalNotifyDist( 10 );
|
||||
// self waittill( "goal" );
|
||||
|
||||
// Removed.
|
||||
// self SetNearGoalNotifyDist( 50 );
|
||||
// self setTurningAbility( 0.05 );
|
||||
// self setYawSpeed(45,25,25,.5);
|
||||
|
||||
// This locks the vehicle in place for the fast rope animation.
|
||||
// self SetHoverParams( 0, 100, 100 );
|
||||
|
||||
// Unload actors.
|
||||
// heliSupport_actors = self vehicle_unload();
|
||||
|
||||
// Wait for actors spawn function to be called so that _heli_support_guys is valid.
|
||||
// wait( 0.01 );
|
||||
|
||||
// Setup goal transition for fast ropers.
|
||||
// list_of_support_node = GetNodeArray ( target_node.target, "targetname" );
|
||||
// Assert( list_of_support_node.size >= level._heli_support_guys.size );
|
||||
// for ( ii = 0; ii < level._heli_support_guys.size; ii++ )
|
||||
// {
|
||||
// level._heli_support_guys[ ii ] thread move_to_goal_thread( list_of_support_node[ ii ], self, target_node );
|
||||
// }
|
||||
|
||||
// Wait for vehicle to finish unload.
|
||||
// self waittill( "unloaded" );
|
||||
|
||||
// tagTC<note> - notify to check when helicopter is unloaded
|
||||
level notify( "helicopter_support_unloaded" );
|
||||
|
||||
if( !flag( "helicopter_support_streets_middle" ) )
|
||||
{
|
||||
level thread radio_dialogue( "bor_eag_airdrop_returning");
|
||||
}
|
||||
|
||||
// Cleanup and exit.
|
||||
// level._heli_support_guys = [];
|
||||
|
||||
//thread the away sound now
|
||||
|
||||
self Vehicle_SetSpeed( 50, 5 );
|
||||
self SetVehGoalPos ( level._heli_support_leave[0].origin, 1 );
|
||||
self SetNearGoalNotifyDist( 50 );
|
||||
|
||||
self waittill ( "near_goal" );
|
||||
level._HeliSupportInUse = false;
|
||||
//script to fade out loop
|
||||
|
||||
level.heli_support_turret_guy thread stop_magic_bullet_shield();
|
||||
self delete();
|
||||
}
|
||||
|
||||
move_to_goal_thread( goal_node, vehicle, target_node )
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
// If a color group has been assigned to the target node, set it on the spawned actors.
|
||||
if ( IsDefined( target_node.script_forcecolor ))
|
||||
{
|
||||
self set_force_color( target_node.script_forcecolor );
|
||||
}
|
||||
|
||||
// Wait until right before the fast rope ends.
|
||||
// self waittill( "jumpedout" );
|
||||
animpos = maps\_vehicle_aianim::anim_pos( vehicle, self.script_startingposition );
|
||||
anim_length = GetAnimLength( animpos.getout );
|
||||
anim_length -= 0.1;
|
||||
wait( anim_length );
|
||||
|
||||
self.ignoreme = false;
|
||||
|
||||
// Set goal for actor.
|
||||
self SetGoalNode( goal_node );
|
||||
self waittill( "goal" );
|
||||
self stop_magic_bullet_shield();
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: self is the AI helicopter support actor that will be dropped from the helicopter
|
||||
spawnfunc_add_actor_to_level_array()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
// tagTC<note> - protect the ally until he gets to the node
|
||||
// then remove shield, might remove this at a later point
|
||||
self magic_bullet_shield();
|
||||
self.ignoreme = true;
|
||||
|
||||
level._heli_support_guys = add_to_array( level._heli_support_guys, self );
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: This function finds the closest drop location based on the airdrop marker explosion location
|
||||
find_closest_drop_location ( explosion_location )
|
||||
{
|
||||
result = undefined;
|
||||
distance_square = 999999999999999.0;
|
||||
for ( i = 0; i < level._heli_support_drop.size; i++ )
|
||||
{
|
||||
if ( isDropLocationAvailable ( level._heli_support_drop[i] ))
|
||||
{
|
||||
curr_distance_square = distanceSquared ( explosion_location, level._heli_support_drop[i].origin );
|
||||
if ( !isDefined ( result ) || curr_distance_square < distance_square )
|
||||
{
|
||||
result = level._heli_support_drop[i];
|
||||
distance_square = curr_distance_square;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( isDefined ( result ))
|
||||
{
|
||||
result.taken = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: This function returns whether a given drop location has already been used
|
||||
isDropLocationAvailable( drop_location )
|
||||
{
|
||||
result = true;
|
||||
if ( isDefined ( level._allow_heli_support_drop_on_same_location ) && level._allow_heli_support_drop_on_same_location == false )
|
||||
{
|
||||
if ( isDefined ( drop_location.taken ) && drop_location.taken == true )
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: This function returns whether all the drop locations in the level have been used
|
||||
allDropLocationsTaken()
|
||||
{
|
||||
if ( !(isDefined ( level._allow_heli_support_drop_on_same_location ) && level._allow_heli_support_drop_on_same_location == false ))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = true;
|
||||
for ( i = 0; i < level._heli_support_drop.size; i++ )
|
||||
{
|
||||
if ( !isDefined ( level._heli_support_drop[i].taken ))
|
||||
{
|
||||
result = false;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//tagJC<NOTE>: Create the helicopter support related HUD message
|
||||
createHUDMessage( message )
|
||||
{
|
||||
self endon ( "death" );
|
||||
self endon ( "terminate_helicopter_support" );
|
||||
level endon ( "level_stop_helicopter_support" );
|
||||
|
||||
if ( !(isDefined ( self.HeliSupportMessage )))
|
||||
{
|
||||
hudelem = newHudElem( self );
|
||||
hudelem.label = message;
|
||||
hudelem.alignX = "center";
|
||||
hudelem.alignY = "middle";
|
||||
hudelem.horzAlign = "center";
|
||||
hudelem.vertAlign = "middle";
|
||||
hudelem.fontScale = 1.5;
|
||||
hudelem.color = ( 1, 1, 1 );
|
||||
hudelem.font = "objective";
|
||||
hudelem.foreground = 1;
|
||||
hudelem.hidewheninmenu = true;
|
||||
hudelem.hidewhendead = true;
|
||||
self.HeliSupportMessage = hudelem;
|
||||
wait ( MESSAGE_TIME );
|
||||
self.HeliSupportMessage destroy();
|
||||
self.HeliSupportMessage = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
debug_draw_path( base_path )
|
||||
{
|
||||
self endon( "release_path" );
|
||||
|
||||
// Draw the new path for a bit.
|
||||
while ( 1 )
|
||||
{
|
||||
// Draw path every frame.
|
||||
next_struct = base_path;
|
||||
prev_node = undefined;
|
||||
color = ( 1, 0, 0 );
|
||||
while ( 1 )
|
||||
{
|
||||
line( next_struct.origin, next_struct.origin + ( 0, 0, 100 ), color );
|
||||
if ( IsDefined( prev_node ))
|
||||
{
|
||||
line( prev_node.origin, next_struct.origin, ( 1, 1, 1 ));
|
||||
}
|
||||
|
||||
if ( !IsDefined( next_struct.target ))
|
||||
{
|
||||
break;
|
||||
}
|
||||
prev_node = next_struct;
|
||||
next_struct = GetStruct( next_struct.target, "targetname" );
|
||||
color = ( 1, 1, 0 );
|
||||
}
|
||||
wait( 0.01 );
|
||||
}
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
get_heli_path_from_target_node( target_node )
|
||||
{
|
||||
// Get the main path.
|
||||
if ( isDefined ( target_node.script_noteworthy ))
|
||||
{
|
||||
heli_path = GetStruct( target_node.script_noteworthy, "targetname" );
|
||||
}
|
||||
else
|
||||
{
|
||||
heli_path = GetStruct( DEFAULT_PATH_TARGETNAME, "targetname" );
|
||||
}
|
||||
|
||||
return heli_path;
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
init_heli_support_paths()
|
||||
{
|
||||
level.helidrop_path_in_use = 0;
|
||||
level.helidrop_base_path_pos = [];
|
||||
|
||||
for ( ii = 0; ii < level._heli_support_drop.size; ii++ )
|
||||
{
|
||||
// Grab the base path and setup a new global path array.
|
||||
base_path = get_heli_path_from_target_node( level._heli_support_drop[ ii ] );
|
||||
new_base_path = [];
|
||||
|
||||
// Get the end node to base the orientation off of.
|
||||
end_path = base_path;
|
||||
while ( 1 )
|
||||
{
|
||||
if ( !IsDefined( end_path.target ))
|
||||
{
|
||||
break;
|
||||
}
|
||||
end_path = GetStruct( end_path.target, "targetname" );
|
||||
}
|
||||
|
||||
// Store new info.
|
||||
next_struct = base_path;
|
||||
while ( 1 )
|
||||
{
|
||||
// Build new item data.
|
||||
new_struct = SpawnStruct();
|
||||
new_struct.height = ( next_struct.origin[ 2 ] - end_path.origin[ 2 ] );
|
||||
new_struct.local_origin = next_struct.origin - end_path.origin;
|
||||
new_struct.local_origin *= ( 1, 1, 0 );
|
||||
new_struct.distance = Length( new_struct.local_origin );
|
||||
angles = vectortoangles( new_struct.local_origin );
|
||||
new_struct.angle = angles[ 1 ];
|
||||
|
||||
// Backup to global.
|
||||
new_base_path[ new_base_path.size ] = new_struct;
|
||||
|
||||
// Next node.
|
||||
if ( !IsDefined( next_struct.target ))
|
||||
{
|
||||
break;
|
||||
}
|
||||
next_struct = GetStruct( next_struct.target, "targetname" );
|
||||
}
|
||||
|
||||
// Store the new path into a global and backup the index.
|
||||
base_path.global_index = level.helidrop_base_path_pos.size;
|
||||
level.helidrop_base_path_pos[ level.helidrop_base_path_pos.size ] = new_base_path;
|
||||
}
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
orient_path( vehicle, base_path, offset )
|
||||
{
|
||||
worldaligned = 0;
|
||||
if ( isDefined ( self.script_worldaligned ) && self.script_worldaligned == 1 )
|
||||
{
|
||||
worldaligned = 1;
|
||||
}
|
||||
|
||||
// Cannot use heli drop path in more than one place.
|
||||
AssertEx( level.helidrop_path_in_use == 0, "Cannot use heli drop path in more than one place." );
|
||||
level.helidrop_path_in_use = 1;
|
||||
|
||||
// Local aligned.
|
||||
if( !worldaligned )
|
||||
{
|
||||
// Get the global base path.
|
||||
assert( base_path.global_index < level.helidrop_base_path_pos.size );
|
||||
global_base_path = level.helidrop_base_path_pos[ base_path.global_index ];
|
||||
|
||||
// Move the path into position.
|
||||
next_struct = base_path;
|
||||
for ( ii = 0; ii < global_base_path.size; ii++ )
|
||||
{
|
||||
// Set the new position.
|
||||
base_dist = global_base_path[ ii ].distance;
|
||||
base_angle = global_base_path[ ii ].angle;
|
||||
x = base_dist * Cos( base_angle + self.angles[ 1 ] );
|
||||
y = base_dist * Sin( base_angle + self.angles[ 1 ] );
|
||||
rotated_local = ( x, y, offset[ 2 ] + global_base_path[ ii ].height );
|
||||
next_struct.origin = self.origin + rotated_local;
|
||||
|
||||
// Next link.
|
||||
if ( IsDefined( next_struct.target ))
|
||||
{
|
||||
next_struct = GetStruct( next_struct.target, "targetname" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Teleport the vehicle.
|
||||
angles = self.angles + vehicle.angles;
|
||||
backward = AnglesToForward( angles ) * -100.0;
|
||||
vehicle vehicle_teleport( base_path.origin + backward, angles );
|
||||
|
||||
// Debug draw the path.
|
||||
if ( SHOW_PATH_DEBUG_LINES )
|
||||
{
|
||||
self thread debug_draw_path( base_path );
|
||||
}
|
||||
|
||||
// Wait until we are done with this path.
|
||||
self waittill( "release_path" );
|
||||
level.helidrop_path_in_use = 0;
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
set_on_path( target_node )
|
||||
{
|
||||
// Get the main path.
|
||||
heli_path = get_heli_path_from_target_node( target_node );
|
||||
Assert( IsDefined( heli_path ));
|
||||
|
||||
// tagBK< NOTE > We offset the vehicle path down by 155 units. This is because when following a path, the vehicle
|
||||
// bases its movement on a different tag than when targeting a goal position.
|
||||
path_height = FAST_ROPE_HEIGHT;
|
||||
if( IsDefined( target_node.height ) )
|
||||
{
|
||||
path_height = target_node.height;
|
||||
}
|
||||
|
||||
target_node thread orient_path( self, heli_path, ( 0, 0, path_height - 155 ));
|
||||
wait( 0.1 );
|
||||
|
||||
self.script_vehicle_selfremove = undefined;
|
||||
self vehicle_paths( heli_path );
|
||||
target_node notify( "release_path" );
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
special_enemy_spawn( target_node )
|
||||
{
|
||||
spawners = GetEntArray( target_node.target, "targetname" );
|
||||
ii = 0;
|
||||
foreach( spawner in spawners )
|
||||
{
|
||||
if ( IsSpawner( spawner ))
|
||||
{
|
||||
self thread spawn_guy_thread( spawner, ii );
|
||||
ii++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
spawn_guy_thread( spawner, ii )
|
||||
{
|
||||
// Spawn a guy and send him to a target node.
|
||||
guy = spawner spawn_ai();
|
||||
if ( !IsDefined( guy ))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
guy endon( "death" );
|
||||
|
||||
// We want these guys ignored and at low health until the fast ropers leave.
|
||||
guy.fixednode = true;
|
||||
guy.ignoreme = true;
|
||||
guy.health = 1;
|
||||
|
||||
// Target the helicopter.
|
||||
guy SetEntityTarget( self );
|
||||
|
||||
// Wait for the helicopter to unload.
|
||||
self waittill( "unloaded" );
|
||||
guy ClearEntityTarget();
|
||||
guy.ignoreme = false;
|
||||
guy.fixednode = false;
|
||||
|
||||
// Make guy vulnerable again and set target.
|
||||
if ( level._heli_support_guys.size > ii )
|
||||
{
|
||||
if ( IsAlive( level._heli_support_guys[ ii ] ))
|
||||
{
|
||||
guy SetEntityTarget( level._heli_support_guys[ ii ]);
|
||||
level._heli_support_guys[ ii ] SetEntityTarget( guy );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// *
|
||||
// *
|
||||
//*******************************************************************
|
||||
remove_pull_RT_hint_string()
|
||||
{
|
||||
result = false;
|
||||
if( isDefined ( level._player.seenPullRTHint ) && level._player.seenPullRTHint == true )
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
setHasSeenHintFlag()
|
||||
{
|
||||
wait ( HINT_STRING_TIMEOUT );
|
||||
level._player.seenPullRTHint = true;
|
||||
}
|
474
maps/_hiding_door.gsc
Normal file
474
maps/_hiding_door.gsc
Normal file
@ -0,0 +1,474 @@
|
||||
#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
|
||||
|
||||
// Force enemy to charge out instead of careful
|
||||
force_charge = false;
|
||||
if( IsDefined( self.script_parameters ) && self.script_parameters == "force_charge" )
|
||||
{
|
||||
force_charge = true;
|
||||
}
|
||||
|
||||
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 ) || force_charge )
|
||||
{
|
||||
scene = "jump";
|
||||
if ( coinToss() || force_charge )
|
||||
{
|
||||
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" ) );
|
||||
}
|
62
maps/_hiding_door_anims.gsc
Normal file
62
maps/_hiding_door_anims.gsc
Normal file
@ -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
maps/_hind.gsc
Normal file
421
maps/_hind.gsc
Normal file
@ -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
|
||||
|
||||
|
||||
maps\_hind::main( "vehicle_mi24p_hind_desert" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_hind::main( "vehicle_mi24p_hind_desert" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_hind::main( "vehicle_mi24p_hind_chernobyl" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_hind::main( "vehicle_mi24p_hind_woodland" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_hind::main( "vehicle_mi24p_hind_woodland" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_hind::main( "vehicle_mi24p_hind_woodland_opened_door" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
74
maps/_hud.gsc
Normal file
74
maps/_hud.gsc
Normal file
@ -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;
|
||||
}
|
1496
maps/_hud_util.gsc
Normal file
1496
maps/_hud_util.gsc
Normal file
File diff suppressed because it is too large
Load Diff
360
maps/_hud_weapons.gsc
Normal file
360
maps/_hud_weapons.gsc
Normal file
@ -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;
|
||||
}
|
||||
}
|
246
maps/_hummer_minigun.gsc
Normal file
246
maps/_hummer_minigun.gsc
Normal file
@ -0,0 +1,246 @@
|
||||
#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
|
||||
|
||||
|
||||
maps\_hummer_minigun::main( "vehicle_hummer" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_hummer_minigun::main( "vehicle_hummer", "hummer_minigun_physics" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_hummer_minigun::main( "vehicle_hummer", "hummer_minigun_physics_player", "minigun_hummer_player" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_hummer_hithard_minigun_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
|
||||
maps\_hummer_minigun::main( "vehicle_hummer", "hummer_minigun_physics", "minigun_suburban" );
|
||||
|
||||
|
||||
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_hithard_minigun_physics_player (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
|
||||
maps\_hummer_minigun::main( "vehicle_hummer", "hummer_minigun_physics_player", "minigun_suburban_player" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
417
maps/_humvee.gsc
Normal file
417
maps/_humvee.gsc
Normal file
@ -0,0 +1,417 @@
|
||||
#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
|
||||
|
||||
build_deathmodel( "vehicle_hummer_mexico_destructible","vehicle_hummer_mexico_destroyed" );
|
||||
build_deathmodel( "vehicle_hummer_mexico_opentop", "vehicle_hummer_mexico_opentop_destroyed" );
|
||||
build_deathmodel( "vehicle_hummer_doors_open", "vehicle_hummer_destroyed" );
|
||||
|
||||
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";
|
||||
hummer_death_fx[ "vehicle_hummer_mexico_destructible" ] = "explosions/vehicle_explosion_hummer";
|
||||
hummer_death_fx[ "vehicle_hummer_mexico_opentop" ] = "explosions/vehicle_explosion_hummer_nodoors";
|
||||
hummer_death_fx[ "vehicle_hummer_doors_open" ] = "explosions/vehicle_explosion_hummer";
|
||||
|
||||
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_light( model, "headlight_L", "tag_headlight_left", "nx/misc/nx_car_headlight_beam_far", "running", 0.0 );
|
||||
build_light( model, "headlight_R", "tag_headlight_right", "nx/misc/nx_car_headlight_beam_far", "running", 0.0 );
|
||||
build_light( model, "brakelight_R", "tag_brakelight_right", "misc/car_brakelight_btr80", "brakes", 0.0 );
|
||||
build_light( model, "brakelight_L", "tag_brakelight_left", "misc/car_brakelight_btr80", "brakes", 0.0 );
|
||||
|
||||
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;
|
||||
anim_vehicle_func = ::set_vehicle_anims;
|
||||
|
||||
if ( isdefined( model ) && model == "vehicle_hummer_mexico_destructible" )
|
||||
{
|
||||
anim_func = ::setanims_humvee_dismount;
|
||||
anim_vehicle_func = ::set_vehicle_anims_doors_open;
|
||||
}
|
||||
if ( isdefined( model ) && model == "vehicle_hummer_doors_open" )
|
||||
{
|
||||
anim_func = ::setanims_humvee_dismount;
|
||||
anim_vehicle_func = ::set_vehicle_anims_doors_open;
|
||||
}
|
||||
|
||||
if ( isdefined( type ) && issubstr( type, "open" ) )
|
||||
anim_func = ::opentop_anims;
|
||||
|
||||
build_aianims( anim_func, anim_vehicle_func );
|
||||
|
||||
build_compassicon( "automobile", false );
|
||||
|
||||
}
|
||||
|
||||
#using_animtree( "vehicles" );
|
||||
init_local()
|
||||
{
|
||||
//maps\_vehicle::lights_on( "running" );
|
||||
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 )
|
||||
{
|
||||
for ( i = 0;i < positions.size;i++ )
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
set_vehicle_anims_doors_open( positions )
|
||||
{
|
||||
for ( i = 0;i < positions.size;i++ )
|
||||
|
||||
positions[ 0 ].vehicle_getoutanim = %suburban_dismount_frontL_door;
|
||||
positions[ 1 ].vehicle_getoutanim = %humvee_dismount_frontR_door;
|
||||
positions[ 2 ].vehicle_getoutanim = %humvee_dismount_backL_door;
|
||||
positions[ 3 ].vehicle_getoutanim = %humvee_dismount_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";
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
setanims_humvee_dismount()
|
||||
{
|
||||
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_dismount_frontL;
|
||||
positions[ 1 ].getout = %humvee_dismount_frontR;
|
||||
positions[ 2 ].getout = %humvee_dismount_backL;
|
||||
positions[ 3 ].getout = %humvee_dismount_backR;
|
||||
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*QUAKED script_vehicle_hummer (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer_no_doors" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer_opentop" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer_viewmodel" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer_viewmodel", "hummer_physics" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer_opentop", "hummer_opentop_physics" );
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer", "hummer_physics" );
|
||||
|
||||
|
||||
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"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_nx_hummer_doors_open_US (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer_doors_open", "hummer_physics" );
|
||||
|
||||
|
||||
include,nx_vehicle_hummer_doors_open
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_hummer_doors_open"
|
||||
default:"vehicletype" "hummer_physics"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_nx_hummer (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer_mexico_destructible", "hummer_physics" );
|
||||
|
||||
|
||||
include,nx_vehicle_hummer_mexico_destructible
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_hummer_mexico_destructible"
|
||||
default:"vehicletype" "hummer_physics"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_nx_hummer_opentop_physics (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
|
||||
maps\_humvee::main( "vehicle_hummer_mexico_opentop", "hummer_opentop_physics" );
|
||||
|
||||
|
||||
include,vehicle_hummer_opentop
|
||||
sound,vehicle_hummer,vehicle_standard,all_sp
|
||||
sound,vehicle_car_exp,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_hummer_mexico_opentop"
|
||||
default:"vehicletype" "hummer_opentop_physics"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
32
maps/_humvee50cal.gsc
Normal file
32
maps/_humvee50cal.gsc
Normal file
@ -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
maps/_idle.gsc
Normal file
340
maps/_idle.gsc
Normal file
@ -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 );
|
||||
}
|
297
maps/_intelligence.gsc
Normal file
297
maps/_intelligence.gsc
Normal file
@ -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" );
|
||||
}
|
1483
maps/_interactive_objects.gsc
Normal file
1483
maps/_interactive_objects.gsc
Normal file
File diff suppressed because it is too large
Load Diff
2353
maps/_introscreen.gsc
Normal file
2353
maps/_introscreen.gsc
Normal file
File diff suppressed because it is too large
Load Diff
139
maps/_inventory.gsc
Normal file
139
maps/_inventory.gsc
Normal file
@ -0,0 +1,139 @@
|
||||
/*
|
||||
Usage:
|
||||
|
||||
inventory_hud_elem = inventory_cr eate(shader,show_icon)
|
||||
Creates a new hud element.
|
||||
Shader is the name of a shader found in the hud.gdt.
|
||||
show_icon defaults to false.
|
||||
Inventory items will stack in the order they are created.
|
||||
|
||||
inventory_hud_elem inventory_show();
|
||||
Shows the hud element
|
||||
|
||||
inventory_hud_elem inventory_hide();
|
||||
Hides the hud element
|
||||
|
||||
inventory_hud_elem inventory_destroy();
|
||||
Destroyed the hud element
|
||||
*/
|
||||
|
||||
main()
|
||||
{
|
||||
level._inventory = [];
|
||||
}
|
||||
|
||||
inventory_create( shader, show_icon )
|
||||
{
|
||||
// feature disabled.
|
||||
if ( true )
|
||||
return spawnstruct();
|
||||
|
||||
// Creates a hud element for the inventroy.
|
||||
// Shader is the name of a shader found in the hud.gdt. Assumed to be 64x64 units.
|
||||
assert( isdefined( shader ) );
|
||||
|
||||
if ( !isdefined( show_icon ) )
|
||||
show_icon = false;
|
||||
|
||||
ent = newHudElem();
|
||||
|
||||
ent.alignX = "right";
|
||||
ent.alignY = "top";
|
||||
ent.horzAlign = "right";
|
||||
ent.vertAlign = "top";
|
||||
|
||||
ent.alpha = 0;
|
||||
|
||||
ent.index = level._inventory.size;
|
||||
ent.show_icon = show_icon;
|
||||
|
||||
ent setshader( shader, 40, 40 ); // 40, 40 makes for ~64x64 in 1024 * 768
|
||||
|
||||
level._inventory[ ent.index ] = ent;
|
||||
|
||||
inventroy_update();
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
inventory_hide()
|
||||
{
|
||||
// feature disabled.
|
||||
if ( true )
|
||||
return;
|
||||
|
||||
self.show_icon = false;
|
||||
inventroy_update();
|
||||
}
|
||||
|
||||
inventory_show()
|
||||
{
|
||||
// feature disabled.
|
||||
if ( true )
|
||||
return;
|
||||
|
||||
self.show_icon = true;
|
||||
inventroy_update();
|
||||
}
|
||||
|
||||
inventroy_update()
|
||||
{
|
||||
// feature disabled.
|
||||
if ( true )
|
||||
return;
|
||||
|
||||
// Updates the location and visibility state for each item in the inventory
|
||||
|
||||
x = -18;
|
||||
y = 8;
|
||||
|
||||
gap = 42;
|
||||
position = 0;
|
||||
|
||||
for ( i = 0; i < level._inventory.size; i++ )
|
||||
{
|
||||
if ( level._inventory[ i ].show_icon )
|
||||
{
|
||||
new_y = y + ( gap * position );
|
||||
|
||||
if ( new_y != level._inventory[ i ].y )
|
||||
{
|
||||
level._inventory[ i ].x = x;
|
||||
if ( level._inventory[ i ].alpha != 0 )
|
||||
level._inventory[ i ] moveovertime( .3 );
|
||||
level._inventory[ i ].y = new_y;
|
||||
}
|
||||
if ( level._inventory[ i ].alpha != 1 )
|
||||
{
|
||||
level._inventory[ i ] fadeovertime( .3 );
|
||||
level._inventory[ i ].alpha = 1;
|
||||
}
|
||||
position++ ;
|
||||
}
|
||||
else
|
||||
{
|
||||
level._inventory[ i ] fadeovertime( .3 );
|
||||
level._inventory[ i ].alpha = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inventory_destroy()
|
||||
{
|
||||
// feature disabled.
|
||||
if ( true )
|
||||
return;
|
||||
|
||||
// Destroyes the hud element and removes it from the inventory.
|
||||
self destroy();
|
||||
|
||||
index = 0;
|
||||
old_inventory = level._inventory;
|
||||
level._inventory = [];
|
||||
for ( i = 0; i < old_inventory.size; i++ )
|
||||
{
|
||||
if ( isdefined( old_inventory[ i ] ) )
|
||||
level._inventory[ level._inventory.size ] = old_inventory[ i ];
|
||||
}
|
||||
inventroy_update();
|
||||
}
|
342
maps/_killstreaks.gsc
Normal file
342
maps/_killstreaks.gsc
Normal file
@ -0,0 +1,342 @@
|
||||
#include maps\_utility;
|
||||
#include maps\_hud_util;
|
||||
#include common_scripts\utility;
|
||||
|
||||
KILLSTREAK_STRING_TABLE = "sp/killstreakTable.csv";
|
||||
|
||||
init()
|
||||
{
|
||||
// &&1 Kill Streak!
|
||||
precacheString( &"MP_KILLSTREAK_N" );
|
||||
|
||||
initKillstreakData();
|
||||
|
||||
level._killstreakFuncs = [];
|
||||
level._killstreakSetupFuncs = [];
|
||||
|
||||
thread maps\_killstreak_ac130::init();
|
||||
//thread maps\mp\_remotemissile::init();
|
||||
//thread maps\mp\_uav::init();
|
||||
//thread maps\mp\_airstrike::init();
|
||||
//thread maps\mp\_helicopter::init();
|
||||
//thread maps\mp\_autoshotgun::init();
|
||||
thread maps\_killstreak_autosentry::init();
|
||||
}
|
||||
|
||||
|
||||
initKillstreakData()
|
||||
{
|
||||
for ( i = 1; true; i++ )
|
||||
{
|
||||
retVal = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 1 );
|
||||
if ( !isDefined( retVal ) || retVal == "" )
|
||||
break;
|
||||
|
||||
streakRef = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 1 );
|
||||
assert( streakRef != "" );
|
||||
|
||||
streakUseHint = tableLookupIString( KILLSTREAK_STRING_TABLE, 0, i, 6 );
|
||||
// string not found for
|
||||
assert( streakUseHint != &"" );
|
||||
precacheString( streakUseHint );
|
||||
|
||||
streakFailHint = tableLookupIString( KILLSTREAK_STRING_TABLE, 0, i, 11 );
|
||||
// string not found for
|
||||
assert( streakFailHint != &"" );
|
||||
precacheString( streakFailHint );
|
||||
|
||||
//chad - no earn dialog yet
|
||||
//streakEarnDialog = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 8 );
|
||||
//assert( streakEarnDialog != "" );
|
||||
//game["dialog"][streakRef] = streakEarnDialog;
|
||||
|
||||
streakFriendlyUseDialog = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 9 );
|
||||
assert( streakFriendlyUseDialog != "" );
|
||||
game[ "dialog" ][ streakRef + "_inbound" ] = streakFriendlyUseDialog;
|
||||
|
||||
/*
|
||||
Chad:
|
||||
enemies will never use killstreak rewards because they are just stupid AI haha
|
||||
maybe someday I can make them use killstreaks to make things interesting
|
||||
|
||||
streakEnemyUseDialog = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 9 );
|
||||
assert( streakEnemyUseDialog != "" );
|
||||
game["dialog"]["enemy_"+streakRef+"_inbound"] = streakEnemyUseDialog;
|
||||
*/
|
||||
|
||||
streakWeapon = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 12 );
|
||||
if ( streakWeapon != "" )
|
||||
precacheItem( streakWeapon );
|
||||
|
||||
streakPoints = int( tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 13 ) );
|
||||
assert( streakPoints != 0 );
|
||||
maps\_rank::registerScoreInfo( "killstreak_" + streakRef, streakPoints );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onPlayerSpawned()
|
||||
{
|
||||
self giveOwnedKillstreakItem();
|
||||
self thread killstreakUseWaiter();
|
||||
}
|
||||
|
||||
|
||||
isRideKillstreak( streakName )
|
||||
{
|
||||
switch( streakName )
|
||||
{
|
||||
case "helicopter_minigun":
|
||||
case "helicopter_mk19":
|
||||
case "lockseekdie":
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
killstreakUsePressed()
|
||||
{
|
||||
streakName = self.pers[ "killstreak" ];
|
||||
|
||||
assert( isDefined( streakName ) );
|
||||
assert( isDefined( level._killstreakFuncs[ streakName ] ) );
|
||||
|
||||
if ( isDefined( self.carryObject ) && isRideKillstreak( streakName ) )
|
||||
{
|
||||
iprintlnbold( "Killstreak unavailable while holding bomb." );
|
||||
}
|
||||
else if ( self [[ level._killstreakFuncs[ streakName ] ]]() )
|
||||
{
|
||||
team = self.team;
|
||||
|
||||
/* Chad - leader dialog doesn't exist but we can probably just do a playlocalsoundwrapper on all
|
||||
players instead since there isn't anyone on the other team
|
||||
|
||||
//array_thread( level.players, ::playLocalSoundWrapper, level.pmc.sound[ "juggernaut_attack" ] );
|
||||
|
||||
if ( level.teamBased )
|
||||
thread leaderDialog( streakName + "_inbound", team );
|
||||
else
|
||||
self thread leaderDialogOnPlayer( streakName + "_inbound" );
|
||||
*/
|
||||
|
||||
self playLocalSound( "weap_c4detpack_trigger_plr" );
|
||||
|
||||
//self setClientDvar( "ui_killstreak", "" );
|
||||
self.pers[ "killstreak" ] = undefined;
|
||||
}
|
||||
else if ( isDefined( level._killstreakFuncs[ streakName + "_failed" ] ) )
|
||||
{
|
||||
self [[ level._killstreakFuncs[ streakName + "_failed" ] ]]();
|
||||
}
|
||||
else
|
||||
{
|
||||
iprintlnbold( getKillstreakFailHint( streakName ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
killstreakUseWaiter()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
self notifyOnPlayerCommand( "use killstreak", "+actionslot 4" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "use killstreak" );
|
||||
|
||||
if ( !isAlive( self ) )
|
||||
continue;
|
||||
|
||||
if ( isDefined( self.canUseKillstreaks ) && !self.canUseKillstreaks )
|
||||
continue;
|
||||
|
||||
if ( isdefined( self.placingSentry ) )
|
||||
continue;
|
||||
|
||||
if ( !isDefined( self.pers[ "killstreak" ] ) )
|
||||
continue;
|
||||
|
||||
self killstreakUsePressed();
|
||||
}
|
||||
}
|
||||
|
||||
checkKillstreakReward( streakCount )
|
||||
{
|
||||
streak = streakCount;
|
||||
|
||||
if ( streak < 3 )
|
||||
return;
|
||||
|
||||
if ( !isDefined( self.killStreaks[ streak ] ) )
|
||||
{
|
||||
if ( streak >= 10 && ( streak % 5 == 0 ) )
|
||||
self streakNotify( streak );
|
||||
return;
|
||||
}
|
||||
|
||||
self tryGiveKillstreak( self.killStreaks[ streak ], streak );
|
||||
}
|
||||
|
||||
|
||||
streakNotify( streakVal )
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
wait .05;
|
||||
|
||||
notifyData = spawnStruct();
|
||||
// &&1 Kill Streak!
|
||||
notifyData.titleLabel = &"MP_KILLSTREAK_N";
|
||||
notifyData.titleText = streakVal;
|
||||
|
||||
self maps\_rank::notifyMessage( notifyData );
|
||||
}
|
||||
|
||||
|
||||
rewardNotify( streakName, streakVal )
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
wait .05;
|
||||
|
||||
notifyData = spawnStruct();
|
||||
// &&1 Kill Streak!
|
||||
notifyData.titleLabel = &"MP_KILLSTREAK_N";
|
||||
notifyData.titleText = streakVal;
|
||||
notifyData.notifyText = getKillstreakHint( streakName );
|
||||
notifyData.textIsString = true;
|
||||
// chad - earn dialog not hooked up yet
|
||||
//notifyData.sound = getKillstreakSound( streakName );
|
||||
notifyData.leaderSound = streakName;
|
||||
|
||||
self maps\_rank::notifyMessage( notifyData );
|
||||
}
|
||||
|
||||
|
||||
tryGiveKillstreak( streakName, streakVal )
|
||||
{
|
||||
if ( !isDefined( level._killstreakFuncs[ streakName ] ) )
|
||||
return false;
|
||||
|
||||
if ( isDefined( self.selectingLocation ) )
|
||||
return false;
|
||||
|
||||
if ( isDefined( self.pers[ "killstreak" ] ) )
|
||||
{
|
||||
if ( getStreakCost( streakName ) < getStreakCost( self.pers[ "killstreak" ] ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
self thread rewardNotify( streakName, streakVal );
|
||||
self giveKillstreak( streakName );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
giveKillstreak( streakName )
|
||||
{
|
||||
self notify( "got_killstreak", streakName );
|
||||
|
||||
weapon = getKillstreakWeapon( streakName );
|
||||
|
||||
if ( weapon != "" )
|
||||
{
|
||||
self giveKillstreakWeapon( weapon );
|
||||
}
|
||||
else
|
||||
{
|
||||
self setActionSlot( 4, "" );
|
||||
//self setClientDvar( "ui_killstreak", streakName );
|
||||
}
|
||||
|
||||
self.pers[ "killstreak" ] = streakName;
|
||||
|
||||
if ( isdefined( level._killstreakSetupFuncs[ streakName ] ) )
|
||||
self [[ level._killstreakSetupFuncs[ streakName ] ]]();
|
||||
}
|
||||
|
||||
|
||||
giveKillstreakWeapon( weapon )
|
||||
{
|
||||
self giveWeapon( weapon );
|
||||
self setActionSlot( 4, "weapon", weapon );
|
||||
//self setClientDvar( "ui_killstreak", "" );
|
||||
}
|
||||
|
||||
|
||||
getStreakCost( streakName )
|
||||
{
|
||||
if ( is_coop() )
|
||||
return int( tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 5 ) );
|
||||
else
|
||||
return int( tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 4 ) );
|
||||
}
|
||||
|
||||
|
||||
getKillstreakHint( streakName )
|
||||
{
|
||||
return tableLookupIString( KILLSTREAK_STRING_TABLE, 1, streakName, 6 );
|
||||
}
|
||||
|
||||
|
||||
getKillstreakFailHint( streakName )
|
||||
{
|
||||
return tableLookupIString( KILLSTREAK_STRING_TABLE, 1, streakName, 11 );
|
||||
}
|
||||
|
||||
|
||||
getKillstreakSound( streakName )
|
||||
{
|
||||
return tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 7 );
|
||||
}
|
||||
|
||||
|
||||
getKillstreakDialog( streakName )
|
||||
{
|
||||
return tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 8 );
|
||||
}
|
||||
|
||||
|
||||
getKillstreakWeapon( streakName )
|
||||
{
|
||||
return tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 12 );
|
||||
}
|
||||
|
||||
|
||||
giveOwnedKillstreakItem()
|
||||
{
|
||||
if ( isdefined( self.pers[ "killstreak" ] ) )
|
||||
self giveKillstreak( self.pers[ "killstreak" ] );
|
||||
}
|
||||
|
||||
|
||||
setKillstreaks( streak1, streak2, streak3 )
|
||||
{
|
||||
self.killStreaks = [];
|
||||
|
||||
if ( streak1 != "none" )
|
||||
{
|
||||
streakVal = maps\_killstreaks::getStreakCost( streak1 );
|
||||
assertEx( isDefined( streakVal ) && streakVal != 0, "ERROR: invalid killstreak " + streak1 );
|
||||
self.killStreaks[ streakVal ] = streak1;
|
||||
}
|
||||
|
||||
if ( streak2 != "none" )
|
||||
{
|
||||
streakVal = maps\_killstreaks::getStreakCost( streak2 );
|
||||
assertEx( isDefined( streakVal ) && streakVal != 0, "ERROR: invalid killstreak " + streak2 );
|
||||
self.killStreaks[ streakVal ] = streak2;
|
||||
}
|
||||
|
||||
if ( streak3 != "none" )
|
||||
{
|
||||
streakVal = maps\_killstreaks::getStreakCost( streak3 );
|
||||
assertEx( isDefined( streakVal ) && streakVal != 0, "ERROR: invalid killstreak " + streak3 );
|
||||
self.killStreaks[ streakVal ] = streak3;
|
||||
}
|
||||
}
|
194
maps/_leak.gsc
Normal file
194
maps/_leak.gsc
Normal file
@ -0,0 +1,194 @@
|
||||
#include maps\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
main()
|
||||
{
|
||||
leaks = getentarray( "leaking", "targetname" );
|
||||
if ( !leaks.size )
|
||||
return;
|
||||
|
||||
leaks thread precacheFX();
|
||||
leaks thread methodsInit();
|
||||
|
||||
array_thread( leaks, ::leak_setup );
|
||||
}
|
||||
|
||||
leak_setup()
|
||||
{
|
||||
switch( self.script_noteworthy )
|
||||
{
|
||||
case "barrel_oil":{
|
||||
self leak_barrel_setup();
|
||||
}break;
|
||||
case "barrel_acid":{
|
||||
self leak_barrel_setup();
|
||||
}break;
|
||||
case "barrel_sludge":{
|
||||
self leak_barrel_setup();
|
||||
}break;
|
||||
case "barrel_water":{
|
||||
self leak_barrel_setup();
|
||||
}break;
|
||||
}
|
||||
self thread leak_think();
|
||||
}
|
||||
|
||||
leak_barrel_setup()
|
||||
{
|
||||
self.A = self.origin;
|
||||
self.up = anglestoup( self.angles );
|
||||
worldup = anglestoup( ( 0, 90, 0 ) );
|
||||
|
||||
self.org = self.A + vector_multiply( self.up, 22 );
|
||||
self.A = self.A + vector_multiply( self.up, 1.5 );
|
||||
self.B = self.A + vector_multiply( self.up, 41.4 );
|
||||
self.volume = ( 3.1416 * ( 14 * 14 ) * 42 );// pi * ( r squared ) * height
|
||||
self.curvol = self.volume;
|
||||
|
||||
dot = vectordot( self.up, worldup );
|
||||
top = self.B;
|
||||
if ( dot < 0 )
|
||||
top = self.A;
|
||||
|
||||
dot = abs( 1 - abs( dot ) );
|
||||
|
||||
self.lowZ = ( physicstrace( ( self.org ), ( self.org + ( 0, 0, -80 ) ) ) )[ 2 ];
|
||||
self.highZ = top[ 2 ] + ( dot * 14 );
|
||||
}
|
||||
|
||||
leak_think()
|
||||
{
|
||||
self setcandamage( true );
|
||||
|
||||
self endon( "drained" );
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
self waittill( "damage", damage, other, direction_vec, P, type );
|
||||
if ( type == "MOD_MELEE" || type == "MOD_IMPACT" )
|
||||
continue;
|
||||
|
||||
P = self [[ level._leak_methods[ type ] ]]( P, type );
|
||||
|
||||
if ( !isdefined( P ) )
|
||||
continue;
|
||||
|
||||
self thread leak_drain( P );
|
||||
}
|
||||
}
|
||||
|
||||
leak_drain( P )
|
||||
{
|
||||
Q = pointOnSegmentNearestToPoint( self.A, self.B, P );
|
||||
vec = undefined;
|
||||
|
||||
if ( Q == self.A )
|
||||
vec = vector_multiply( self.up, -1 );
|
||||
else if ( Q == self.B )
|
||||
vec = self.up;
|
||||
else
|
||||
vec = vectorFromLineToPoint( self.A, self.B, P );
|
||||
|
||||
depth = P[ 2 ] - self.lowZ;
|
||||
if ( depth < .02 )
|
||||
depth = 0;
|
||||
|
||||
ratio = ( depth / ( self.highZ - self.lowZ ) ) * self.volume;
|
||||
|
||||
if ( self.curvol > ratio )
|
||||
{
|
||||
while ( self.curvol > ratio )
|
||||
{
|
||||
playfx( level._effect[ "leak_interactive_leak" ][ self.script_noteworthy ], P, vec );
|
||||
self.curvol -= 100;
|
||||
wait .1;
|
||||
}
|
||||
playfx( level._effect[ "leak_interactive_drain" ][ self.script_noteworthy ], P, vec );
|
||||
}
|
||||
if ( ( self.curvol / self.volume ) <= .05 )
|
||||
self notify( "drained" );
|
||||
}
|
||||
|
||||
methodsInit()
|
||||
{
|
||||
level._leak_methods = [];
|
||||
level._leak_methods[ "MOD_UNKNOWN" ] = ::leak_calc_splash;
|
||||
level._leak_methods[ "MOD_PISTOL_BULLET" ] = ::leak_calc_ballistic;
|
||||
level._leak_methods[ "MOD_RIFLE_BULLET" ] = ::leak_calc_ballistic;
|
||||
level._leak_methods[ "MOD_GRENADE" ] = ::leak_calc_splash;
|
||||
level._leak_methods[ "MOD_GRENADE_SPLASH" ] = ::leak_calc_splash;
|
||||
level._leak_methods[ "MOD_PROJECTILE" ] = ::leak_calc_splash;
|
||||
level._leak_methods[ "MOD_PROJECTILE_SPLASH" ] = ::leak_calc_splash;
|
||||
level._leak_methods[ "MOD_MELEE" ] = ::leak_calc_nofx;
|
||||
level._leak_methods[ "MOD_HEAD_SHOT" ] = ::leak_calc_nofx;
|
||||
level._leak_methods[ "MOD_CRUSH" ] = ::leak_calc_nofx;
|
||||
level._leak_methods[ "MOD_TELEFRAG" ] = ::leak_calc_nofx;
|
||||
level._leak_methods[ "MOD_FALLING" ] = ::leak_calc_nofx;
|
||||
level._leak_methods[ "MOD_SUICIDE" ] = ::leak_calc_nofx;
|
||||
level._leak_methods[ "MOD_TRIGGER_HURT" ] = ::leak_calc_splash;
|
||||
level._leak_methods[ "MOD_EXPLOSIVE" ] = ::leak_calc_splash;
|
||||
level._leak_methods[ "MOD_IMPACT" ] = ::leak_calc_nofx;
|
||||
}
|
||||
|
||||
leak_calc_ballistic( P, type )
|
||||
{
|
||||
return P;
|
||||
}
|
||||
|
||||
leak_calc_splash( P, type )
|
||||
{
|
||||
vec = vectornormalize( vectorFromLineToPoint( self.A, self.B, P ) );
|
||||
P = pointOnSegmentNearestToPoint( self.A, self.B, P );
|
||||
return( P + vector_multiply( vec, 4 ) );
|
||||
//return P;
|
||||
}
|
||||
|
||||
leak_calc_nofx( P, type )
|
||||
{
|
||||
return undefined;
|
||||
}
|
||||
|
||||
leak_calc_assert( P, type )
|
||||
{
|
||||
assertMsg( "BUG to MOHAMMAD ALAVI under LEVEL DESIGN. leaking object at (" + self getorigin() + ") was impacted with unknown type: " + type + "." );
|
||||
}
|
||||
|
||||
precacheFX()
|
||||
{
|
||||
for ( i = 0; i < self.size; i++ )
|
||||
{
|
||||
if ( self[ i ].script_noteworthy != "barrel_oil" )
|
||||
continue;
|
||||
|
||||
level._effect[ "leak_interactive_leak" ][ self[ i ].script_noteworthy ] = loadfx( "impacts/barrel_leak" );
|
||||
level._effect[ "leak_interactive_drain" ][ self[ i ].script_noteworthy ] = loadfx( "impacts/barrel_drain" );
|
||||
//level._sound["leak_interactive"][self[i].script_noteworthy] = "mtl_steam_pipe_hit";
|
||||
//level.pipe_fx_time[self[i].script_noteworthy] = 5;
|
||||
|
||||
break;
|
||||
}
|
||||
for ( i = 0; i < self.size; i++ )
|
||||
{
|
||||
if ( self[ i ].script_noteworthy != "barrel_acid" )
|
||||
continue;
|
||||
level._effect[ "leak_interactive_leak" ][ self[ i ].script_noteworthy ] = loadfx( "impacts/barrel_leak" );
|
||||
level._effect[ "leak_interactive_drain" ][ self[ i ].script_noteworthy ] = loadfx( "impacts/barrel_drain" );
|
||||
break;
|
||||
}
|
||||
for ( i = 0; i < self.size; i++ )
|
||||
{
|
||||
if ( self[ i ].script_noteworthy != "barrel_water" )
|
||||
continue;
|
||||
level._effect[ "leak_interactive_leak" ][ self[ i ].script_noteworthy ] = loadfx( "impacts/barrel_leak" );
|
||||
level._effect[ "leak_interactive_drain" ][ self[ i ].script_noteworthy ] = loadfx( "impacts/barrel_drain" );
|
||||
break;
|
||||
}
|
||||
for ( i = 0; i < self.size; i++ )
|
||||
{
|
||||
if ( self[ i ].script_noteworthy != "barrel_sludge" )
|
||||
continue;
|
||||
level._effect[ "leak_interactive_leak" ][ self[ i ].script_noteworthy ] = loadfx( "impacts/barrel_leak" );
|
||||
level._effect[ "leak_interactive_drain" ][ self[ i ].script_noteworthy ] = loadfx( "impacts/barrel_drain" );
|
||||
break;
|
||||
}
|
||||
}
|
267
maps/_leapfrog.gsc
Normal file
267
maps/_leapfrog.gsc
Normal file
@ -0,0 +1,267 @@
|
||||
/**** LEAPFROG SYSTEM ****
|
||||
|
||||
Thread maps\_leapfrog::leapfrog() on any AI that uses a chain of nodes.
|
||||
Make sure to check the NOT_CHAIN check box on each node in the chain to allow chains to merge or loop.
|
||||
You need at least two chains for this to look good.
|
||||
level.leap_delay_min and max determines how fast they try to advance.
|
||||
set script_delay on a node to have the ai use a delay instead of waiting for a leap notify.
|
||||
script_delay = 0 will make them run past that node before going to the next one.
|
||||
|
||||
*************************/
|
||||
|
||||
#include maps\_utility;
|
||||
|
||||
main()
|
||||
{
|
||||
// Set delays to tweak how fast the advance should be.
|
||||
level._leap_delay_min = 6;
|
||||
level._leap_delay_max = 14;
|
||||
level._leap_delay_override = false;
|
||||
|
||||
// there will never be more ai on one leap node then what this is set to.
|
||||
level._leapfrog_max_node_ai = 6;
|
||||
|
||||
level._leap_node_array = [];
|
||||
level._leapfrog_random_int = randomint( 5 );
|
||||
|
||||
// lower threat threatbias group for when leaping.
|
||||
createthreatbiasgroup( "leapfrog" );
|
||||
setthreatbiasagainstall( "leapfrog", -200 );
|
||||
|
||||
level thread leapfrog_masterthread();
|
||||
}
|
||||
|
||||
leapfrog_masterthread()
|
||||
{
|
||||
while ( true )
|
||||
{
|
||||
if ( !level._leap_delay_override )
|
||||
wait( randomFloatRange( level._leap_delay_min, level._leap_delay_max ) );
|
||||
else
|
||||
wait .05;
|
||||
|
||||
level._leap_delay_override = false;
|
||||
|
||||
// used to make ai take the same fork in a path when script_delay is set.
|
||||
level._leapfrog_random_int = randomint( 5 );
|
||||
|
||||
node_arr = [];
|
||||
high_weight = -1000000;
|
||||
|
||||
if ( !level._leap_node_array.size )
|
||||
continue;
|
||||
|
||||
for ( i = 0; i < level._leap_node_array.size; i++ )
|
||||
{
|
||||
weight = level._leap_node_array[ i ].leap_weight;
|
||||
if ( !isdefined( node_arr[ weight ] ) )
|
||||
node_arr[ weight ] = [];
|
||||
node_arr[ weight ][ node_arr[ weight ].size ] = level._leap_node_array[ i ];
|
||||
if ( weight > high_weight )
|
||||
high_weight = weight;
|
||||
}
|
||||
|
||||
assertEx( isdefined( node_arr[ high_weight ] ), "high_weight is: " + high_weight );
|
||||
assertEx( isdefined( high_weight >= 0 ), "high_weight is below zero: " + high_weight );
|
||||
|
||||
node = node_arr[ high_weight ][ randomint( node_arr[ high_weight ].size ) ];
|
||||
|
||||
assert( isdefined( node.target ) );// there should always be a new node or it shouldn't be in the array.
|
||||
|
||||
node_arr = getnodearray( node.target, "targetname" );
|
||||
next_node = node_arr[ randomint( node_arr.size ) ];
|
||||
|
||||
// reset future ai count
|
||||
if ( isdefined( next_node.leapfrog_ai_count ) )
|
||||
next_node.leapfrog_future_ai_count = next_node.leapfrog_ai_count;
|
||||
else
|
||||
next_node.leapfrog_future_ai_count = 0;
|
||||
|
||||
// increase the weight of all none chosen nodes.
|
||||
array_thread( level._leap_node_array, ::increment_leap_weight, node );
|
||||
|
||||
new_weight = int( node.leap_weight * - .25 );
|
||||
|
||||
if ( isdefined( next_node.leap_weight ) )
|
||||
new_weight += next_node.leap_weight;
|
||||
|
||||
add_leap_node( next_node, new_weight );
|
||||
|
||||
node notify( "leapfrog", next_node );
|
||||
remove_leap_node( node );
|
||||
}
|
||||
}
|
||||
|
||||
increment_leap_weight( node )
|
||||
{
|
||||
if ( self == node )
|
||||
return;
|
||||
|
||||
diff_weight = node.leap_weight - self.leap_weight;
|
||||
|
||||
self.leap_weight += ( int( diff_weight * 0.5 ) + 1 );// old .75;
|
||||
}
|
||||
|
||||
leapfrog()
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "stop_leapfrog" );
|
||||
self notify( "stop_going_to_node" );
|
||||
|
||||
// get first node
|
||||
node_arr = getnodearray( self.target, "targetname" );
|
||||
node = node_arr[ randomint( node_arr.size ) ];
|
||||
|
||||
while ( true )
|
||||
{
|
||||
if ( node.radius != 0 )
|
||||
self.goalradius = node.radius;
|
||||
if ( isdefined( node.height ) )
|
||||
self.goalheight = node.height;
|
||||
self setgoalnode( node );
|
||||
|
||||
old_maxsightdistsqrd = self.maxsightdistsqrd;
|
||||
self.maxsightdistsqrd = 350 * 350;
|
||||
old_group = self getthreatbiasgroup();
|
||||
self setthreatbiasgroup( "leapfrog" );
|
||||
|
||||
self waittill( "goal" );
|
||||
|
||||
// Notify the node and pass the guy. Might be good for something
|
||||
node notify( "trigger", self );
|
||||
|
||||
self.maxsightdistsqrd = old_maxsightdistsqrd;
|
||||
self setthreatbiasgroup( old_group );
|
||||
|
||||
self thread leapfrog_on_death( node );
|
||||
|
||||
if ( !isdefined( node.target ) )
|
||||
break;
|
||||
|
||||
if ( isdefined( node.script_delay ) )
|
||||
{
|
||||
node script_delay();
|
||||
node_arr = getnodearray( node.target, "targetname" );
|
||||
next_node = node_arr[ level._leapfrog_random_int % node_arr.size ];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !add_leap_node( node ) )
|
||||
break;
|
||||
|
||||
node waittill( "leapfrog", next_node );
|
||||
|
||||
next_node.leapfrog_future_ai_count++ ;
|
||||
|
||||
max_node_ai = level._leapfrog_max_node_ai;
|
||||
if ( isdefined( node.script_noteworthy ) )
|
||||
max_node_ai = int( node.script_noteworthy );
|
||||
|
||||
if ( next_node.leapfrog_future_ai_count > max_node_ai )
|
||||
{
|
||||
level._leap_delay_override = true;
|
||||
if ( isdefined( next_node.leap_weight ) )
|
||||
{
|
||||
next_node.leap_weight += 1; // make the full node more likely to leap.
|
||||
}
|
||||
next_node = node; // stay on old node.
|
||||
}
|
||||
}
|
||||
|
||||
node = next_node;
|
||||
}
|
||||
|
||||
// notify level and pass the guy that reached his final leapfrog node.
|
||||
level notify( "leapfrog_completed", self );
|
||||
}
|
||||
|
||||
leapfrog_on_death( node )
|
||||
{
|
||||
node endon( "leapfrog" );
|
||||
|
||||
if ( !isdefined( node.leapfrog_ai_count ) )
|
||||
node.leapfrog_ai_count = 0;
|
||||
node.leapfrog_ai_count++ ;
|
||||
|
||||
self waittill( "death" );
|
||||
|
||||
node.leapfrog_ai_count -- ;
|
||||
|
||||
if ( isdefined( node.leap_weight ) )
|
||||
{
|
||||
new_weight = node.leap_weight - 1;
|
||||
if ( new_weight < 1 )
|
||||
new_weight = 1;
|
||||
node.leap_weight = new_weight;
|
||||
}
|
||||
|
||||
if ( !node.leapfrog_ai_count )
|
||||
remove_leap_node( node );
|
||||
}
|
||||
|
||||
add_leap_node( node, weight )
|
||||
{
|
||||
if ( !isdefined( node.target ) || isdefined( node.script_delay ) )
|
||||
return false;
|
||||
|
||||
if ( getdvar( "debug" ) == "1" )
|
||||
node thread debug_leap_node();
|
||||
|
||||
if ( !is_in_array( level._leap_node_array, node ) )
|
||||
{
|
||||
level._leap_node_array = array_add( level._leap_node_array, node );
|
||||
node.leap_weight = 0;
|
||||
}
|
||||
|
||||
if ( isdefined( weight ) )
|
||||
node.leap_weight = weight;
|
||||
else
|
||||
node.leap_weight += 2;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
remove_leap_node( node )
|
||||
{
|
||||
node.leap_weight = undefined;
|
||||
node.leapfrog_ai_count = undefined;
|
||||
|
||||
level._leap_node_array = array_remove( level._leap_node_array, node );
|
||||
}
|
||||
|
||||
/* debug stuff */
|
||||
|
||||
debug_leap_node()
|
||||
{
|
||||
if ( isdefined( self.debug_leapnode ) )
|
||||
return;
|
||||
self.debug_leapnode = true;
|
||||
|
||||
while ( true )
|
||||
{
|
||||
if ( isdefined( self.leap_weight ) )
|
||||
self thread print3Dmessage( self.leap_weight, .5 );
|
||||
if ( isdefined( self.leapfrog_ai_count ) )
|
||||
self thread print3Dmessage( self.leapfrog_ai_count, 0.5, ( 1, 0, 0 ), ( 0, 0, 128 ), 3 );
|
||||
wait .5;
|
||||
}
|
||||
}
|
||||
|
||||
print3Dmessage( message, show_time, color, offset, scale )
|
||||
{
|
||||
if ( !isdefined( color ) )
|
||||
color = ( 0.5, 1, 0.5 );
|
||||
|
||||
if ( !isdefined( offset ) )
|
||||
offset = ( 0, 0, 56 );
|
||||
|
||||
if ( !isdefined( scale ) )
|
||||
scale = 6;
|
||||
|
||||
show_time = gettime() + ( show_time * 1000 );
|
||||
while ( gettime() < show_time )
|
||||
{
|
||||
print3d( self.origin + offset, message, color, 1, scale );
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
653
maps/_lights.gsc
Normal file
653
maps/_lights.gsc
Normal file
@ -0,0 +1,653 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\_utility;
|
||||
|
||||
is_light_entity( ent )
|
||||
{
|
||||
return ent.classname == "light_spot" || ent.classname == "light_omni" || ent.classname == "light";
|
||||
}
|
||||
|
||||
|
||||
// This function never returns.
|
||||
flickerLight( color0, color1, minDelay, maxDelay )
|
||||
{
|
||||
toColor = color0;
|
||||
delay = 0.0;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
fromColor = toColor;
|
||||
toColor = color0 + ( color1 - color0 ) * randomfloat( 1.0 );
|
||||
|
||||
if ( minDelay != maxDelay )
|
||||
delay += randomfloatrange( minDelay, maxDelay );
|
||||
else
|
||||
delay += minDelay;
|
||||
|
||||
colorDeltaPerTime = ( fromColor - toColor ) * ( 1 / delay );
|
||||
while ( delay > 0 )
|
||||
{
|
||||
self setLightColor( toColor + colorDeltaPerTime * delay );
|
||||
wait 0.05;
|
||||
delay -= 0.05;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
generic_pulsing()
|
||||
{
|
||||
self endon( "light_off" );
|
||||
//ChrisC wants the lights off when probes are done
|
||||
if ( getdvar( "r_reflectionProbeGenerate" ) == "1" )
|
||||
{
|
||||
self setLightIntensity( 0 );
|
||||
return;
|
||||
}
|
||||
on = self getLightIntensity();
|
||||
off = .05;
|
||||
curr = on;
|
||||
transition_on = .3;
|
||||
transition_off = .6;
|
||||
increment_on = ( on - off ) / ( transition_on / .05 );
|
||||
increment_off = ( on - off ) / ( transition_off / .05 );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
//ramp down
|
||||
time = 0;
|
||||
while ( ( time < transition_off ) )
|
||||
{
|
||||
curr -= increment_off;
|
||||
curr = clamp( curr, 0, 100 );
|
||||
self setLightIntensity( curr );
|
||||
time += .05;
|
||||
wait( .05 );
|
||||
}
|
||||
|
||||
//off wait time
|
||||
wait( 1 );
|
||||
|
||||
//ramp up
|
||||
time = 0;
|
||||
while ( time < transition_on )
|
||||
{
|
||||
curr += increment_on;
|
||||
curr = clamp( curr, 0, 100 );
|
||||
self setLightIntensity( curr );
|
||||
time += .05;
|
||||
wait( .05 );
|
||||
}
|
||||
|
||||
//on wait time
|
||||
wait( .5 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
generic_double_strobe()
|
||||
{
|
||||
self endon( "light_off" );
|
||||
//ChrisC wants the lights off when probes are done
|
||||
if ( getdvar( "r_reflectionProbeGenerate" ) == "1" )
|
||||
{
|
||||
self setLightIntensity( 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
on = self getLightIntensity();
|
||||
off = .05;
|
||||
linked_models = false;
|
||||
lit_model = undefined;
|
||||
unlit_model = undefined;
|
||||
linked_lights = false;
|
||||
linked_light_ents = [];
|
||||
|
||||
if ( isdefined( self.script_noteworthy ) )
|
||||
{
|
||||
linked_things = getentarray( self.script_noteworthy, "targetname" );
|
||||
for ( i = 0; i < linked_things.size; i++ )
|
||||
{
|
||||
if ( is_light_entity( linked_things[ i ] ) )
|
||||
{
|
||||
linked_lights = true;
|
||||
linked_light_ents[ linked_light_ents.size ] = linked_things[ i ];
|
||||
}
|
||||
if ( linked_things[ i ].classname == "script_model" )
|
||||
{
|
||||
lit_model = linked_things[ i ];
|
||||
unlit_model = getent( lit_model.target, "targetname" );
|
||||
linked_models = true;
|
||||
}
|
||||
}
|
||||
//if (! isdefined ( lit_model ) )
|
||||
// assertmsg( "primary light has lit model but not unlit model ( " + lit_model.origin + " ) " );
|
||||
}
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
//off wait time
|
||||
self setLightIntensity( off );
|
||||
if ( linked_models )
|
||||
{
|
||||
lit_model hide();
|
||||
unlit_model show();
|
||||
}
|
||||
wait( .8 );
|
||||
|
||||
//first flash
|
||||
self setLightIntensity( on );
|
||||
if ( linked_models )
|
||||
{
|
||||
lit_model show();
|
||||
unlit_model hide();
|
||||
}
|
||||
wait( .1 );
|
||||
|
||||
//pause
|
||||
self setLightIntensity( off );
|
||||
if ( linked_models )
|
||||
{
|
||||
lit_model hide();
|
||||
unlit_model show();
|
||||
}
|
||||
wait( .12 );
|
||||
|
||||
//second flash
|
||||
self setLightIntensity( on );
|
||||
if ( linked_models )
|
||||
{
|
||||
lit_model show();
|
||||
unlit_model hide();
|
||||
}
|
||||
wait( .1 );
|
||||
}
|
||||
}
|
||||
|
||||
getclosests_flickering_model( origin )
|
||||
{
|
||||
//stuff in prefabs bleh. non of this script_noteworthy or linkto stuff works there. so doing closest thing with the light_flicker_model targetname
|
||||
array = getentarray( "light_flicker_model", "targetname" );
|
||||
return_array = [];
|
||||
model = getclosest( origin, array );
|
||||
if ( isdefined( model ) )
|
||||
return_array[ 0 ] = model;
|
||||
return return_array;// I'm losing my mind
|
||||
|
||||
}
|
||||
|
||||
generic_flickering()
|
||||
{
|
||||
self endon( "light_off" );
|
||||
//ChrisC wants the lights off when probes are done
|
||||
if ( getdvar( "r_reflectionProbeGenerate" ) == "1" )
|
||||
{
|
||||
self setLightIntensity( 0 );
|
||||
return;
|
||||
}
|
||||
self endon( "stop_dynamic_light_behavior" );
|
||||
self endon( "death" );
|
||||
|
||||
self.linked_models = false;
|
||||
self.lit_model = undefined;
|
||||
self.unlit_model = undefined;
|
||||
self.linked_lights = false;
|
||||
self.linked_light_ents = [];
|
||||
self.linked_prefab_ents = undefined;
|
||||
self.linked_things = [];
|
||||
|
||||
//prefabs need to support targetnames and script_linkTos to so that lights can be set up
|
||||
//by simply linking them to a prefab containing the on/off models instead of jumping through hoops (currently bugged)
|
||||
if ( isdefined( self.script_LinkTo ) )
|
||||
{
|
||||
self.linked_prefab_ents = self get_linked_ents();
|
||||
assertex( self.linked_prefab_ents.size == 2, "Dynamic light at " + self.origin + " needs to script_LinkTo a prefab that contains both on and off light models" );
|
||||
foreach( ent in self.linked_prefab_ents )
|
||||
{
|
||||
if ( ( isdefined( ent.script_noteworthy ) ) && ( ent.script_noteworthy == "on" ) )
|
||||
{
|
||||
self.lit_model = ent;
|
||||
continue;
|
||||
}
|
||||
if ( ( isdefined( ent.script_noteworthy ) ) && ( ent.script_noteworthy == "off" ) )
|
||||
{
|
||||
self.unlit_model = ent;
|
||||
continue;
|
||||
}
|
||||
if ( is_light_entity( ent ) )
|
||||
{
|
||||
self.linked_lights = true;
|
||||
self.linked_light_ents[ self.linked_light_ents.size ] = ent;
|
||||
}
|
||||
}
|
||||
assertex( isdefined( self.lit_model ), "Dynamic light at " + self.origin + " needs to script_LinkTo a prefab contains a script_model light with script_noteworthy of 'on' " );
|
||||
assertex( isdefined( self.unlit_model ), "Dynamic light at " + self.origin + " needs to script_LinkTo a prefab contains a script_model light with script_noteworthy of 'on' " );
|
||||
self.linked_models = true;
|
||||
}
|
||||
|
||||
|
||||
//----------old way of getting linked lights and models....still supported--------------//
|
||||
|
||||
if ( isdefined( self.script_noteworthy ) )
|
||||
self.linked_things = getentarray( self.script_noteworthy, "targetname" );
|
||||
|
||||
if ( ( ! self.linked_things.size ) && ( !isdefined( self.linked_prefab_ents ) ) )
|
||||
self.linked_things = getclosests_flickering_model( self.origin );
|
||||
|
||||
|
||||
for ( i = 0; i < self.linked_things.size; i++ )
|
||||
{
|
||||
if ( is_light_entity( self.linked_things[ i ] ) )
|
||||
{
|
||||
self.linked_lights = true;
|
||||
self.linked_light_ents[ self.linked_light_ents.size ] = self.linked_things[ i ];
|
||||
}
|
||||
if ( self.linked_things[ i ].classname == "script_model" )
|
||||
{
|
||||
self.lit_model = self.linked_things[ i ];
|
||||
self.unlit_model = getent( self.lit_model.target, "targetname" );
|
||||
self.linked_models = true;
|
||||
}
|
||||
}
|
||||
//if (! isdefined ( self.lit_model ) )
|
||||
// assertmsg( "primary light has lit model but not unlit model ( " + self.lit_model.origin + " ) " );
|
||||
|
||||
|
||||
//----------old way of getting linked lights and models....still supported--------------//
|
||||
|
||||
self thread generic_flicker();
|
||||
}
|
||||
|
||||
generic_flicker()
|
||||
{
|
||||
self endon( "stop_dynamic_light_behavior" );
|
||||
self endon( "death" );
|
||||
|
||||
min_flickerless_time = .2;
|
||||
max_flickerless_time = 1.5;
|
||||
|
||||
on = self getLightIntensity();
|
||||
off = 0;
|
||||
curr = on;
|
||||
num = 0;
|
||||
|
||||
//Make the light flicker
|
||||
while( isdefined( self ) )
|
||||
{
|
||||
num = randomintrange( 1, 10 );
|
||||
while ( num )
|
||||
{
|
||||
wait( randomfloatrange( .05, .1 ) );
|
||||
if ( curr > .2 )
|
||||
{
|
||||
curr = randomfloatrange( 0, .3 );
|
||||
if ( self.linked_models )
|
||||
{
|
||||
self.lit_model hide();
|
||||
self.unlit_model show();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
curr = on;
|
||||
if ( self.linked_models )
|
||||
{
|
||||
self.lit_model show();
|
||||
self.unlit_model hide();
|
||||
}
|
||||
}
|
||||
|
||||
self setLightIntensity( curr );
|
||||
if ( self.linked_lights )
|
||||
{
|
||||
for ( i = 0; i < self.linked_light_ents.size; i++ )
|
||||
self.linked_light_ents[ i ] setLightIntensity( curr );
|
||||
}
|
||||
num -- ;
|
||||
}
|
||||
|
||||
self setLightIntensity( on );
|
||||
if ( self.linked_lights )
|
||||
{
|
||||
for ( i = 0; i < self.linked_light_ents.size; i++ )
|
||||
self.linked_light_ents[ i ] setLightIntensity( on );
|
||||
}
|
||||
if ( self.linked_models )
|
||||
{
|
||||
self.lit_model show();
|
||||
self.unlit_model hide();
|
||||
}
|
||||
wait( randomfloatrange( min_flickerless_time, max_flickerless_time ) );
|
||||
}
|
||||
}
|
||||
|
||||
generic_fire_color()
|
||||
{
|
||||
//println("Automagically launched nx_repel_fire.");
|
||||
lights = getEntArray("generic_fire_color", "targetname");
|
||||
for ( i = 0; i < lights.size; i++ )
|
||||
{
|
||||
if ((isdefined ( lights[i].light_color1 ) ) && (isdefined (lights[i].light_color2)))
|
||||
{
|
||||
//println("***********defined***************");
|
||||
//lights[i] thread maps\_lights::flickerLight( lights[i].light_color1, lights[i].light_color2, 0.36, 1.11 );
|
||||
lights[i] thread fireFlickerColor(0.12, 0.25 );
|
||||
}
|
||||
lights[i] thread flickerLightIntensity(0.9, 0.33 );
|
||||
}
|
||||
}
|
||||
|
||||
flickerLightIntensity( minDelay, maxDelay )
|
||||
{
|
||||
on = self getLightIntensity();
|
||||
off = 0;
|
||||
curr = on;
|
||||
num = 0;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
num = randomintrange( 1, 10 );
|
||||
while ( num )
|
||||
{
|
||||
wait( randomfloatrange( .05, .1 ) );
|
||||
if ( curr > .2 )
|
||||
curr = randomfloatrange( 0, .3 );
|
||||
else
|
||||
curr = on;
|
||||
|
||||
self setLightIntensity( curr );
|
||||
num -- ;
|
||||
}
|
||||
|
||||
self setLightIntensity( on );
|
||||
wait( randomfloatrange( minDelay, maxDelay ) );
|
||||
}
|
||||
}
|
||||
|
||||
burning_trash_fire()
|
||||
{
|
||||
full = self getLightIntensity();
|
||||
|
||||
old_intensity = full;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
intensity = randomfloatrange( full * 0.7, full * 1.2 );
|
||||
timer = randomfloatrange( 0.3, 0.6 );
|
||||
timer *= 20;
|
||||
|
||||
for ( i = 0; i < timer; i++ )
|
||||
{
|
||||
new_intensity = intensity * ( i / timer ) + old_intensity * ( ( timer - i ) / timer );
|
||||
|
||||
self setLightIntensity( new_intensity );
|
||||
wait( 0.05 );
|
||||
}
|
||||
|
||||
old_intensity = intensity;
|
||||
}
|
||||
}
|
||||
|
||||
// This function never returns.
|
||||
strobeLight( intensity0, intensity1, period, kill_flag )
|
||||
{
|
||||
frequency = 360 / period;
|
||||
time = 0;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
interpolation = sin( time * frequency ) * 0.5 + 0.5;
|
||||
self setLightIntensity( intensity0 + ( intensity1 - intensity0 ) * interpolation );
|
||||
wait 0.05;
|
||||
time += 0.05;
|
||||
if ( time > period )
|
||||
time -= period;
|
||||
if( isdefined( kill_flag ) )
|
||||
{
|
||||
if( flag( kill_flag ) )
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This function is non - blocking. It will probably need to be moved to code if scripted lights are needed in multiplayer.
|
||||
changeLightColorTo( targetColor, totalTime, accelTime, decelTime )
|
||||
{
|
||||
if ( !isdefined( accelTime ) )
|
||||
accelTime = 0;
|
||||
if ( !isdefined( decelTime ) )
|
||||
decelTime = 0;
|
||||
self thread changeLightColorToWorkerThread( targetColor, totalTime, accelTime, decelTime );
|
||||
}//changeLightColorTo( targetColor, totalTime, accelTime, decelTime )
|
||||
|
||||
// Don't call directly; use 'changeLightColorTo' instead
|
||||
changeLightColorToWorkerThread( targetColor, totalTime, accelTime, decelTime )
|
||||
{
|
||||
// Interpolation goes from 0 to 1 over totalTime, with const acceleration and deceleration given by their respective times.
|
||||
// The descriptive equations are:
|
||||
// midTime = totalTime - accelTime - decelTime
|
||||
// fracAccel = 0.5 * accelRate * accelTime^2
|
||||
// fracConst = velConst * midTime
|
||||
// fracDecel = velConst * decelTime - 0.5 * decelRate * decelTime^2
|
||||
// fracAccel + fracConst + fracDecel = 1
|
||||
// velConst = accelRate * accelTime
|
||||
// velConst = decelRate * decelTime
|
||||
// The unknowns are fracAccel, fracConst, fracDecel, accelRate, decelRate, and velConst. We have six equations and six unknowns.
|
||||
// So, these can be solved to give the following:
|
||||
// accelRate = 2 / ( accelTime * ( totalTime + midTime ) )
|
||||
// decelRate = 2 / ( decelTime * ( totalTime + midTime ) )
|
||||
// velConst = 2 / ( totalTime + midTime )
|
||||
// fracAccel = accelTime / ( totalTime + midTime )
|
||||
// fracDecel = decelTime / ( totalTime + midTime )
|
||||
// fracConst = 2 * midTime / ( totalTime + midTime )
|
||||
|
||||
startColor = self getLightColor();
|
||||
timeFactor = 1 / ( totalTime * 2 - ( accelTime + decelTime ) );
|
||||
time = 0;
|
||||
|
||||
if ( time < accelTime )
|
||||
{
|
||||
halfRate = timeFactor / accelTime;
|
||||
|
||||
while ( time < accelTime )
|
||||
{
|
||||
fraction = halfRate * time * time;
|
||||
self setLightColor( vectorlerp( startColor, targetColor, fraction ) );
|
||||
wait 0.05;
|
||||
time += 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
while ( time < totalTime - decelTime )
|
||||
{
|
||||
fraction = timeFactor * ( 2 * time - accelTime );
|
||||
self setLightColor( vectorlerp( startColor, targetColor, fraction ) );
|
||||
wait 0.05;
|
||||
time += 0.05;
|
||||
}
|
||||
|
||||
time = totalTime - time;
|
||||
if ( time > 0 )
|
||||
{
|
||||
halfRate = timeFactor / decelTime;
|
||||
|
||||
while ( time > 0 )
|
||||
{
|
||||
fraction = 1 - halfRate * time * time;
|
||||
self setLightColor( vectorlerp( startColor, targetColor, fraction ) );
|
||||
wait 0.05;
|
||||
time -= 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
self setLightColor( targetColor );
|
||||
}//changeLightColorToWorkerThread( targetColor, totalTime, accelTime, decelTime )
|
||||
|
||||
changeLightIntensityTo( targetInt, totalTime, accelTime, decelTime )
|
||||
{
|
||||
if ( !isdefined( accelTime ) )
|
||||
accelTime = 0;
|
||||
if ( !isdefined( decelTime ) )
|
||||
decelTime = 0;
|
||||
self thread changeLightIntensityToWorkerThread( targetInt, totalTime, accelTime, decelTime );
|
||||
}//changeLightIntensityTo( targetInt, totalTime, accelTime, decelTime )
|
||||
|
||||
|
||||
// Don't call directly; use 'changeLightColorTo' instead
|
||||
changeLightIntensityToWorkerThread( targetInt, totalTime, accelTime, decelTime )
|
||||
{
|
||||
// Interpolation goes from 0 to 1 over totalTime, with const acceleration and deceleration given by their respective times.
|
||||
// The descriptive equations are:
|
||||
// midTime = totalTime - accelTime - decelTime
|
||||
// fracAccel = 0.5 * accelRate * accelTime^2
|
||||
// fracConst = velConst * midTime
|
||||
// fracDecel = velConst * decelTime - 0.5 * decelRate * decelTime^2
|
||||
// fracAccel + fracConst + fracDecel = 1
|
||||
// velConst = accelRate * accelTime
|
||||
// velConst = decelRate * decelTime
|
||||
// The unknowns are fracAccel, fracConst, fracDecel, accelRate, decelRate, and velConst. We have six equations and six unknowns.
|
||||
// So, these can be solved to give the following:
|
||||
// accelRate = 2 / ( accelTime * ( totalTime + midTime ) )
|
||||
// decelRate = 2 / ( decelTime * ( totalTime + midTime ) )
|
||||
// velConst = 2 / ( totalTime + midTime )
|
||||
// fracAccel = accelTime / ( totalTime + midTime )
|
||||
// fracDecel = decelTime / ( totalTime + midTime )
|
||||
// fracConst = 2 * midTime / ( totalTime + midTime )
|
||||
|
||||
startInt = self getLightIntensity();
|
||||
timeFactor = 1 / ( totalTime * 2 - ( accelTime + decelTime ) );
|
||||
time = 0;
|
||||
|
||||
if ( time < accelTime )
|
||||
{
|
||||
halfRate = timeFactor / accelTime;
|
||||
|
||||
while ( time < accelTime )
|
||||
{
|
||||
fraction = halfRate * time * time;
|
||||
self setLightIntensity(startInt+fraction);
|
||||
wait 0.05;
|
||||
time += 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
while ( time < totalTime - decelTime )
|
||||
{
|
||||
fraction = timeFactor * ( 2 * time - accelTime );
|
||||
self setLightIntensity(startInt+fraction);
|
||||
wait 0.05;
|
||||
time += 0.05;
|
||||
}
|
||||
|
||||
time = totalTime - time;
|
||||
if ( time > 0 )
|
||||
{
|
||||
halfRate = timeFactor / decelTime;
|
||||
|
||||
while ( time > 0 )
|
||||
{
|
||||
fraction = 1 - halfRate * time * time;
|
||||
self setLightIntensity(startInt+fraction);
|
||||
wait 0.05;
|
||||
time -= 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
self setLightIntensity( targetInt );
|
||||
}//changeLightIntensityToWorkerThread( targetInt, totalTime, accelTime, decelTime )
|
||||
|
||||
television()
|
||||
{
|
||||
thread tv_changes_intensity();
|
||||
thread tv_changes_color();
|
||||
}
|
||||
|
||||
tv_changes_intensity()
|
||||
{
|
||||
self endon( "light_off" );
|
||||
full = self getLightIntensity();
|
||||
old_intensity = full;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
intensity = randomfloatrange( full * 0.7, full * 1.2 );
|
||||
timer = randomfloatrange( 0.3, 1.2 );
|
||||
timer *= 20;
|
||||
|
||||
for ( i = 0; i < timer; i++ )
|
||||
{
|
||||
new_intensity = intensity * ( i / timer ) + old_intensity * ( ( timer - i ) / timer );
|
||||
|
||||
self setLightIntensity( new_intensity );
|
||||
wait( 0.05 );
|
||||
}
|
||||
|
||||
old_intensity = intensity;
|
||||
}
|
||||
}
|
||||
|
||||
tv_changes_color()
|
||||
{
|
||||
self endon( "light_off" );
|
||||
|
||||
range = 0.5;
|
||||
base = 0.5;
|
||||
rgb = [];
|
||||
old_rgb = [];
|
||||
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
rgb[ i ] = 0;
|
||||
old_rgb[ i ] = 0;
|
||||
}
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
for ( i = 0; i < rgb.size; i++ )
|
||||
{
|
||||
old_rgb[ i ] = rgb[ i ];
|
||||
rgb[ i ] = randomfloat( range ) + base;
|
||||
}
|
||||
|
||||
timer = randomfloatrange( 0.3, 1.2 );
|
||||
timer *= 20;
|
||||
|
||||
for ( i = 0; i < timer; i++ )
|
||||
{
|
||||
new_rgb = [];
|
||||
for ( p = 0; p < rgb.size; p++ )
|
||||
{
|
||||
new_rgb[ p ] = rgb[ p ] * ( i / timer ) + old_rgb[ p ] * ( ( timer - i ) / timer );
|
||||
}
|
||||
|
||||
self setLightColor( ( new_rgb[ 0 ], new_rgb[ 1 ], new_rgb[ 2 ] ) );
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fireFlickerColor( minDelay, maxDelay )
|
||||
{
|
||||
colors = [];
|
||||
colors = array_add( colors, self._color);
|
||||
colors = array_add( colors, self.light_color1);
|
||||
colors = array_add( colors, self.light_color2);
|
||||
on = self getLightIntensity();
|
||||
curr = on;
|
||||
for( ; ; )
|
||||
{
|
||||
time = 0;
|
||||
transition_off = randomfloatrange( minDelay, maxDelay );
|
||||
transition_on = randomfloatrange( minDelay, maxDelay );
|
||||
wait( randomfloatrange( .05, .1 ) ); //*
|
||||
nextColor = colors[randomintrange(0,2)];
|
||||
//println(nextColor);
|
||||
self changeLightColorTo(nextColor, (transition_on+transition_off), transition_on, transition_off);
|
||||
//on wait time
|
||||
wait( randomfloatrange( minDelay, maxDelay ) );
|
||||
if ( curr > .2 )
|
||||
curr = randomfloatrange( 0, .3 );
|
||||
else
|
||||
curr = on;
|
||||
self setLightIntensity( curr );
|
||||
}
|
||||
}//fireFlickerColor( minDelay, maxDelay )
|
320
maps/_littlebird.gsc
Normal file
320
maps/_littlebird.gsc
Normal file
@ -0,0 +1,320 @@
|
||||
#include maps\_vehicle;
|
||||
#include maps\_vehicle_aianim;
|
||||
#using_animtree( "vehicles" );
|
||||
|
||||
/*QUAKED script_vehicle_littlebird_armed (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
valid ai groups are:
|
||||
"first_guys" - left and right side guys that need to be on first
|
||||
"left" - all left guys
|
||||
"right" - all right guys
|
||||
"passengers" - everybody that can unload
|
||||
"default"
|
||||
|
||||
|
||||
maps\_littlebird::main( "vehicle_little_bird_armed" );
|
||||
|
||||
|
||||
include,vehicle_littlebird_armed
|
||||
sound,vehicle_littlebird,vehicle_standard,all_sp
|
||||
include,_attack_heli
|
||||
|
||||
|
||||
defaultmdl="vehicle_little_bird_armed"
|
||||
default:"vehicletype" "littlebird"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
/*QUAKED script_vehicle_littlebird_bench (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
valid ai groups are:
|
||||
"first_guys" - left and right side guys that need to be on first
|
||||
"left" - all left guys
|
||||
"right" - all right guys
|
||||
"passengers" - everybody that can unload
|
||||
"default"
|
||||
|
||||
|
||||
maps\_littlebird::main( "vehicle_little_bird_bench" );
|
||||
|
||||
|
||||
include,vehicle_littlebird_bench
|
||||
sound,vehicle_littlebird,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_little_bird_bench"
|
||||
default:"vehicletype" "littlebird"
|
||||
default:"script_team" "axis"
|
||||
*/
|
||||
|
||||
|
||||
armed( model )
|
||||
{
|
||||
return model == "vehicle_little_bird_armed";
|
||||
}
|
||||
|
||||
main( model, type )
|
||||
{
|
||||
if ( armed( model ) )
|
||||
{
|
||||
maps\_attack_heli::preLoad();
|
||||
}
|
||||
|
||||
build_template( "littlebird", model, type );
|
||||
build_localinit( ::init_local );
|
||||
build_deathmodel( "vehicle_little_bird_armed" );
|
||||
build_deathmodel( "vehicle_little_bird_bench" );
|
||||
build_drive( %mi28_rotors, undefined, 0, 3.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", "littlebird_helicopter_secondary_exp", undefined, undefined, undefined, 0.0, true );
|
||||
build_deathfx( "fire/fire_smoke_trail_L", "tag_engine", "littlebird_helicopter_dying_loop", true, 0.05, true, 0.5, true );
|
||||
build_deathfx( "explosions/helicopter_explosion_secondary_small", "tag_engine", "littlebird_helicopter_secondary_exp", undefined, undefined, undefined, 2.5, true );
|
||||
build_deathfx( "explosions/helicopter_explosion_little_bird", undefined, "littlebird_helicopter_crash", undefined, undefined, undefined, - 1, undefined, "stop_crash_loop_sound" );
|
||||
|
||||
//Death by Rocket effects, explodes immediatly
|
||||
build_rocket_deathfx( "explosions/aerial_explosion_littlebird", "tag_deathfx", "littlebird_helicopter_crash",undefined, undefined, undefined, undefined, true, undefined, 0 );
|
||||
|
||||
build_deathquake( 0.8, 1.6, 2048 );
|
||||
build_treadfx();
|
||||
build_life( 799 );
|
||||
build_team( "axis" );
|
||||
build_mainturret();
|
||||
build_unload_groups( ::unload_groups );
|
||||
build_aianims( ::setanims, ::set_vehicle_anims ); //hi this is text
|
||||
|
||||
randomStartDelay = randomfloatrange( 0, 1 );
|
||||
build_light( model, "white_blink", "TAG_LIGHT_BELLY", "misc/aircraft_light_white_blink", "running", randomStartDelay );
|
||||
build_light( model, "red_blink1", "TAG_LIGHT_TAIL1", "misc/aircraft_light_red_blink", "running", randomStartDelay );
|
||||
build_light( model, "red_blink2", "TAG_LIGHT_TAIL2", "misc/aircraft_light_red_blink", "running", randomStartDelay );
|
||||
|
||||
mapname = getdvar( "mapname" );
|
||||
if ( !isdefined( level._script ) )
|
||||
level._script = tolower( mapname );
|
||||
|
||||
turret = "minigun_littlebird_spinnup";
|
||||
if ( use_old_turret() )
|
||||
turret = "minigun_littlebird";
|
||||
|
||||
build_turret( turret, "TAG_MINIGUN_ATTACH_LEFT", "vehicle_little_bird_minigun_left" );
|
||||
build_turret( turret, "TAG_MINIGUN_ATTACH_RIGHT", "vehicle_little_bird_minigun_right" );
|
||||
}
|
||||
|
||||
use_old_turret()
|
||||
{
|
||||
return ( issubstr( level._script, "oilrig" ) );
|
||||
}
|
||||
|
||||
init_local()
|
||||
{
|
||||
self endon( "death" );
|
||||
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.delete_on_death = true;
|
||||
self.script_badplace = false;// All helicopters dont need to create bad places
|
||||
self.dontDisconnectPaths = true; //so it can land. pathing through heli's generally not a problem
|
||||
|
||||
// set ent flag prep_unload before the unload node.
|
||||
self thread littlebird_landing();
|
||||
thread maps\_vehicle::lights_on( "running" );
|
||||
|
||||
waittillframeend; // wait for turrets to get setup
|
||||
|
||||
if ( !use_old_turret() )
|
||||
{
|
||||
foreach ( turret in self.mgturret )
|
||||
{
|
||||
turret Setautorotationdelay( 4 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( armed( self.model ) )
|
||||
return;
|
||||
|
||||
|
||||
self mgOff();
|
||||
foreach ( turret in self.mgturret )
|
||||
{
|
||||
turret hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
set_vehicle_anims( positions )
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
#using_animtree( "generic_human" );
|
||||
setanims()
|
||||
{
|
||||
level._scr_anim[ "generic" ][ "stage_littlebird_right" ] = %little_bird_premount_guy3;
|
||||
level._scr_anim[ "generic" ][ "stage_littlebird_left" ] = %little_bird_premount_guy3;
|
||||
|
||||
positions = [];
|
||||
for ( i = 0;i < 8;i++ )
|
||||
positions[ i ] = spawnstruct();
|
||||
|
||||
positions[ 0 ].sittag = "tag_pilot1";
|
||||
positions[ 1 ].sittag = "tag_pilot2";
|
||||
positions[ 2 ].sittag = "tag_detach_right";
|
||||
positions[ 3 ].sittag = "tag_detach_right";
|
||||
positions[ 4 ].sittag = "tag_detach_right";
|
||||
positions[ 5 ].sittag = "tag_detach_left";
|
||||
positions[ 6 ].sittag = "tag_detach_left";
|
||||
positions[ 7 ].sittag = "tag_detach_left";
|
||||
|
||||
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[ 2 ].idle[ 0 ] = %little_bird_casual_idle_guy1;
|
||||
positions[ 3 ].idle[ 0 ] = %little_bird_casual_idle_guy3;
|
||||
positions[ 4 ].idle[ 0 ] = %little_bird_casual_idle_guy2;
|
||||
positions[ 5 ].idle[ 0 ] = %little_bird_casual_idle_guy1;
|
||||
positions[ 6 ].idle[ 0 ] = %little_bird_casual_idle_guy3;
|
||||
positions[ 7 ].idle[ 0 ] = %little_bird_casual_idle_guy2;
|
||||
positions[ 2 ].idleoccurrence[ 0 ] = 100;
|
||||
positions[ 3 ].idleoccurrence[ 0 ] = 166;
|
||||
positions[ 4 ].idleoccurrence[ 0 ] = 122;
|
||||
positions[ 5 ].idleoccurrence[ 0 ] = 177;
|
||||
positions[ 6 ].idleoccurrence[ 0 ] = 136;
|
||||
positions[ 7 ].idleoccurrence[ 0 ] = 188;
|
||||
|
||||
positions[ 2 ].idle[ 1 ] = %little_bird_aim_idle_guy1;
|
||||
positions[ 3 ].idle[ 1 ] = %little_bird_aim_idle_guy3;
|
||||
positions[ 4 ].idle[ 1 ] = %little_bird_aim_idle_guy2;
|
||||
positions[ 5 ].idle[ 1 ] = %little_bird_aim_idle_guy1;
|
||||
// positions[ 6 ].idle[ 1 ] = %little_bird_aim_idle_guy3;
|
||||
positions[ 7 ].idle[ 1 ] = %little_bird_aim_idle_guy2;
|
||||
positions[ 2 ].idleoccurrence[ 1 ] = 200;
|
||||
positions[ 3 ].idleoccurrence[ 1 ] = 266;
|
||||
positions[ 4 ].idleoccurrence[ 1 ] = 156;
|
||||
positions[ 5 ].idleoccurrence[ 1 ] = 277;
|
||||
// positions[ 6 ].idleoccurrence[ 1 ] = 246;
|
||||
positions[ 7 ].idleoccurrence[ 1 ] = 288;
|
||||
|
||||
positions[ 2 ].idle_alert = %little_bird_alert_idle_guy1;
|
||||
positions[ 3 ].idle_alert = %little_bird_alert_idle_guy3;
|
||||
positions[ 4 ].idle_alert = %little_bird_alert_idle_guy2;
|
||||
|
||||
positions[ 5 ].idle_alert = %little_bird_alert_idle_guy1;
|
||||
positions[ 6 ].idle_alert = %little_bird_alert_idle_guy3;
|
||||
positions[ 7 ].idle_alert = %little_bird_alert_idle_guy2;
|
||||
|
||||
positions[ 2 ].idle_alert_to_casual = %little_bird_alert_2_aim_guy1;
|
||||
positions[ 3 ].idle_alert_to_casual = %little_bird_alert_2_aim_guy3;
|
||||
positions[ 4 ].idle_alert_to_casual = %little_bird_alert_2_aim_guy2;
|
||||
|
||||
positions[ 5 ].idle_alert_to_casual = %little_bird_alert_2_aim_guy1;
|
||||
positions[ 6 ].idle_alert_to_casual = %little_bird_alert_2_aim_guy3;
|
||||
positions[ 7 ].idle_alert_to_casual = %little_bird_alert_2_aim_guy2;
|
||||
|
||||
positions[ 2 ].getout = %little_bird_dismount_guy1;
|
||||
positions[ 3 ].getout = %little_bird_dismount_guy3;
|
||||
positions[ 4 ].getout = %little_bird_dismount_guy2;
|
||||
positions[ 5 ].getout = %little_bird_dismount_guy1;
|
||||
positions[ 6 ].getout = %little_bird_dismount_guy3;
|
||||
positions[ 7 ].getout = %little_bird_dismount_guy2;
|
||||
|
||||
positions[ 2 ].littlebirde_getout_unlinks = true;
|
||||
positions[ 3 ].littlebirde_getout_unlinks = true;
|
||||
positions[ 4 ].littlebirde_getout_unlinks = true;
|
||||
|
||||
positions[ 5 ].littlebirde_getout_unlinks = true;
|
||||
positions[ 6 ].littlebirde_getout_unlinks = true;
|
||||
positions[ 7 ].littlebirde_getout_unlinks = true;
|
||||
|
||||
positions[ 2 ].getin = %little_bird_mount_guy1;
|
||||
positions[ 2 ].getin_enteredvehicletrack = "mount_finish";
|
||||
positions[ 3 ].getin = %little_bird_mount_guy3;
|
||||
positions[ 3 ].getin_enteredvehicletrack = "mount_finish";
|
||||
positions[ 4 ].getin = %little_bird_mount_guy2;
|
||||
positions[ 4 ].getin_enteredvehicletrack = "mount_finish";
|
||||
positions[ 5 ].getin = %little_bird_mount_guy1;
|
||||
positions[ 5 ].getin_enteredvehicletrack = "mount_finish";
|
||||
positions[ 6 ].getin = %little_bird_mount_guy3;
|
||||
positions[ 6 ].getin_enteredvehicletrack = "mount_finish";
|
||||
positions[ 7 ].getin = %little_bird_mount_guy2;
|
||||
positions[ 7 ].getin_enteredvehicletrack = "mount_finish";
|
||||
|
||||
positions[ 2 ].getin_idle_func = ::guy_idle_alert;
|
||||
positions[ 3 ].getin_idle_func = ::guy_idle_alert;
|
||||
positions[ 4 ].getin_idle_func = ::guy_idle_alert;
|
||||
positions[ 5 ].getin_idle_func = ::guy_idle_alert;
|
||||
positions[ 6 ].getin_idle_func = ::guy_idle_alert;
|
||||
positions[ 7 ].getin_idle_func = ::guy_idle_alert;
|
||||
|
||||
positions[ 2 ].pre_unload = %little_bird_aim_2_prelanding_guy1;
|
||||
positions[ 3 ].pre_unload = %little_bird_aim_2_prelanding_guy3;
|
||||
positions[ 4 ].pre_unload = %little_bird_aim_2_prelanding_guy2;
|
||||
|
||||
positions[ 5 ].pre_unload = %little_bird_aim_2_prelanding_guy1;
|
||||
positions[ 6 ].pre_unload = %little_bird_aim_2_prelanding_guy3;
|
||||
positions[ 7 ].pre_unload = %little_bird_aim_2_prelanding_guy2;
|
||||
|
||||
positions[ 2 ].pre_unload_idle = %little_bird_prelanding_idle_guy1;
|
||||
positions[ 3 ].pre_unload_idle = %little_bird_prelanding_idle_guy3;
|
||||
positions[ 4 ].pre_unload_idle = %little_bird_prelanding_idle_guy2;
|
||||
|
||||
positions[ 5 ].pre_unload_idle = %little_bird_prelanding_idle_guy1;
|
||||
positions[ 6 ].pre_unload_idle = %little_bird_prelanding_idle_guy3;
|
||||
positions[ 7 ].pre_unload_idle = %little_bird_prelanding_idle_guy2;
|
||||
|
||||
positions[ 0 ].bHasGunWhileRiding = false;
|
||||
positions[ 1 ].bHasGunWhileRiding = false;
|
||||
|
||||
return positions;
|
||||
|
||||
}
|
||||
|
||||
|
||||
unload_groups()
|
||||
{
|
||||
unload_groups = [];
|
||||
unload_groups[ "first_guy_left" ] = [];
|
||||
unload_groups[ "first_guy_right" ] = [];
|
||||
|
||||
unload_groups[ "left" ] = [];
|
||||
unload_groups[ "right" ] = [];
|
||||
unload_groups[ "passengers" ] = [];
|
||||
unload_groups[ "default" ] = [];
|
||||
|
||||
unload_groups[ "first_guy_left" ][ 0 ] = 5;
|
||||
unload_groups[ "first_guy_right" ][ 0 ] = 2;
|
||||
|
||||
unload_groups[ "stage_guy_left" ][ 0 ] = 7;
|
||||
unload_groups[ "stage_guy_right" ][ 0 ] = 4;
|
||||
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 5;
|
||||
unload_groups[ "left" ][ unload_groups[ "left" ].size ] = 6;
|
||||
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 ] = 4;
|
||||
|
||||
unload_groups[ "passengers" ][ unload_groups[ "passengers" ].size ] = 2;
|
||||
unload_groups[ "passengers" ][ unload_groups[ "passengers" ].size ] = 3;
|
||||
unload_groups[ "passengers" ][ unload_groups[ "passengers" ].size ] = 4;
|
||||
unload_groups[ "passengers" ][ unload_groups[ "passengers" ].size ] = 5;
|
||||
unload_groups[ "passengers" ][ unload_groups[ "passengers" ].size ] = 6;
|
||||
unload_groups[ "passengers" ][ unload_groups[ "passengers" ].size ] = 7;
|
||||
|
||||
unload_groups[ "default" ] = unload_groups[ "passengers" ];
|
||||
|
||||
return unload_groups;
|
||||
}
|
||||
|
26
maps/_littlebird_player.gsc
Normal file
26
maps/_littlebird_player.gsc
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
/*QUAKED script_vehicle_littlebird_player (1 0 0) (-16 -16 -24) (16 16 32) USABLE SPAWNER
|
||||
|
||||
valid ai groups are:
|
||||
"first_guys" - left and right side guys that need to be on first
|
||||
"left" - all left guys
|
||||
"right" - all right guys
|
||||
"passengers" - everybody that can unload
|
||||
"default"
|
||||
|
||||
|
||||
maps\_littlebird_player::main( "vehicle_little_bird_bench" );
|
||||
|
||||
|
||||
include,vehicle_littlebird_bench
|
||||
sound,vehicle_littlebird,vehicle_standard,all_sp
|
||||
|
||||
defaultmdl="vehicle_little_bird_bench"
|
||||
default:"vehicletype" "littlebird_player"
|
||||
default:"script_team" "allies"
|
||||
*/
|
||||
|
||||
main( model, type )
|
||||
{
|
||||
maps\_littlebird::main( model, "littlebird_player" );
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user