Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 10 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: How to play cinematics in-game
*Delta*Obi-Wan
General Member
Since: Jul 16, 2007
Posts: 233
Last: Dec 24, 2010
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Friday, May. 15, 2009 03:09 pm
Just like in the blackout mission i want to have a tv playing a cinematic, i believe i can get the sound to work, but i cant seem to get cinematics to play. Any ideas [confused]
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Friday, May. 15, 2009 10:32 pm
i looked at this stuff some time ago, but didn't try to put custom videos in the game. i'll investigate more
Share |
*Delta*Obi-Wan
General Member
Since: Jul 16, 2007
Posts: 233
Last: Dec 24, 2010
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Saturday, May. 16, 2009 02:24 pm
Please post your results as soon as you discover something new.
Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD4 MP Mapping
Posted: Saturday, May. 16, 2009 02:29 pm
I know they use the bik format for those in-game tv's, if you do a search for "tv" in the blackout scripts you'll probably get your answer.
Share |
*Delta*Obi-Wan
General Member
Since: Jul 16, 2007
Posts: 233
Last: Dec 24, 2010
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Saturday, May. 16, 2009 04:36 pm
I did that, but i think there is more to it than just code, there is a texture called cinematic_3d, or a tv that had cinmatic in it. If someone could see the blackout map for the tv i see what it is ( my comp is too slow and i cant see it myself )
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Saturday, May. 16, 2009 06:22 pm
blackout.gsc
Code:

#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
Code:
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();
}


there are 3 different models, "onmodel", "offmodel" and "damagemodel"

in front of the screen is a trigger_damage, which is used to switch to the destroyed tv model when the player applies damage.

a trigger_use which requires lookat is used to allow the player to turn the tv on and off.

there's also a scripted light involved to make the tv gleam more realistic.

3 trigger_multiple are placed surrounding the house with the tv. they set two script flags to activate the tv logic (on, off, destroy and cinematic playback).

CinematicInGameLoopResident( "asad_speech_180" ); plays the main\video\asad_speech_180.bik on the tv screen. you may look up the cinematic functions in the script docs: http://www.zeroy.com/script/

it looks ingame like the cinematic video is mapped onto the screen mesh of the tv model. so it's apprently hardcoded for the material name "cinematic_3d", meaning that the model you want to play the cinematic on has to have a material called "cinematic_3d" applied where you want the video.

as you can't call the cinematic functions on an entity, it's apprently impossible to play more than 1 video at the same time (you can play one video on one or more models but not 2 or more different videos). it might be possible to scale the material in a way, that only the upper left part shows for instance. for the next screen you create another model with the right upper part of the cinematic_3d material on it. it should look like if different videos were playing.

to view and convert Bink (*.bik) videos, get the free RAD Video Tools:
http://www.radgametools.com/bnkdown.htm


i copied the IW_logo.bik and called it asad_speech_180.bik with success:



please give feedback :)

edited on May. 16, 2009 02:33 pm by Sevenz
Share |
*Delta*Obi-Wan
General Member
Since: Jul 16, 2007
Posts: 233
Last: Dec 24, 2010
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Saturday, May. 16, 2009 07:06 pm
Woah, thanks for the biig code, its gonna take a while to test it.. Gonna post feedback as soon as done
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Saturday, May. 16, 2009 10:46 pm
something went wrong with my modified tv-model, not sure how to set up the cinematic_3d material properly. anyone else?
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Sunday, May. 17, 2009 02:07 am
got it working. it's indeed the cinematic_3d material. the reason why it didn't play the video was, that i couldn't see the video, but it was actually there. make sure you apply the color white to everything in Maya before you export! otherwise the model will be entirely black and you won't see the cinematic.




note:
there seems to be a filesize CinematicInGameLoopResident() of 7,449,600 byte (7.1 MB). For larger videos, you have to build them into fastfile:
rawfile,video/NAME.bik

edited on May. 16, 2009 10:12 pm by Sevenz
Share |
*Delta*Obi-Wan
General Member
Since: Jul 16, 2007
Posts: 233
Last: Dec 24, 2010
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Sunday, May. 17, 2009 08:02 am
Dont know much about Mya, but there is a texture called cinematic_3d, maybe it can be used for big screens, like a cinema for example
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»