Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!#include maps\blackout_code;
// ...
main()
{
// ...
wait( 5 );
setsaveddvar( "cg_cinematicFullScreen", "0" );
for ( ;; )
{
flag_wait( "hut_tv_on" );
thread loop_cinematic();
flag_waitopen( "hut_tv_on" );
level notify( "stop_cinematic" );
StopCinematicInGame();
}
}
loop_cinematic()
{
level endon( "stop_cinematic" );
for ( ;; )
{
if ( getdvar("ps3Game") == "true" )
CinematicInGameLoopFromFastfile( "asad_speech_180" );
else
CinematicInGameLoopResident( "asad_speech_180" );
wait 5;
while ( IsCinematicPlaying() )
wait 1;
}
}
walking_the_stream()
{
// ...
thread hut_tv();
// ...
}
blackout_code.gsc
hut_tv()
{
// tv turns off when it gets shot
thread bbc_voice();
light = getent( "tv_light", "targetname" );
light thread maps\_lights::television();
// did the tv get shot?
wait_for_targetname_trigger( "tv_trigger" );
light notify( "light_off" );
light setLightIntensity( 0 );
level.bbc_voice stopsounds();
level.bbc_voice notify( "stopsounds" );
wait( 0.05 );
level.bbc_voice delete();
}
blackout.map
Code:
// entity 1446
{
"_color" "0.000000 1.000000 1.000000"
"script_flag" "tv_movie"
"targetname" "flag_set_touching"
"classname" "trigger_multiple"
// brush 0
{
( -13637.5 -8203.5 -26 ) ( -13952.5 -8320.5 -26 ) ( -13880 -8515.5 -26 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13871 -8515.5 75 ) ( -13943.5 -8320.5 75 ) ( -13628.5 -8203.5 75 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13865 -8488.5 32 ) ( -13550 -8371.5 32 ) ( -13550 -8371.5 16 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13575 -8397.5 32 ) ( -13647.5 -8202.5 32 ) ( -13647.5 -8202.5 16 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13616.5 -8203.5 32 ) ( -13931.5 -8320.5 32 ) ( -13931.5 -8320.5 16 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13712 -8449 75 ) ( -13715 -8441 75 ) ( -13712 -8449 107 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
}
// brush 1
{
( -13637.5 -8203.5 -26 ) ( -13952.5 -8320.5 -26 ) ( -13880 -8515.5 -26 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13871 -8515.5 75 ) ( -13943.5 -8320.5 75 ) ( -13628.5 -8203.5 75 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13864 -8502.5 32 ) ( -13549 -8385.5 32 ) ( -13549 -8385.5 16 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13616.5 -8203.5 32 ) ( -13931.5 -8320.5 32 ) ( -13931.5 -8320.5 16 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13931.5 -8320.5 32 ) ( -13859 -8515.5 32 ) ( -13859 -8515.5 16 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13715 -8441 75 ) ( -13712 -8449 75 ) ( -13712 -8449 107 ) flag 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
}
}
// entity 3376
{
"_color" "0.000000 1.000000 1.000000"
"script_flag" "hut_tv_on"
"targetname" "flag_set_touching"
"classname" "trigger_multiple"
// brush 0
{
( -13613.939 -8259.5713 -26 ) ( -13928.939 -8376.5713 -26 ) ( -13856.439 -8571.5713 -26 ) flag 64 64 23.560547 56.071289 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13847.439 -8571.5713 75 ) ( -13919.939 -8376.5713 75 ) ( -13604.939 -8259.5713 75 ) flag 64 64 23.560547 56.071289 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13910.8 -8605.2002 -26 ) ( -13910.8 -8605.2002 75 ) ( -13575.4 -8451.4004 75 ) flag 64 64 23.560547 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13558.2 -7974.6006 75 ) ( -13558.2 -7974.6006 -26 ) ( -13549 -8412.4004 -26 ) flag 64 64 -56.071289 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13566.2 -7984.2002 -26 ) ( -13566.2 -7984.2002 75 ) ( -13977 -8290 75 ) flag 64 64 23.560547 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -13910.8 -8605.2002 75 ) ( -13910.8 -8605.2002 -26 ) ( -13995.4 -8320.4004 -26 ) flag 64 64 -56.071289 0 0 0 lightmap_gray 16384 16384 0 0 0 0
}
}
model used: com_tv1_cinematic
it has a tag_origin and a tag_fx, moreover there are two mesh groups (second mesh is the screen surface)
_interactive_objects.gsc
Code:
main()
{
//...
tv_array = getentarray( "interactive_tv", "targetname" );
// precaching etc.
array_thread( getentarray( "interactive_tv", "targetname" ), ::tv_logic );
// ...
}
tv_logic()
{
self setcandamage( true );
self.damagemodel = undefined;
self.offmodel = undefined;
self.damagemodel = "com_tv2_d";
self.offmodel = "com_tv2";
self.onmodel = "com_tv2_testpattern";
if ( issubstr( self.model, "1" ) )
{
self.offmodel = "com_tv1";
self.onmodel = "com_tv1_testpattern";
}
self.usetrig = getent( self.target, "targetname" );
self.usetrig usetriggerrequirelookat();
self.usetrig setcursorhint( "HINT_NOICON" );
array = get_array_of_closest( self.origin, level.tv_lite_array, undefined, undefined, 64 );
if ( array.size )
{
self.lite = array[ 0 ];
level.tv_lite_array = array_remove( level.tv_lite_array, self.lite );
self.liteintensity = self.lite getLightIntensity();
}
self thread tv_damage();
self thread tv_off();
}
tv_off()
{
self.usetrig endon( "death" );
while ( 1 )
{
wait .2;
self.usetrig waittill( "trigger" );
// it would be nice to play a sound here
self notify( "off" );
if ( self.model == self.offmodel )
{
self setmodel( self.onmodel );
if ( isdefined( self.lite ) )
self.lite setLightIntensity( self.liteintensity );
}
else
{
self setmodel( self.offmodel );
if ( isdefined( self.lite ) )
self.lite setLightIntensity( 0 );
}
}
}
tv_damage()
{
for ( ;; )
{
self waittill( "damage", damage, other, direction_vec, P, type );
if ( flag( "no_ai_tv_damage" ) )
{
if ( !isalive( other ) )
continue;
if ( other != level.player )
continue;
}
break;
}
if ( isdefined( level.tvhook ) )
[[ level.tvhook ]]();
self notify( "off" );
self.usetrig notify( "death" );
self setmodel( self.damagemodel );
if ( isdefined( self.lite ) )
self.lite setLightIntensity( 0 );
playfxontag( level.breakables_fx[ "tv_explode" ], self, "tag_fx" );
self playsound( "tv_shot_burst" );
self.usetrig delete();
}
name,sequence,file,platform,vol_min,vol_max,pitch_min,pitch_max,dist_min,dist_max,dist_reverb_max,limit_count,limit_type,entity_limit_count,entity_limit_type,bus,priority,spatialized,type,probability,loop,masterslave,loadspec,reverb_falloff_curve,subtitle,compression,randomize_type,secondaryaliasname,chainaliasname,volumefalloffcurve,startdelay,speakermap,reverb_send,lfe percentage,center percentage,platform,envelop_min,envelop_max,envelop percentage,occlusion_level,min_priority,max_priority,min_priority_threshold,max_priority_threshold,distance_lpf
# Ambient SFX - Static,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
ambient_custom0,,ambient_custom/air_conditioner.wav,!wii,1,1,1,1,,,,,,,,ambience,,2d,streamed,,looping,,all_sp,,,,,,,,,ambience,,,,,,,,,,,,,
ambient_custom1,,ambient_custom/alarm_0.wav,!wii,0.9,1,1,1,,,,,,,,ambience,,2d,streamed,,looping,,all_sp,,,,,,,,,ambience,,,,,,,,,,,,,