Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Video as texture on blocks OR entities #64799
02/21/06 16:13
02/21/06 16:13
Joined: Jan 2006
Posts: 20
C
carcorde Offline OP
Newbie
carcorde  Offline OP
Newbie
C

Joined: Jan 2006
Posts: 20
My first post here... Is there any way of displaying video inside my level, such as a TV monitor or computer screen showing a movie? I have tried everything that I could imagine, with no positive results. Thanks for any help that you guys could give me..

Re: Video as texture on blocks OR entities [Re: carcorde] #64800
02/21/06 17:06
02/21/06 17:06
Joined: May 2005
Posts: 338
Brasil
Filipe Offline
Senior Member
Filipe  Offline
Senior Member

Joined: May 2005
Posts: 338
Brasil
yes, it is possible (needs the commercial or pro edition).

from the manual:
Quote:

Code:

// Play film"news.avi" on the tv_model entity with maximum volume
media_play("news.avi",bmap_for_entity(tv_model,0),100);






Edit:
with the pro edition, you can even render a diferent view onto an entity or sprite.

Last edited by Filipe; 02/21/06 17:08.
Re: Video as texture on blocks OR entities [Re: Filipe] #64801
02/22/06 10:43
02/22/06 10:43
Joined: Jan 2006
Posts: 20
C
carcorde Offline OP
Newbie
carcorde  Offline OP
Newbie
C

Joined: Jan 2006
Posts: 20
Thanks a lot, man. I think I should´ve read the manual with a little more attention

Re: Video as texture on blocks OR entities [Re: carcorde] #64802
02/24/06 14:25
02/24/06 14:25
Joined: Jan 2006
Posts: 20
C
carcorde Offline OP
Newbie
carcorde  Offline OP
Newbie
C

Joined: Jan 2006
Posts: 20
Forgive my ignorance since I am a complete newbie as far as scripts go (I´m a 3d animator), but, I tried to include the script that calls the video to the entity´s texture bitmap in the main script, and also tried to put the code directly in it, before de "main" function. But it doesn´t work. Maybe it has to be attached directly to the entity? If so, how do I do it?

Re: Video as texture on blocks OR entities [Re: carcorde] #64803
03/01/06 15:10
03/01/06 15:10
Joined: May 2005
Posts: 338
Brasil
Filipe Offline
Senior Member
Filipe  Offline
Senior Member

Joined: May 2005
Posts: 338
Brasil
you can put it in the entity's action, like this:

Code:

action your_entity_action
{

// Play film"news.avi" on the entity with maximum volume
media_play("news.avi",bmap_for_entity(my,0),100);

// do all the stuff your entity does
// ...
}



or you can assign a pointer to the entity you want and then play the movie any time, like in the main function:

Code:

entity* tv_model;
function main()
{
//something, something...

level_load("whatever.wmb");
wait(3);
// Play film"news.avi" on the tv_model entity with maximum volume
media_play("news.avi",bmap_for_entity(tv_model,0),100);

//etc, etc, etc...
}

action your_entity_action
{
tv_model = my;

// do all the stuff your entity does
// ...
}



Re: Video as texture on blocks OR entities [Re: Filipe] #64804
03/03/06 21:05
03/03/06 21:05
Joined: Jan 2006
Posts: 20
C
carcorde Offline OP
Newbie
carcorde  Offline OP
Newbie
C

Joined: Jan 2006
Posts: 20
I got it to work now! I´m no programmer at all, far from it, but I´m finally starting to get the hang of it. Quite fun, to tell the truth.
Now, it there any way to limit the range of the video´s audio track? Because now, once the video starts playing, even players that are not close by or even in the same room can hear it (it´s a multiplayer level)
Thanks a lot for all your help.

Re: Video as texture on blocks OR entities [Re: carcorde] #64805
03/08/06 18:06
03/08/06 18:06
Joined: May 2005
Posts: 338
Brasil
Filipe Offline
Senior Member
Filipe  Offline
Senior Member

Joined: May 2005
Posts: 338
Brasil
hm, i don't know if there's a direct way of doing that, but one way to do it would be a function checking the player distance and adjusting the volume with media_tune() accordingly.
another way would be have the sound in a separate file from the video and then playing the sound with ent_playsound()...

Re: Video as texture on blocks OR entities [Re: Filipe] #64806
03/10/06 21:35
03/10/06 21:35
Joined: Jan 2006
Posts: 20
C
carcorde Offline OP
Newbie
carcorde  Offline OP
Newbie
C

Joined: Jan 2006
Posts: 20
Yeah, that´s what I ended up doing, separating audio and video, and starting them separately. The only problem that I´m getting now it that there´s a tiny delay between them while playing, and of course they start to get out-of-sync after a while. But I suspect that´s a hardware problem, since the delay is different among several machines, from almost none to several seconds.
Thanks a lot again for your help.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1