Page 1 of 2

Textures and animation

Posted: May 5th, 2012, 11:13 am
by ThaWalrus
Hi CoDJumper,

I have a question about a function in CoD called "videoMap", it's used in .shader files (files to change textures).

I made this:

Code: Select all

textures/thawalrus/thawalrus
{
	surfaceparm		nolightmap

	{
		videomap	iw_logo.roq
	 	rgbGen		identity
	}
}
If I place this texture in my map, compile it and play the map, the console will say this:

Code: Select all

SCR_PlayCinematic( iw_logo.roq )
trFMV::play(), playing iw_logo.roq
What means that the movie is playing. It's the same when I change a menu for playing a roq movie:

Code: Select all

		itemDef
		{
			visible 		1
			rect			64 32 512 416
	 		style			WINDOW_STYLE_CINEMATIC
			cinematic		"iw_logo.roq"
			decoration
		}
But, the problem is that the menu will play roq files(pretty cool btw). But the texture will be black..

Can somebody help me, or tell me what I am doing wrong?

Greetz Walrus

PS: It is possible, I'm sure, to play roq files at textures:
Image

Re: Textures and animation

Posted: May 5th, 2012, 4:38 pm
by Nekoneko
I have no clue what you are doing, but it looks pretty impressive (never thought you could play videos in cod multiplayer)

Re: Textures and animation

Posted: May 6th, 2012, 12:33 pm
by ThaWalrus
Haha, I thought the same.

I got it 'kind of' working, because some roq files will play and some roq files won't. I don't know why this is, and if anyone knows something about these functions and shaders, please tell me.

I'm happy because it works, but the results are not that satisfactioning as you might think.
Btw, there are 0 tutorials on how to implement such movies to cod, so it would be great if there are people that could make tutorials about this...

There are 3 ways to show roq files in-game.
1. Through menu's
2. On textures
3. On huds

Gr, Walrus

Re: Textures and animation

Posted: May 6th, 2012, 5:00 pm
by Nekoneko
so, if i had a .roq file, how would i proceed to see it ingame, like yours?
Where are .shader files located?

Re: Textures and animation

Posted: May 6th, 2012, 5:14 pm
by Rezil
Btw, there are 0 tutorials on how to implement such movies to cod, so it would be great if there are people that could make tutorials about this...
You're the first person to claim that you can play videos in-game(and has video footage to back it up). It's up to you to research this and provide us with a tutorial. :)

Re: Textures and animation

Posted: May 6th, 2012, 6:51 pm
by F |Madness| U
KillerSam wrote:
Rezil wrote:
Btw, there are 0 tutorials on how to implement such movies to cod, so it would be great if there are people that could make tutorials about this...
You're the first person to claim that you can play videos in-game(and has video footage to back it up). It's up to you to research this and provide us with a tutorial. :)
This. If it can be done and the file size isn't huge - this is massive.
You could almost say it's comparable to the size of Rezil's mapmaking skillzzzzzzz.

Re: Textures and animation

Posted: May 6th, 2012, 7:56 pm
by ThaWalrus
ThaWalrus wrote:I'm happy because it works, but the results are not that statisfactionary as you might think.
I need to figure things out first, but I am not the first one who claims he can do it. Look at the video of kaje11.

I just found the right function so it isn't that huge, however, I haven't seen something like this since cod1 has been published in 2003!

I could make a tutorial for this, but Call of Duty 1 is 'dying' and modders are rare...

Re: Textures and animation

Posted: May 6th, 2012, 9:35 pm
by F |Madness| U
Do you have any later CoD games such as CoD2 or CoD4 where you could test if the function works? May be useful in CoD4 perhaps.

Re: Textures and animation

Posted: May 7th, 2012, 10:24 am
by Rezil
F |Madness| U wrote:Do you have any later CoD games such as CoD2 or CoD4 where you could test if the function works? May be useful in CoD4 perhaps.
CoD4 has a way of playing video files as well, there's a mission in single player where at one point you look at a big screen and it's displaying the launch of a nuke and some troops moving IIRC. For CoD2 you'd have to research the way .roq files are played all over again as .shader files aren't used in CoD2.
TheWalrus wrote:I need to figure things out first, but I am not the first one who claims he can do it. Look at the video of kaje11.

I just found the right function so it isn't that huge, however, I haven't seen something like this since cod1 has been published in 2003!

I could make a tutorial for this, but Call of Duty 1 is 'dying' and modders are rare...
If it matters to you that a game is 'past its prime' then you're modding for the wrong reasons in my opinion. So far, kaje11 is the only one who has video proof that animated textures are in fact possible in CoD, and you're the one who has a way of displaying those textures.

I would still like to see a proof-of-concept or a tutorial showing the steps it takes to import a video file into CoD. Hopefully the fact the CoD is dying won't deter you from researching this further.

EDIT:
TheWalrus wrote:I got it 'kind of' working, because some roq files will play and some roq files won't. I don't know why this is, and if anyone knows something about these functions and shaders, please tell me.
I would imagine some .roq files are meant to be played 'fullscreen' and not mapped to a texture. The .roq file you want to play on a texture probably needs to be a power of two since regular textures have this requirement as well. I'm totally speculating here but it's worth a shot.

Re: Textures and animation

Posted: May 7th, 2012, 11:42 am
by ThaWalrus
Since I play CoD 1, I can't tell anything about CoD 4. So I don't know anything about these functions, roq files and shaders on CoD 4.

I found a couple of problems already, because there is a 3rd party program that allows it to convert AVI, GIF and JPG files into ROQ files. I tried to convert a couple of things, like gifs, but AVI files didn't quite work. The program says the resolution needs to be 512x384 although some of the stock video (ROQ) files aren't in this resolution and those are the ones that are working!

Importing those video's isn't very hard.

Here are a couple of steps you need to use in CoD 1:

1. Create a new shader (a new text file, with the extension .shader)
2. Create a new texture, it doesn't matter what's on this texture at all.(This step could be optional!)
3. Create a very small test map, with this own-made texture.
Put it in your pk3-file, with the texture and shaders.

4. Create a new ROQ file with the 3rd-party program (QVM)
Don't use this step if you just want to see how it works.
5. Create a new folder in your pk3 called "video", put your ROQ file in here.

6. Open your shader and use this peace of code:

Code: Select all

textures/thawalrus/thawalrus
{
surfaceparm nolightmap
noPicMip
noMipMaps
{
videomap cod_end.roq
rgbGen identity
}
}
The 1st line defines the texture that will be modified(where the movie is played on)
The 3-5 lines are needed to get the right settings for the environment.
The 7th line is the most important one, this will make the texture play the ROQ-Movie
The 8th line is used so all Colors are assumed to be white (1.0, 1.0, 1.0).

I will play the movie "cod_end.roq" here, because it didn't fail. ;)


This should do the trick... Tell me if there are any mistakes or questions about it ;)

Gr, Walrus

Re: Textures and animation

Posted: May 8th, 2012, 7:38 am
by ThaWalrus
Could you show me the video, and give me the 10+ mistakes in my 2-minute-made tutorial?

Would be more helpful, wouldn't it?

Re: Textures and animation

Posted: May 8th, 2012, 12:26 pm
by Rezil
megazor wrote:Walrus, I has found 10+ mistakes in your totorial and also I has a video proof that moving things in CoD1 are possible.
I have*

tutorial*

I have*

'proof' is uncountable -> video proof*
megazor wrote:You didn't put a space break between modified and the bracket - making your tutorial twice harder to read.
(stylistic choice) no hyphen between bracket and making*

twice as hard*

Re: Textures and animation

Posted: May 8th, 2012, 12:44 pm
by Drofder2004
Also, "space break" is not a term used to describe a 'space' and a "moving texture" is not the same as a "video texture".
Everyone knows you can have moving textures in CoD1, that is how they made the tank tracks look like they were moving.

Re: Textures and animation

Posted: May 8th, 2012, 2:11 pm
by Rezil

Re: Textures and animation

Posted: May 8th, 2012, 3:47 pm
by ThaWalrus
Could we please get on topic?

I'm trying to solve some problems here, but nobody seems to know anything about it. That isn't a problem, but maybe we can get some results here.